I would like to open-source a python project on Github but it contains an API key that should not be distributed.
I guess there's something better than removing the key each time a "push" is committed to the repo.
Imagine a simplified foomodule.py
:
import urllib2
API_KEY = 'XXXXXXXXX'
urllib2.urlopen("http://example.com/foo?id=123%s" % API_KEY ).read()
What i'm thinking is:
Move the API_KEY in a second
key.py
module importing it onfoomodule.py
; i would then addkey.py
on.gitignore
file.Same as 1. but using
ConfigParser
Do you know any good programmatic way to handle this scenario?