python-tind-client
Python library for interacting with the TIND DA API.
Requirements
- Python 3.12+
Installation
pip install python-tind-client
Install with optional development dependencies:
pip install "python-tind-client[dev]" # test + lint + debug
pip install "python-tind-client[test]" # pytest + requests-mock
pip install "python-tind-client[lint]" # mypy + pydoclint + pylint
pip install "python-tind-client[debug]" # debugpy
Configuration
Create a TINDClient with optional configuration values:
api_key(optional): Your TIND API token. Falls back to theTIND_API_KEYenvironment variable.api_url(optional): Base URL of the TIND instance (e.g.https://tind.example.edu). Falls back to theTIND_API_URLenvironment variable.default_storage_dir(optional): Default output directory for downloaded files. Defaults to./tmp.
Usage
TIND Credentials / Optional ENV config
You will need to either pass your TIND API credentials as arguments when instantiating a TINDClient or set them as environment variables with the following names:
TIND_API_KEYTIND_API_URL
instantiate a client
from tind_client import TINDClient
client = TINDClient(
api_key="your-token",
api_url="https://tind.example.edu",
default_storage_dir="/tmp",
)
Fetch pyMARC metadata for a record
record = client.fetch_metadata("116262")
print(record["245"]["a"]) # title
Fetch file metadata for a record
metadata = client.fetch_file_metadata("116262")
print(metadata[0]) # first file metadata dict
print(metadata[0]["url"]) # file download URL
Download a file
# use metadata from previous example
path_to_download = client.fetch_file(metadata[0]["url"])
Search for records
# return a list of record IDs matching a query
ids = client.fetch_ids_search("collection:'Disabled Students Program Photos'")
# return PyMARC records matching a query
records = client.fetch_search_metadata("collection:'Disabled Students Program Photos'")
# return raw XML or PyMARC records from a paginated search
# NOTE: for large result sets, use the write_search_results_to_file() method and then parse that file
xml_results = client.search("collection:'Disabled Students Program Photos'", result_format="xml")
pymarc_results = client.search("collection:'Disabled Students Program Photos'", result_format="pymarc")
# search Tind with a query and write results to an XML file in the default storage directory
records_written = client.write_search_results_to_file("Old Emperor Norton", "full_norton_results.xml")
# write search results to a specific directory
records_written = client.write_search_results_to_file(
"Old Emperor Norton",
"full_norton_results.xml",
output_dir="/path/to/some/directory"
)
Running tests
pytest
License
MIT — © 2026 The Regents of the University of California
Release files for python-tind-client 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_tind_client-0.2.5.tar.gz | 16.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_tind_client-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.4 kB
Release files / python_tind_client-0.2.5.tar.gz
| Download URL | python_tind_client-0.2.5.tar.gz |
|---|---|
| Size | 16.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d68d5fc2c914529739ec113977312863cc61ead131ff6529349e795cdadbdaf
|
|
BLAKE2b-256 checksum How to use checksums |
fa8dd477b6b9d325544c053a451f8602db35c6c0faa76ae1d50ed7d5cda3395a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 27, 2026.
Transparency logRelease files / python_tind_client-0.2.5-py3-none-any.whl
| Download URL | python_tind_client-0.2.5-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d9a125d36eff3f3b9e5a1c533ec5daa8522661efe3c1919bface304b735cb4a3
|
|
BLAKE2b-256 checksum How to use checksums |
f542fcf9cdd578c7b7f1d3068efdb3641a2a3d6d10a3abd90f0aa060b07460f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 May 27, 2026.
Transparency log