Token

class pyrefinebio.Token(email_address=None, id=None)

Handles the creation, activation, saving, and loading of refine.bio’s api tokens.

These tokens can be used in requests that provide urls to download computed files.

Please review refine.bio’s [Terms of Use](https://www.refine.bio/terms) and [Privacy Policy](https://www.refine.bio/privacy) before use of these tokens.

Create a new Token

>>> import pyrefinebio
>>> token = pyrefinebio.Token(email_address="foo@bar.com")

Create a Token and activate it

>>> import pyrefinebio
>>> token = pyrefinebio.Token(email_address="foo@bar.com")
>>> token.agree_to_terms_and_conditions()

Save a Token to the config file

>>> import pyrefinebio
>>> token = pyrefinebio.Token(email_address="foo@bar.com")
>>> token.save_token()

Load the Token that is currently set to Config

>>> import pyrefinebio
>>> token = pyrefinebio.Token.load_token()
agree_to_terms_and_conditions()

Activates a token.

Tokens that are activated will be added to Config and can be used to make requests until pyrefinebio is re-imported.

If you would like to continue using the same Token for other scripts that use pyrefinebio save the Token to the Config file using save_token().

Activating a token indicates agreement with refine.bio’s [Terms of Use](https://www.refine.bio/terms) and [Privacy Policy](https://www.refine.bio/privacy).

classmethod load_token()

Loads the token that’s currently set to Config.

save_token()

Saves a token to the config file.

The default config file is ~/.refinebio.yaml, but you can use the environment variable CONFIG_FILE to change this path