|
| 1 | +# python-tind-client |
| 2 | + |
| 3 | +Python library for interacting with the [TIND ILS](https://tind.io) API. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +- Python 3.13+ |
| 8 | + |
| 9 | +## Installation |
| 10 | + |
| 11 | +```bash |
| 12 | +pip install python-tind-client |
| 13 | +``` |
| 14 | + |
| 15 | +Install with optional development dependencies: |
| 16 | + |
| 17 | +```bash |
| 18 | +pip install "python-tind-client[dev]" # test + lint + debug |
| 19 | +pip install "python-tind-client[test]" # pytest + requests-mock |
| 20 | +pip install "python-tind-client[lint]" # mypy + pydoclint + pylint |
| 21 | +pip install "python-tind-client[debug]" # debugpy |
| 22 | +``` |
| 23 | + |
| 24 | +## Configuration |
| 25 | + |
| 26 | +Create a `TINDClient` with explicit configuration values: |
| 27 | + |
| 28 | +- `api_key` (required): Your TIND API token |
| 29 | +- `api_url` (required): Base URL of the TIND instance (e.g. `https://tind.example.edu`) |
| 30 | +- `default_storage_dir` (optional): Default output directory for downloaded files |
| 31 | + |
| 32 | +## Usage |
| 33 | + |
| 34 | +```python |
| 35 | +from tind_client import TINDClient |
| 36 | + |
| 37 | +client = TINDClient( |
| 38 | + api_key="your-token", |
| 39 | + api_url="https://tind.example.edu", |
| 40 | + default_storage_dir="/tmp", |
| 41 | +) |
| 42 | + |
| 43 | +# Fetch MARC metadata for a record |
| 44 | +record = client.fetch_metadata("12345") |
| 45 | +print(record["245"]["a"]) # title |
| 46 | + |
| 47 | +# Download a file |
| 48 | +path = client.fetch_file("https://tind.example.edu/files/12345/download") |
| 49 | + |
| 50 | +# Search and retrieve PyMARC records |
| 51 | +records = client.search("title:python programming", result_format="pymarc") |
| 52 | +``` |
| 53 | + |
| 54 | +## Functional fetch API |
| 55 | + |
| 56 | +The functions in `tind_client.fetch` are available for direct use and now accept |
| 57 | +explicit credentials instead of a client object. |
| 58 | + |
| 59 | +```python |
| 60 | +from tind_client.fetch import fetch_metadata |
| 61 | + |
| 62 | +record = fetch_metadata( |
| 63 | + "12345", |
| 64 | + api_key="your-token", |
| 65 | + api_url="https://tind.example.edu", |
| 66 | +) |
| 67 | +``` |
| 68 | + |
| 69 | +For most use cases, prefer `TINDClient` methods as the primary interface. |
| 70 | + |
| 71 | +## Running tests |
| 72 | + |
| 73 | +```bash |
| 74 | +pytest |
| 75 | +``` |
| 76 | + |
| 77 | +## License |
| 78 | + |
| 79 | +MIT — © 2026 The Regents of the University of California |
0 commit comments