peeter123 / digikey-api

Python module for the Digikey PartSearch API
GNU General Public License v3.0
85 stars 35 forks source link

API V2 down for good? #26

Closed peeter123 closed 2 years ago

peeter123 commented 2 years ago

https://api.digikey.com/services/partsearch/v2 returns an error:

{
   "fault":{
      "faultstring":"Unable to identify proxy for host: secure and url: \/services\/partsearch\/v2",
      "detail":{
         "errorcode":"messaging.adaptors.http.flow.ApplicationNotFound"
      }
   }
}

I think we can work towards a V1.0 release which removes the v2 API. This also enables PR #15 to be moved forward.

subx99 commented 2 years ago

Any plans to progress this?

eeintech commented 2 years ago

@peeter123 The v2 code is causing an import error with Python 3.10 as the schematics library it uses still calls the Iterable from the Python collections package, which was deprecated in 3.10:

 File "/usr/lib/python3.10/site-packages/digikey/__init__.py", line 2, in <module>
    from digikey.v2.api import (search, part)
  File "/usr/lib/python3.10/site-packages/digikey/v2/api.py", line 7, in <module>
    from digikey.v2 import models
  File "/usr/lib/python3.10/site-packages/digikey/v2/models.py", line 8, in <module>
    from schematics.exceptions import ConversionError, DataError, ValidationError
  File "/usr/lib/python3.10/site-packages/schematics/__init__.py", line 6, in <module>
    from . import deprecated
  File "/usr/lib/python3.10/site-packages/schematics/deprecated.py", line 8, in <module>
    from .types.serializable import Serializable
  File "/usr/lib/python3.10/site-packages/schematics/types/__init__.py", line 2, in <module>
    from .base import *
  File "/usr/lib/python3.10/site-packages/schematics/types/base.py", line 19, in <module>
    from collections import Iterable, OrderedDict
ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib/python3.10/collections/__init__.py)

Reference: https://github.com/schematics/schematics/issues/628

So I also vote to remove the v2 API, it should fix this issue.

eeintech commented 2 years ago

@peeter123 What do you think? Can V2 be scrapped and can we get a 0.6.2 release without it?

peeter123 commented 2 years ago

Sound good, I prefer to do a major release as this is kind of a breaking change. Lets call it 1.0.0.

peeter123 commented 2 years ago

@eeintech I have updated to 1.0.0 on PyPi, would you be so kind to test? Thanks!

eeintech commented 2 years ago

@peeter123 It looks great on my side! Thanks! :partying_face: