FCS SRU Server
==============
<!-- START: BADGES -->
[![](https://img.shields.io/badge/%20code%20style-black-000000)](https://github.com/psf/black)
[![](https://img.shields.io/badge/%20imports-isort-%231674b1)](https://pycqa.github.io/isort/)
[![](https://img.shields.io/badge/linting-flake8-yellowgreen)](https://github.com/PyCQA/flake8)
[![](https://img.shields.io/badge/%20doc%20style-sphinx-0a507a.svg)](https://www.sphinx-doc.org/en/master/usage/index.html)
[![](https://img.shields.io/badge/%20doc%20style-google-3666d6.svg)](https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings)
[![fcs-sru-server @ PyPI](https://img.shields.io/pypi/v/fcs-sru-server)](https://pypi.python.org/pypi/fcs-sru-server)
[![](https://img.shields.io/github/last-commit/Querela/fcs-sru-server-python)](https://github.com/Querela/fcs-sru-server-python/commits/main)
[![Documentation Status](https://readthedocs.org/projects/fcs-sru-server-python/badge/?version=latest)](https://fcs-sru-server-python.readthedocs.io/en/latest/?badge=latest)
<!-- END: BADGES -->
- Based on [Java](https://github.com/clarin-eric/fcs-sru-server/) 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`](https://werkzeug.palletsprojects.com)
- TODO: refactoring to allow async variants for streaming responses (large resources),
e.g. with [`starlette`](https://www.starlette.io/)
## 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/`](src/clarin/sru/xml/)
directory.
## Installation
```bash
# 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`:
```ini
[options]
install_requires =
fcs-sru-server @ git+https://github.com/Querela/fcs-sru-server-python.git
```
## Build source/binary distribution
```bash
python3 -m pip install build
python3 -m build
```
## Development
* Uses `pytest` (with coverage, clarity and randomly plugins).
```bash
python3 -m pip install -e .[test]
pytest
```
Run style checks:
```bash
# 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
```bash
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
- [clarin-eric/fcs-sru-server](https://github.com/clarin-eric/fcs-sru-server/)
- [clarin-eric/fcs-sru-client](https://github.com/clarin-eric/fcs-sru-client/)
Raw data
{
"_id": null,
"home_page": "https://github.com/Querela/fcs-sru-server-python/",
"name": "fcs-sru-server",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "SRU,FCS,CLARIN",
"author": "Erik K\u00f6rner",
"author_email": "\"Erik K\u00f6rner\" <koerner@saw-leipzig.de>",
"download_url": "https://files.pythonhosted.org/packages/2a/c5/ceac9404b3965143dd35d12e03b589dc1bd43dc93d3594d0b5bb377a7dbe/fcs-sru-server-1.1.3.tar.gz",
"platform": null,
"description": "FCS SRU Server\n==============\n\n<!-- START: BADGES -->\n[![](https://img.shields.io/badge/%20code%20style-black-000000)](https://github.com/psf/black)\n[![](https://img.shields.io/badge/%20imports-isort-%231674b1)](https://pycqa.github.io/isort/)\n[![](https://img.shields.io/badge/linting-flake8-yellowgreen)](https://github.com/PyCQA/flake8) \n[![](https://img.shields.io/badge/%20doc%20style-sphinx-0a507a.svg)](https://www.sphinx-doc.org/en/master/usage/index.html)\n[![](https://img.shields.io/badge/%20doc%20style-google-3666d6.svg)](https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings) \n[![fcs-sru-server @ PyPI](https://img.shields.io/pypi/v/fcs-sru-server)](https://pypi.python.org/pypi/fcs-sru-server)\n[![](https://img.shields.io/github/last-commit/Querela/fcs-sru-server-python)](https://github.com/Querela/fcs-sru-server-python/commits/main)\n[![Documentation Status](https://readthedocs.org/projects/fcs-sru-server-python/badge/?version=latest)](https://fcs-sru-server-python.readthedocs.io/en/latest/?badge=latest)\n<!-- END: BADGES -->\n\n- Based on [Java](https://github.com/clarin-eric/fcs-sru-server/) implementation \n _git commit: `0091fca0a4add134c478beed422dd1399a5364e3`_\n- Differences:\n - a bit more pythonic (naming, interfaces, enums etc.)\n - no auth stuff yet\n - WIP output buffering, server framework might not allow this,\n so no streaming and everything is in memory until sent\n - server framework choice (wsgi, asgi), for now [`werkzeug`](https://werkzeug.palletsprojects.com)\n - TODO: refactoring to allow async variants for streaming responses (large resources),\n e.g. with [`starlette`](https://www.starlette.io/)\n\n## Summary\n\nThis package implements the server-side part of the SRU/CQL protocol (SRU/S)\nand conforms to SRU version 1.1 and 1.2. SRU version 2.0 is mostly implemented\nbut might be missing some more obscure features.\nThe library will handle most of the protocol related tasks for you and you'll\nonly need to implement a few classes to connect you search engine. However, the\nlibrary will not save you from doing your SRU/CQL homework (i.e. you'll need to\nhave at least some understanding of the protocol and adhere to the protocol\nsemantics). Furthermore, you need to have at least some basic understanding of\nPython web application development (wsgi in particular) to use this library.\n\nMore Information about SRU/CQL:\n http://www.loc.gov/standards/sru/\n\nThe implementation is designed to make very minimal assumptions about the\nenvironment it's deployed in. For interfacing with your search engine, you\nneed to implement the `SRUSearchEngine` interface. At minimum, you'll need\nto implement at least the `search()` method. Please check the Python API\ndocumentation for further details about this interface.\nThe `SRUServer` implements the SRU protocol and uses your supplied search engine\nimplementation to talk to your search engine. The SRUServer is configured\nusing a `SRUServerConfig` instance. The `SRUServerConfig` reads an XML document,\nwhich contains the (static) server configuration. It must conform to the\n`sru-server-config.xsd` schema in the [`src/clarin/sru/xml/`](src/clarin/sru/xml/)\ndirectory.\n\n\n## Installation\n\n```bash\n# from github/source\npython3 -m pip install 'fcs-sru-server @ git+https://github.com/Querela/fcs-sru-server-python.git'\n\n# (locally) built package\npython3 -m pip install dist/fcs_sru_server-<version>-py2.py3-none-any.whl\n# or\npython3 -m pip install dist/fcs-sru-server-<version>.tar.gz\n\n# for local development\npython3 -m pip install -e .\n```\n\nIn `setup.cfg`:\n```ini\n[options]\ninstall_requires =\n fcs-sru-server @ git+https://github.com/Querela/fcs-sru-server-python.git\n```\n\n\n## Build source/binary distribution\n\n```bash\npython3 -m pip install build\npython3 -m build\n```\n\n\n## Development\n\n* Uses `pytest` (with coverage, clarity and randomly plugins).\n\n```bash\npython3 -m pip install -e .[test]\n\npytest\n```\n\nRun style checks:\n```bash\n# general style checks\npython3 -m pip install -e .[style]\n\nblack --check .\nflake8 . --show-source --statistics\nisort --check --diff .\nmypy .\n\n# building the package and check metadata\npython3 -m pip install -e .[build]\n\npython3 -m build\ntwine check --strict dist/*\n\n# build documentation and check links ...\npython3 -m pip install -e .[docs]\n\nsphinx-build -b html docs dist/docs\nsphinx-build -b linkcheck docs dist/docs\n```\n\n\n## Build documentation\n\n```bash\npython3 -m pip install -r ./docs/requirements.txt\n# or \npython3 -m pip install -e .[docs]\n\nsphinx-build -b html docs dist/docs\nsphinx-build -b linkcheck docs dist/docs\n```\n\n\n## See also\n\n- [clarin-eric/fcs-sru-server](https://github.com/clarin-eric/fcs-sru-server/)\n- [clarin-eric/fcs-sru-client](https://github.com/clarin-eric/fcs-sru-client/)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "\"FCS SRU Server\"",
"version": "1.1.3",
"project_urls": {
"Documentation": "https://fcs-sru-server-python.readthedocs.io/",
"Homepage": "https://github.com/Querela/fcs-sru-server-python/",
"Issue Tracker": "https://github.com/Querela/fcs-sru-server-python/issues",
"Source": "https://github.com/Querela/fcs-sru-server-python/"
},
"split_keywords": [
"sru",
"fcs",
"clarin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6150117654afe59401bd087da13baac2f36c5edfa6c27f0686f6a48ae5a5f0c9",
"md5": "2640380c59c3a5772452601589b2a7d3",
"sha256": "8a6d0056448d0b0f01a768c08b294fcef70cfb3b7893a7e806ff324087a9aea1"
},
"downloads": -1,
"filename": "fcs_sru_server-1.1.3-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "2640380c59c3a5772452601589b2a7d3",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.8",
"size": 48980,
"upload_time": "2023-11-01T14:29:35",
"upload_time_iso_8601": "2023-11-01T14:29:35.950227Z",
"url": "https://files.pythonhosted.org/packages/61/50/117654afe59401bd087da13baac2f36c5edfa6c27f0686f6a48ae5a5f0c9/fcs_sru_server-1.1.3-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2ac5ceac9404b3965143dd35d12e03b589dc1bd43dc93d3594d0b5bb377a7dbe",
"md5": "d174cc229295661ab06fd7752594a686",
"sha256": "d5cdcc0a28cfbbd9c7a42ad4439d5eec71fb7591a1664bcde6364463646a7062"
},
"downloads": -1,
"filename": "fcs-sru-server-1.1.3.tar.gz",
"has_sig": false,
"md5_digest": "d174cc229295661ab06fd7752594a686",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 51719,
"upload_time": "2023-11-01T14:29:37",
"upload_time_iso_8601": "2023-11-01T14:29:37.957711Z",
"url": "https://files.pythonhosted.org/packages/2a/c5/ceac9404b3965143dd35d12e03b589dc1bd43dc93d3594d0b5bb377a7dbe/fcs-sru-server-1.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-01 14:29:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Querela",
"github_project": "fcs-sru-server-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "fcs-sru-server"
}