Trackl Python Client
Project description
Trackl Python Client
Install
python3 -m pip install git+https://gitlab.com/denny.weinberg/trackl-python-client
or
python3 -m pip install trackl-python-client
Python
Usage/Init
from trackl_client import TracklClient
client = TracklClient(api_endpoint='http://localhost:8080/api/v1', api_key='ey...')
# Or with workspace, email and password
client = TracklClient(api_endpoint='http://localhost:8080/api/v1', workspace='test' login_email='test@test.com', password='test')
Examples
# Teams: List
teams = client.teams_list()
# Teams: Search
teams = client.teams_search(name='Name')
# Teams: Create
team = client.teams_create(True, 'Name')
# Users: List
users = client.users_list()
# Users: Search
users = client.users_search(email='test@test.com')
# Users: Create
user = client.users_create(True, 'email', 'Name', 'testPWD123$', ['record.read', 'record.write'])
# Teams: Add User
client.teams_add_user(team_name='Name', user_email='test@test.com')
# Teams: Remove User
client.teams_remove_user(team_name='Name', user_email='test@test.com')
# Teams: List Users
users = client.teams_list_users(team_name='Office')
# Records: Search
records = client.records_search(page=1, page_type='elements', id='1,2', page_size=200, start_date_time_from='2022-10-01', start_date_time_to='2022-10-05', end_date_time_is_null=False, include_user_name=True)
# Records: Validate
record_validity_infos = client.records_validate(1)
CLI
Usage
python3 -m trackl_client.cli
--api_endpoint ${api_endpoint} --workspace ${workspace} --api_key ${api_key} --login_email ${login_email} --password ${password}
users_create|teams_create|teams_add_user|teams_remove_user
[--help]
other_arg_1 --other_kwarg_1
# More:
# python3 -m trackl_client.cli --help
# python3 -m trackl_client.cli records_search --help
Init
export api_endpoint='http://localhost:8080/api/v1'
export api_key='ey...'
# Or with workspace, email and password
# export workspace='test'
# export login_email='test@test.com'
# export password='test'
Examples
# Teams: List
python3 -m trackl_client.cli teams_list
# Teams: Search
python3 -m trackl_client.cli teams_search --name Name
# Teams: Create
python3 -m trackl_client.cli teams_create True Name
# Users: List
python3 -m trackl_client.cli users_list
# Users: Search
python3 -m trackl_client.cli users_search --email test@test.com
# Users: Create
python3 -m trackl_client.cli users_create True email Name testPWD123$ record.read,record.write
# Teams: Add User
python3 -m trackl_client.cli teams_add_user --team_name Name --user_email test@test.com
# Teams: Remove User
python3 -m trackl_client.cli teams_remove_user --team_name Name --user_email test@test.com
# Teams: List Users
python3 -m trackl_client.cli teams_list_users --team_name Office
# Records: Search
python3 -m trackl_client.cli records_search --page 1 --page_type elements --id 1,2 --page_size 200 --start_date_time_from 2022-10-01 --start_date_time_to 2022-10-05 --end_date_time_is_null false --include_user_name True
# Records: Validate
python3 -m trackl_client.cli records_validate 1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
trackl_client-2.1.1.tar.gz
(3.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trackl_client-2.1.1.tar.gz.
File metadata
- Download URL: trackl_client-2.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.8 Darwin/22.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e86e058bc5b3046beef57f1b0cb9860dafa5af96f3b41891b7527035dc650a16
|
|
| MD5 |
5012e50a04126e3b60d1fed67bc2a84b
|
|
| BLAKE2b-256 |
89f08474a3ac38a8c0992fa0fae4154e32855ba1f320b61c0faab5b12d361c07
|
File details
Details for the file trackl_client-2.1.1-py3-none-any.whl.
File metadata
- Download URL: trackl_client-2.1.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.1 CPython/3.10.8 Darwin/22.2.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
034eaba75f24427e1b2545ac81d7a77b4d2c9842c9c75aa609b0685ffae89f83
|
|
| MD5 |
a742d6cd18836f61034db404df18bc49
|
|
| BLAKE2b-256 |
ed48565521e86cad7d9df802636865ff8a2e1f74b56c87cdb30efb777abdbfed
|