Skip to content

Python library for interacting with the TIND API

License

Notifications You must be signed in to change notification settings

BerkeleyLibrary/python-tind-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-tind-client

Python library for interacting with the TIND ILS API.

Requirements

  • Python 3.13+

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 explicit configuration values:

  • api_key (required): Your TIND API token
  • api_url (required): Base URL of the TIND instance (e.g. https://tind.example.edu)
  • default_storage_dir (optional): Default output directory for downloaded files

Usage

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("12345")
print(record["245"]["a"])  # title

Fetch file metadata for a record

metadata = client.fetch_file_metadata("12345")
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)

Functional fetch API

The functions in tind_client.fetch are available for direct use and now accept explicit credentials instead of a client object.

from tind_client.fetch import fetch_metadata

record = fetch_metadata(
	"12345",
	api_key="your-token",
	api_url="https://tind.example.edu",
)

For most use cases, prefer TINDClient methods as the primary interface.

Running tests

pytest

License

MIT — © 2026 The Regents of the University of California

About

Python library for interacting with the TIND API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages