MyKeys
MyKeys is a simple library to help with roaming various OAuth keys and secrets.
OAuth key/secret pairs granted by various websites (like Twitter, GoodReads etc.) shouldn't be checked into public repositories. Storing them in config files or env variables is possible, but makes roaming them inconvenient.
MyKeys provides a simple interface to parse key/secret pairs from a standard config file:
[twitter]
key = MyTwitterKey
secret = MyTwitterSecret
[goodreads]
key = MyGoodReadsKey
secret = MyGoodReadsSecret
This file can be pushed to a private repository, roamed via DropBox etc. so it can be moved across machines privately.
For each system on which MyKeys is installed, it just needs to know where this file is:
mykeys -f ~/mykeyfile
Once set, any script importing MyKeys can retrieve keys/secrets from the file:
from mykeys.keys import Keys
key, secret = Keys.twitter.key, Keys.twitter.secret
Internally, MyKeys dynamically generates a Keys object with an attribute for
each section of type KeySecretPair
which is a simple type containing a key
and a secret
attribute.
Installation
pip install mykeys
Only Python3 is supported