Skip to content
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

Check username and password from environment variables #9

Open
cthoyt opened this issue Feb 13, 2017 · 0 comments
Open

Check username and password from environment variables #9

cthoyt opened this issue Feb 13, 2017 · 0 comments

Comments

@cthoyt
Copy link
Contributor

cthoyt commented Feb 13, 2017

It would be convenient to set the username and password in the environment variables, and have the python client look for those automatically if the username and password aren't explicitly set in the kwargs, maybe like this:

class NdexGraph (MultiDiGraph):
    """A graph compatible with NDEx"""
    def __init__(self, cx=None, server=None, username=None, password=None, uuid=None, networkx_G=None, data=None, **attr):

        ...

        if username is None and 'NDEX_USERNAME' in os.environ:
              username = os.environ['NDEX_USERNAME']
    
        if password is None and 'NDEX_PASSWORD' in os.environ:
              password = os.environ['NDEX_PASSWORD']

        ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant