"FCS SRU Server"
Project description
FCS SRU Server
- Based on Java implementation
git commit:0091fca0a4add134c478beed422dd1399a5364e3
- Differences:
- a bit more pythonic (naming, interfaces, enums etc.)
- no auth stuff yet
- WIP output buffering, server framework might not allow this, so no streaming and everything is in memory until sent
- server framework choice (wsgi, asgi), for now
werkzeug
- TODO: refactoring to allow async variants for streaming responses (large resources),
e.g. with
starlette
Summary
This package implements the server-side part of the SRU/CQL protocol (SRU/S) and conforms to SRU version 1.1 and 1.2. SRU version 2.0 is mostly implemented but might be missing some more obscure features. The library will handle most of the protocol related tasks for you and you'll only need to implement a few classes to connect you search engine. However, the library will not save you from doing your SRU/CQL homework (i.e. you'll need to have at least some understanding of the protocol and adhere to the protocol semantics). Furthermore, you need to have at least some basic understanding of Python web application development (wsgi in particular) to use this library.
More Information about SRU/CQL: http://www.loc.gov/standards/sru/
The implementation is designed to make very minimal assumptions about the
environment it's deployed in. For interfacing with your search engine, you
need to implement the SRUSearchEngine
interface. At minimum, you'll need
to implement at least the search()
method. Please check the Python API
documentation for further details about this interface.
The SRUServer
implements the SRU protocol and uses your supplied search engine
implementation to talk to your search engine. The SRUServer is configured
using a SRUServerConfig
instance. The SRUServerConfig
reads an XML document,
which contains the (static) server configuration. It must conform to the
sru-server-config.xsd
schema in the src/clarin/sru/xml/
directory.
Installation
# from github/source
python3 -m pip install 'fcs-sru-server @ git+https://github.com/Querela/fcs-sru-server-python.git'
# (locally) built package
python3 -m pip install dist/fcs_sru_server-<version>-py2.py3-none-any.whl
# or
python3 -m pip install dist/fcs-sru-server-<version>.tar.gz
# for local development
python3 -m pip install -e .
In setup.cfg
:
[options]
install_requires =
fcs-sru-server @ git+https://github.com/Querela/fcs-sru-server-python.git
Build source/binary distribution
python3 -m pip install build
python3 -m build
Development
- Uses
pytest
(with coverage, clarity and randomly plugins).
python3 -m pip install -e .[test]
pytest
Run style checks:
# general style checks
python3 -m pip install -e .[style]
black --check .
flake8 . --show-source --statistics
isort --check --diff .
mypy .
# building the package and check metadata
python3 -m pip install -e .[build]
python3 -m build
twine check --strict dist/*
# build documentation and check links ...
python3 -m pip install -e .[docs]
sphinx-build -b html docs dist/docs
sphinx-build -b linkcheck docs dist/docs
Build documentation
python3 -m pip install -r ./docs/requirements.txt
# or
python3 -m pip install -e .[docs]
sphinx-build -b html docs dist/docs
sphinx-build -b linkcheck docs dist/docs
See also
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
File details
Details for the file fcs-sru-server-1.1.3.tar.gz
.
File metadata
- Download URL: fcs-sru-server-1.1.3.tar.gz
- Upload date:
- Size: 51.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5cdcc0a28cfbbd9c7a42ad4439d5eec71fb7591a1664bcde6364463646a7062 |
|
MD5 | d174cc229295661ab06fd7752594a686 |
|
BLAKE2b-256 | 2ac5ceac9404b3965143dd35d12e03b589dc1bd43dc93d3594d0b5bb377a7dbe |
File details
Details for the file fcs_sru_server-1.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: fcs_sru_server-1.1.3-py2.py3-none-any.whl
- Upload date:
- Size: 49.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a6d0056448d0b0f01a768c08b294fcef70cfb3b7893a7e806ff324087a9aea1 |
|
MD5 | 2640380c59c3a5772452601589b2a7d3 |
|
BLAKE2b-256 | 6150117654afe59401bd087da13baac2f36c5edfa6c27f0686f6a48ae5a5f0c9 |