<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 tellurium-web REST API Client
The following tutorial demonstrates how to access tellurium-web via the python API.
To run the notebook create a virtualenv with the requirements
cd api
mkvirtualenv teweb-api --python=python3
(teweb-api) pip install api-requirements.txt
(teweb-api) python -m ipykernel install --user --name=teweb-api
(teweb-api) jupyter notebook api.ipynb
Alternatively you can install the dependency via pip
pip install coreapi
Step1:  COMBINE archives
Overview over available functionality, keys in [] are optional params
Step2:  Tags
Overview over available functionality, keys in [] are optional params
Step3:  Users
Overview over available functionality, keys in [] are optional params
Step4:  Examples queries
Get all archives
Step5:  Search for archives with given tag
Uses the tag pk to search.
Step6:  Get all tags
Step7:  Search for tags by type
Step8:  Get all users
Step9:  search for users
<ASSISTANT_TASK:>
Python Code:
BASE_URL = "http://127.0.0.1:8001"
import os
import coreapi
import json
import pandas as pd
# some of the functionality requires authentication
auth = coreapi.auth.BasicAuthentication(
    username='mkoenig',
    password=os.environ['DJANGO_ADMIN_PASSWORD']
)
client = coreapi.Client(auth=auth)
# get the api scema
document = client.get(BASE_URL + "/api/")
print(document.title)
print(document.url)
Explanation: tellurium-web REST API Client
The following tutorial demonstrates how to access tellurium-web via the python API.
To run the notebook create a virtualenv with the requirements
cd api
mkvirtualenv teweb-api --python=python3
(teweb-api) pip install api-requirements.txt
(teweb-api) python -m ipykernel install --user --name=teweb-api
(teweb-api) jupyter notebook api.ipynb
Alternatively you can install the dependency via pip
pip install coreapi
End of explanation
print(document["archives"])
Explanation: COMBINE archives
Overview over available functionality, keys in [] are optional params
End of explanation
print(document["tags"])
Explanation: Tags
Overview over available functionality, keys in [] are optional params
End of explanation
print(document["users"])
Explanation: Users
Overview over available functionality, keys in [] are optional params
End of explanation
data = client.action(document,["archives", "list"])
df = pd.read_json(json.dumps(data, indent=4))
print(df.head())
Explanation: Examples queries
Get all archives
End of explanation
data = client.action(document,["archives", "list"], params={"tags": 1})
print(json.dumps(data, indent=4))
Explanation: Search for archives with given tag
Uses the tag pk to search.
End of explanation
data = client.action(document,["tags", "list"])
df = pd.read_json(json.dumps(data, indent=4))
df
Explanation: Get all tags
End of explanation
data = client.action(document,["tags", "list"], params={"type":"format"} )
# print(json.dumps(data,indent=4))
df = pd.read_json(json.dumps(data, indent=4))
df
Explanation: Search for tags by type
End of explanation
data = client.action(document,["users", "list"])
df = pd.read_json(json.dumps(data, indent=4))
df
Explanation: Get all users
End of explanation
data = client.action(document,["users", "list",], params={"search":"ja"} )
print(json.dumps(data,indent=4))
# search in archives for SBML
data = client.action(document,["archives", "list"], params={"search":"sbml"} )
print(json.dumps(data, indent=4))
Explanation: search for users
End of explanation
<END_TASK>