D2IR Client for Python
D2IRClient implements a basic API client for the Direct to INN-Reach (D2IR) API for INN-Reach resource sharing services.
Getting Started
Installation
pip intall d2irclient
or
uv pip install d2irclient
Environment Variables
We recommend setting your connection parameters via environment variable:
export D2IR_API_KEY='<api_key>'
export D2IR_API_SECRET='<api_secret>'
export D2IR_AUTH_URL='https://<d2ir_server_domain>/auth/v1/oauth2/token'
export D2IR_ROOT_URL='https://<d2ir_server_domain>/innreach/'
export D2IR_LOCAL_SERVER_CODE='<local_server_code>'
export D2IR_CENTRAL_SERVER_CODE='<central_server_code>'
Connecting to the D2IR service
from d2irclient.D2IRClient import D2IRClient
dc = D2IRClient(
auth_url=os.environ.get("D2IR_AUTH_URL"),
root_url=os.environ.get("D2IR_ROOT_URL"),
auth_key=os.environ.get("D2IR_API_KEY"),
auth_secret=os.environ.get("D2IR_ROOT_URL"),
from_server_code=os.environ.get("D2IR_LOCAL_SERVER_CODE"),
to_server_code=os.environ.get("D2IR_CENTRAL_SERVER_CODE")
)
Calling APIs
# Fetch the current list of contributed locations
location_config = dc.d2ir_get("v2/contribution/locations")
# Add a location
location_config["locationList"].append({"locationKey": "abcde", "description": "Alphabet Library"})
# Replace all locations with updated list
_ = dc.d2ir_post("v2/contribution/locations", json=location_config)
Release files for d2irclient 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| d2irclient-0.1.1.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| d2irclient-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.8 kB
Release files / d2irclient-0.1.1.tar.gz
| Download URL | d2irclient-0.1.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f337af3c20b1089b496285130b58bd26337e85b9fd62e63b97bbb8248d06785b
|
|
BLAKE2b-256 checksum How to use checksums |
2255c046356c062046baef19836a54763ee8f85abee94ebe04997e90caed12c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2025.
Transparency logRelease files / d2irclient-0.1.1-py3-none-any.whl
| Download URL | d2irclient-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
136340d97456382b9e2233480a17220eefbab75950b2b67466bc6bede5f6d95e
|
|
BLAKE2b-256 checksum How to use checksums |
db16b69138101ddcb3f477e55ceeca75ea88d95d11fbe32ef0c546916bbfa288
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2025.
Transparency log