A Python client library for interacting with Aleph library systems through multiple service interfaces: OAI-PMH, X-Server, and Z39.50.
This package provides specialized clients for each protocol, as well as a unified AlephClient class that bundles these clients for convenient access.
Aleph is a widely used library management system offering several APIs to access bibliographic and catalog data:
-
OAI-PMH (Open Archives Initiative Protocol for Metadata Harvesting) Harvest and retrieve MARC records via the standardized OAI protocol.
-
X-Server API A proprietary Aleph API supporting searches, record retrieval, and paginated results.
-
Z39.50 A standard library information retrieval protocol commonly used for searching and retrieving bibliographic records.
Client to interact with Aleph's OAI-PMH interface.
- Supports harvesting records from multiple configured OAI sets.
- Fetch individual MARC records by document number.
- Check OAI service availability.
More info on OAI-PMH protocol: https://www.openarchives.org/OAI/openarchivesprotocol.html#ProtocolSyntax
Client to interact with the Aleph X-Server API.
- Perform searches by field and value.
- Fetch paginated results from the server.
- Retrieve a single system number for unique queries.
For detailed X-Server operations, see: https://developers.exlibrisgroup.com/aleph/apis/aleph-x-services/
Client for Aleph's Z39.50 interface using the YAZ C++ library bindings.
- Search for MARC21 records using PQF query syntax.
- Manages native connections to the Z39.50 service.
- Requires the YAZ library to be installed.
YAZ toolkit: https://www.indexdata.com/yaz/
A unified client that wraps all three service clients (OAI, X, Z39.50).
- Provides convenient properties to access the configured services.
- Raises errors if a requested service is not configured.
- Designed for flexible use with multiple Aleph configurations.
You can install the package directly from GitHub for a specific version tag:
pip install git+https://github.com/moravianlibrary/aleph-nought.git@v1.2.3Replace v1.2.3 with the desired version tag
To always install the most recent version, use the latest tag:
pip install git+https://github.com/moravianlibrary/aleph-nought.git@latestNote: The
AlephZ3950Clientdepends on the YAZ library to be installed on the host machine.
- On Debian/Ubuntu:
sudo apt update
sudo apt install yaz- On Fedora:
sudo dnf install yaz- On macOS (using Homebrew):
brew install yazTo use the YAZ command-line client, run the yaz-client command.
Install required dependencies using pip:
pip install -r requirements.txtNote: As mentioned above, the
AlephZ3950Clientdepends on the system-level YAZ library.
- 0.1.x
Initial release series supporting:
- AlephOAIClient for OAI-PMH services
- AlephXClient for Aleph X-Server API
- AlephZ3950Client using YAZ toolkit bindings
- AlephClient as a unified client wrapper
- 0.1.0
First stable release with core functionality for all clients.
- latest Always points to the most up-to-date stable version of the client.
from aleph_nought import AlephClient, AlephConfig
config = AlephConfig(
base="mybase",
oai=oai_config, # Optional AlephOAIConfig instance
x=x_config, # Optional AlephXConfig instance
z3950=z3950_config # Optional AlephZ3950Config instance
)
client = AlephClient(config)
# Access OAI client
records = list(client.OAI.list_records(from_date="2023-01-01T00:00:00Z", to_date="2023-06-30T23:59:59Z"))
# Use X-Server client to search system numbers
system_numbers = list(client.X.find_system_numbers("TITLE", "Python"))
# Search Z39.50
marc_records = client.Z3950.search("@attr 1=4 'Python Programming'")