Add configuration storage class. Made DigikeyAPI into a class#15
Open
Electro707 wants to merge 8 commits intopeeter123:masterfrom
Open
Add configuration storage class. Made DigikeyAPI into a class#15Electro707 wants to merge 8 commits intopeeter123:masterfrom
Electro707 wants to merge 8 commits intopeeter123:masterfrom
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? |
Author
|
@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? |
Author
|
@peeter123 Any thoughts on the V2 API, if I should add this new config class to it or if it should be deprecated? |
Owner
|
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? |
Closed
Owner
|
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
Author
|
Rebasing is done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a method of setting and saving this package's settings (like
client-idandrefresh-token) without needing to use OS environment variables.Main changes includes:
DigikeyAPIclass.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:
DigikeyBaseConfigfurther 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?