-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add configuration storage class. Made DigikeyAPI into a class #15
base: master
Are you sure you want to change the base?
Conversation
This is an interesting proposition and I hope to see this being merged. @peeter123 Any plan to review this soon? @Electro707 Do you need help with testing? |
@eeintech Sure, just beware that A) This is not too well documented which is something I need to do, and B) Only works with V3 API. @peeter123 Is it even worth it to add support to v2 even tough it's deprecated by Digikey, or is it time to drop V2 support? |
@peeter123 Any thoughts on the V2 API, if I should add this new config class to it or if it should be deprecated? |
I will look into this, I think we can make a 1.0 version where we drop the V2 API completely. What do you think? |
Could you rebase on development-1.0 branch in peeter123/digikey-api? |
…ect new changes. Added the configurations to __init__ for importing digikey. Minor message fix
d0a36ea
to
74ba3af
Compare
Rebasing is done. |
This PR adds a method of setting and saving this package's settings (like
client-id
andrefresh-token
) without needing to use OS environment variables.Main changes includes:
DigikeyAPI
class.DigikeyAPI
. This class includes all necessary functions to be able to save and get configurations. The parent class isDigikeyBaseConfig
, which that one does nothing but outline what functions any child class must override. As of right now I've only 1 config storage method/kind underDigikeyJsonConfig
, which stores and retrieves configurations in a JSON file.needs_client_id()
,needs_client_secret()
, andset_client_info()
to allow the user to know if said info are needed and to be able to give them to this library.TODO:
DigikeyBaseConfig
further to specify how a user can create their own (for example if someone wants to store said settings inside a database).Change V2's code to allow for the new configuration:Is this even worth it, or is it better to drop V2 support?