A python client for the Direct to INN-Reach (D2IR) API
Project description
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(
d2ir_auth_url=os.environ.get("D2IR_AUTH_URL"),
d2ir_root_url=os.environ.get("D2IR_ROOT_URL"),
d2ir_key=os.environ.get("D2IR_API_KEY"),
d2ir_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)
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 d2irclient-0.1.0.tar.gz.
File metadata
- Download URL: d2irclient-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93c36c837444e148539236eed770cc090f13c5820449af35b68ac3d5d72b44ab
|
|
| MD5 |
40078b655959612fddb9061ea5efa207
|
|
| BLAKE2b-256 |
d744ddedfa670885a3ada91e0af5ddd97c53a372649d4fd9980ff9c278a5c098
|
Provenance
The following attestation bundles were made for d2irclient-0.1.0.tar.gz:
Publisher:
python-publish.yml on FOLIO-FSE/d2irclient
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
d2irclient-0.1.0.tar.gz -
Subject digest:
93c36c837444e148539236eed770cc090f13c5820449af35b68ac3d5d72b44ab - Sigstore transparency entry: 630417865
- Sigstore integration time:
-
Permalink:
FOLIO-FSE/d2irclient@3c327d35b79b982077540209b95583dfec6022b0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FOLIO-FSE
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3c327d35b79b982077540209b95583dfec6022b0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file d2irclient-0.1.0-py3-none-any.whl.
File metadata
- Download URL: d2irclient-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
890ff5d368badac00ed271f800b45c200c04692d9a6c980caf95e008fb5196b7
|
|
| MD5 |
f327282c531b58dee37edbc832625759
|
|
| BLAKE2b-256 |
739da6b9daa97ab9e7d37cf0834550aa0181f1a708c3d6fe1413d16828d99404
|
Provenance
The following attestation bundles were made for d2irclient-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on FOLIO-FSE/d2irclient
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
d2irclient-0.1.0-py3-none-any.whl -
Subject digest:
890ff5d368badac00ed271f800b45c200c04692d9a6c980caf95e008fb5196b7 - Sigstore transparency entry: 630417889
- Sigstore integration time:
-
Permalink:
FOLIO-FSE/d2irclient@3c327d35b79b982077540209b95583dfec6022b0 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FOLIO-FSE
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3c327d35b79b982077540209b95583dfec6022b0 -
Trigger Event:
release
-
Statement type: