{"id":29357086,"url":"https://github.com/cesnet/ltp-api-client-lib","last_synced_at":"2025-10-08T00:22:15.999Z","repository":{"id":37935353,"uuid":"270044313","full_name":"CESNET/ltp-api-client-lib","owner":"CESNET","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-13T15:38:20.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-07-09T05:44:03.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CESNET.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-06T16:54:24.000Z","updated_at":"2022-05-26T13:27:32.000Z","dependencies_parsed_at":"2023-01-28T13:16:31.157Z","dependency_job_id":null,"html_url":"https://github.com/CESNET/ltp-api-client-lib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CESNET/ltp-api-client-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CESNET%2Fltp-api-client-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CESNET%2Fltp-api-client-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CESNET%2Fltp-api-client-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CESNET%2Fltp-api-client-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CESNET","download_url":"https://codeload.github.com/CESNET/ltp-api-client-lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CESNET%2Fltp-api-client-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278868592,"owners_count":26060002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-09T05:41:48.458Z","updated_at":"2025-10-08T00:22:15.994Z","avatar_url":"https://github.com/CESNET.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LTP-API client lib\nLibrary for client calls to LTP-API.\n\n## Installing\n\n* Install ```requests``` system packages\n* Build \u0026 Install ltp-api-client-lib with poetry:\n```python\npip install poetry\ngit clone https://github.com/CESNET/ltp-api-client-lib\ncd ltp-api-client-lib\npoetry build\ncd dist\ntar -xvf ltp-api-client-lib-0.1.0.tar.gz\npip install -e ltp-api-client-lib-0.1.0/\n```\n\n## How to use CLI\n### 1) You need token \n#### How to get token\n\n1) Login to api web (`https://url:\u003cport\u003e/api/`)  or ltp web (`https://url:\u003cport\u003e`).\n2) After all of this you can create token on `https://url:\u003cport\u003e/api/`\n    in `/auth/token/create/` endpoint. This token may expire so this step you may repeated after while.\n    this will return something like this:\n    ```\n        {\n          \"expiry\": \"2020-04-23T05:05:13.639245\",\n          \"token\": \"5616b341f38d64d13a33c487bb852e1f12b5d0a3390433c56c13a0790b6f694c\", \u003c-- THIS IS TOKEN\n          \"user\": {\n            \"username\": \"username for your admin\"\n          }\n        }\n    ```\nNow you can call endpoint with token.\n\nFor CESNET LTP you have to generate the token in the [LTP GUI](https://du.cesnet.cz/cs/navody/ltp/start#user_profile).\n\n### 2) You need to know uuid group \n\nThen you have all information what you need to use CLI.\n\nIn case of CESNET LTP group identificator can be found in the [user profile](https://du.cesnet.cz/cs/navody/ltp/start#user_profile).\n\n## Examples\n### Help\n```\n❯ python3 ltp_api_client.py --help\nUsage: ltp_api_client.py [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  -t, --token TEXT    Token for communication with LTP API  [required]  \n  -c, --context TEXT  Context/group for communication with LTP API  [required] \n  -a, --address TEXT  Http address of  LTP API\n  --help              Show this message and exit.\n\nCommands:\n  archive\n  audit\n  bagit\n```\n\nUpload/Create:\n```\npython3 ltp_api_client.py -t $API_KEY -c 50b6eGroup_ID409917 -a https://ltp.cesnet.cz/api/ archive create -d '{\"name\":\"test python cli\", \"user_metadata\":{}}' -p /home/user/Desktop/my_bagit_arch.zip \n```\nDownload:\n```\npython3 ltp_api_client.py -t $API_KEY -c 50b6eGroup_ID409917 -a https://ltp.cesnet.cz/api/ archive download -i 163 -p /tmp/testout.zip\n```\nList:\n```\npython3 ltp_api_client.py -t $API_KEY -c 50b6eGroup_ID409917 -a https://ltp.cesnet.cz/api/ archive list\n```\nUpdate metadata:\n```\npython3 ltp_api_client.py -t $API_KEY -c 50b6eGroup_ID409917 -a https://ltp.cesnet.cz/api/ archive update -d '{\"name\":\"test python cli\", \"user_metadata\":{\"author\":\"Albert\"}}' -i 166\n```\nList audit logs:\n```\npython3 ltp_api_client.py -t $API_KEY -c 50b6eGroup_ID409917 -a https://ltp.cesnet.cz/api/ audit list\n```\nCreate bagit:\n```\npython3 ltp_api_client.py bagit build -p \u003cpath\u003e -j \"{'Contact-Name': 'John Kunze'}\"\n```\nValidate bagit:\n```\npython3 ltp_api_client.py bagit validate -p \u003cpath\u003e\n```\nZip dir:\n```\npython3 ltp_api_client.py bagit zipit -z \u003czip_name\u003e -p \u003cpath\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcesnet%2Fltp-api-client-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcesnet%2Fltp-api-client-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcesnet%2Fltp-api-client-lib/lists"}