Pydent is the python API for Aquarium.
API documentation can be found here at http://aquariumbio.github.io/pydent
- Python > 3.4
- An Aquarium login
Pydent can be installed using pip3.
pip3 install pydent
or upgraded using
pip3 install pydent --upgrade
from pydent import AqSession
# open a session
mysession = AqSession("username", "password", "www.aquarium_nursery.url")
# find a user
u = mysession.User.find(1)
# print the user data
print(u)print(mysession.models)-
By name:
nursery.SampleType.find_by_name("Primer") -
By ID:
nursery.SampleType.find(1) -
By property:
nursery.SampleType.where({'name': 'Primer'}) -
All models:
nursery.SampleType.all()
# samples are linked to sample_type
primer_type = mysession.SampleType.find_by_name("Primer")
primers = primer_type.samples
# and sample type is linked to sample
p = primers[0]
print(p.sample_type)primer_type = mysession.SampleType.find(1)
print(primer_type.get_relationships())Update dependencies
poetry updatepoetry build
poetry publishTo use a pypi token, the user name should be __token__ and the password should be the token including the pypi- prefix.
Update documents with make docs