Global Configuration¶
ccapi introduces a global configuration object. You can configure all settings which will be respected while you use ccapi.
You can get a configuration object in the following way:
[1]:
import ccapi
[2]:
config = ccapi.Configuration()
The configuration object is a singleton. That means only one instance can exist and it is respected everywhere in ccapi.
URL¶
By default, the base URL points to Cell Collective. You can however, change the same as follows:
[3]:
config.url = "https://test.cellcollective.org"
Now, when you attempt to create a client instance, it would attempt to use the value assigned to config.url
.
[4]:
client = ccapi.Client()
client
[4]:
<Client url='https://test.cellcollective.org'>
Jupyter Notebook renders the Configuration
object as follows:
[5]:
config
[5]:
display_max_cols | 20 |
display_max_rows | 15 |
ginsim_version | 2.4 |
max_api_resource_fetch | 5 |
max_chunk_download_bytes | 1024 |
model_domain_type | {'value': 'research'} |
model_name | Unnamed Model |
model_type | {'value': 'boolean'} |
url | https://test.cellcollective.org |
user_agent | Python CCAPI / 0.1.0 |