A Python wrapper for the iRODS HTTP API
Project description
iRODS HTTP API Python Wrapper
This is a Python wrapper for the iRODS HTTP API.
Documentation for the endpoint operations can be found here.
Install
This wrapper is available via pip:
pip install irods-http
Usage
To use the wrapper, follow the steps listed below.
import irods_http
# Placeholder values needed for irods_http.authenticate()
url_base = "http://<host>:<port>/irods-http-api/<version>"
username = "<username>"
password = "<password>"
# Create an IRODSHTTPSession to an iRODS HTTP API server
session = irods_http.authenticate(url_base, username, password)
# Use the session for all other operations
response = irods_http.collections.create(session, '/<zone_name>/home/<username>/new_collection')
# Check the resopnse for errors
if response['status_code'] != 200:
# Handle HTTP error.
if response['data']['irods_response']['status_code'] < 0:
# Handle iRODS error.
The response dict will have this format:
{
'status_code': <integer>,
'data': <dict>
}
where status_code is the HTTP status code from the response, and data is the result of the iRODS operation.
response['data'] will contain a dict named irods_response, which will contain the status_code returned by the iRODS Server as well as any other expected properties.
{
'irods_response': {
'status_code': <integer>
# Other properties vary between endpoints
}
}
When calling data_objects.read(), the response['data'] will contain the raw bytes instead of a dict.
More information regarding iRODS HTTP API response data is available here.
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
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 irods_http-0.1.0.tar.gz.
File metadata
- Download URL: irods_http-0.1.0.tar.gz
- Upload date:
- Size: 30.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97f08f94dc9ec39cb1d30c69822143ee9d1da4798a4be231ee941e8675987920
|
|
| MD5 |
b90b0f319fea6d91543932d8f460d564
|
|
| BLAKE2b-256 |
d854159988201823b7d2e36e71e527bdfa23d340bd134360516336e0bbbaaa71
|
File details
Details for the file irods_http-0.1.0-py3-none-any.whl.
File metadata
- Download URL: irods_http-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3db8a327c48e75b8ba5c1807146e6f0b7b2fc947854a07b8d1f5a71cabd2895
|
|
| MD5 |
cc93a94c7970ec1a2ab20684ceaed1e4
|
|
| BLAKE2b-256 |
8666cfc57c3650b185c26064dc8ec9cc96684cb97577a301ccafb750f2e5d150
|