Skip to content

Commit

Permalink
Merge pull request #20 from kghosesbg/develop
Browse files Browse the repository at this point in the history
Making some code usage clearer
  • Loading branch information
SenadI committed Aug 16, 2016
2 parents 4f54291 + b6337c8 commit ad01e6b
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ configuration. There are three ways you can pass configure the library:
`API_URL` and `AUTH_TOKEN` respectively.
3. Use the configuration file `$HOME/.sbgrc` with defined parameters.


### Explicit initialization

``` {.sourceCode .python}
import sevenbridges as sbg
config_config_file = sbg.Config(url='https://api.sbgenomics.com/v2', token='<TOKEN_HERE>')
api_config = sbg.Config(url='https://api.sbgenomics.com/v2', token='<TOKEN_HERE>')
```


### Initialization via environment variables

``` {.sourceCode .python}
import sevenbridges as sbg
Expand All @@ -123,12 +129,15 @@ import os
os.environ['API_URL'] = 'https://api.sbgenomics.com/v2'
os.environ['AUTH_TOKEN'] = '<TOKEN_HERE>'
config_config_file = sbg.Config()
api_config = sbg.Config()
```


### Initialization via config file

``` {.sourceCode .python}
import sevenbridges as sbg
config_config_file = sbg.Config(profile='my-profile')
api_config = sbg.Config(profile='my-profile')
```

### Notes on config file format
Expand All @@ -152,7 +161,8 @@ constructor.

``` {.sourceCode .python}
import sevenbridges as sbg
api = sbg.Api(config=config_environment)
api_config = sbg.Config() # Or any other choice of initialization method
api = sbg.Api(config=api_config)
```

Examples
Expand All @@ -164,7 +174,8 @@ more detailed examples consult the documentation, hosted on readthedocs.
``` {.sourceCode .python}
import sevenbridges as sbg
api = sbg.Api(config=config_environment)
api_config = sbg.Config() # Or any other choice of initialization method
api = sbg.Api(config=api_config)
# Get current user
user = api.users.me()
Expand Down

0 comments on commit ad01e6b

Please sign in to comment.