Skip to content

Check username and password from environment variables #9

@cthoyt

Description

@cthoyt

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']

        ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions