enables Pythonic access to data exports from TYPO3-find
Project description
txpyfind enables access to data exports from TYPO3-find in Python. Details on the TYPO3-find setup required for data exports can be found in the section Data export in the README file of that repository.
The three JSON formats json-all, json-solr-results and raw-solr-response are already available in the TYPO3 extension, see the partials used to create the three formats.
You can use the client class available in this Python package to query these exports. A simple parser for the returned JSON objects is also available.
Installation
… via PyPI
pip install txpyfind
… or from GitHub source
pip install git+https://github.com/slub/txpyfind.git
Command-Line Usage
After installation, the txpyfind command is available (also via python -m txpyfind).
Query
Execute a search query:
txpyfind --url https://katalog.slub-dresden.de query "manfred bonitz"
With facet filters and pagination:
txpyfind --url https://katalog.slub-dresden.de query "python" --facet facet_format=Book --page 1 --count 10
Document
Fetch a single document by ID:
txpyfind --url https://katalog.slub-dresden.de --document-path id document 0-1132486122
Scroll
Fetch all results for a query:
txpyfind --url https://katalog.slub-dresden.de scroll "manfred bonitz" --batch 10
Stream results as JSONL (one JSON object per line), useful for piping:
txpyfind --url https://katalog.slub-dresden.de scroll "manfred bonitz" --stream | jq .id
Environment Variable
Set TXPYFIND_URL to avoid repeating the --url option:
export TXPYFIND_URL=https://katalog.slub-dresden.de
txpyfind query "manfred bonitz"
txpyfind --document-path id document 0-1132486122
Python Usage Example
from txpyfind.client import Find
# create Find instance
slub_find = Find("https://katalog.slub-dresden.de", document_path="id", export_format="json-ld")
# retrieve JSON-LD data (detail view)
slub_ld_doc = slub_find.get_document("0-1132486122")
# retrieve JSON-LD data (query view)
slub_ld_q_default = slub_find.get_query("manfred bonitz")
# ...
See slubfind for a full setup example.
License
This project is licensed under the GNU General Public License v3 (GPLv3). See the LICENSE file for the full license text.
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 txpyfind-1.0.0.tar.gz.
File metadata
- Download URL: txpyfind-1.0.0.tar.gz
- Upload date:
- Size: 25.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a75b973ffab9829c185aaba1b3135995ee97914ebb3a7d439064cab7782d090d
|
|
| MD5 |
d481e1f3fb9d98621297cf905c21251f
|
|
| BLAKE2b-256 |
62f8c9ccf1b4ffbad5371c03c8d7968c510e73370bfc725d9a5d9bfca708d940
|
File details
Details for the file txpyfind-1.0.0-py3-none-any.whl.
File metadata
- Download URL: txpyfind-1.0.0-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53771d2db1cb208bffeaca044e03f4926b499a5583cc90455ea6980f1e750119
|
|
| MD5 |
55c96cc4e8ce7f7dee3009ee0df36b2f
|
|
| BLAKE2b-256 |
c5ff58ed164897dc9e0ff440793ab9cabb24a71ada6fbda7784ba5dd6d90c25a
|