# FCS-QL for Python
<!-- START: BADGES -->
[](https://github.com/psf/black)
[](https://pycqa.github.io/isort/)
[](https://github.com/PyCQA/flake8)
[](https://github.com/PyCQA/docformatter)
[](https://www.sphinx-doc.org/en/master/usage/index.html)
[](https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings)
[](https://pypi.python.org/pypi/fcs-ql-parser)
[](https://github.com/Querela/fcs-ql-python/actions/workflows/python-package.yml)
[](https://github.com/Querela/fcs-ql-python/commits/main)
[](https://fcs-ql-python.readthedocs.io/en/latest/?badge=latest)
<!-- END: BADGES -->
- CLARIN-FCS Core 2.0 query language grammar and parser
- based on [Github: clarin-eric/fcs-ql](https://github.com/clarin-eric/fcs-ql)
and [Github: clarin-eric/fcs-simple-endpoint](https://github.com/clarin-eric/fcs-simple-endpoint)
- for more details visit: [CLARIN FCS Technical Details](https://www.clarin.eu/content/federated-content-search-clarin-fcs-technical-details)
## Installation
```bash
# built package
python3 -m pip install dist/fcs_ql_parser-<version>-py2.py3-none-any.whl
# or
python3 -m pip install dist/fcs-ql-parser-<version>.tar.gz
# for local development
python3 -m pip install -e .
```
## Building
Fetch (or update) grammar files:
```bash
git clone https://github.com/clarin-eric/fcs-ql.git
cp fcs-ql/src/main/antlr4/eu/clarin/sru/fcs/qlparser/*.g4 src/fcsql/
```
(Re-)Generate python parser code:
```bash
# create virtual env
python3 -m venv venv
source venv/bin/activate
pip install -U pip setuptools wheel
# install antler tool
python3 -m pip install antlr4-tools
# pip install -e .[antlr]
cd src/fcsql
antlr4 -Dlanguage=Python3 *.g4
```
Build package:
```bash
# pip install -e .[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 src
# 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/fcq-ql](https://github.com/clarin-eric/fcs-ql)
- [clarin-eric/fcs-simple-endpoint](https://github.com/clarin-eric/fcs-simple-endpoint)
- [Specification on CLARIN FCS 2.0](https://www.clarin.eu/content/federated-content-search-clarin-fcs-technical-details)
Raw data
{
"_id": null,
"home_page": "https://github.com/Querela/fcs-ql-python/",
"name": "fcs-ql-parser",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "FCS,FCS-QL,CLARIN,Query Parser",
"author": "Erik K\u00f6rner",
"author_email": "\"Erik K\u00f6rner\" <koerner@saw-leipzig.de>",
"download_url": "https://files.pythonhosted.org/packages/0a/dd/ab3973b8534f7761ef764b3867a7d910a2a8d391b20b16e89eb7446d6012/fcs-ql-parser-1.0.1.tar.gz",
"platform": null,
"description": "# FCS-QL for Python\n\n<!-- START: BADGES -->\n[](https://github.com/psf/black)\n[](https://pycqa.github.io/isort/)\n[](https://github.com/PyCQA/flake8) \n[](https://github.com/PyCQA/docformatter)\n[](https://www.sphinx-doc.org/en/master/usage/index.html)\n[](https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings) \n[](https://pypi.python.org/pypi/fcs-ql-parser)\n[](https://github.com/Querela/fcs-ql-python/actions/workflows/python-package.yml)\n[](https://github.com/Querela/fcs-ql-python/commits/main)\n[](https://fcs-ql-python.readthedocs.io/en/latest/?badge=latest)\n<!-- END: BADGES -->\n\n- CLARIN-FCS Core 2.0 query language grammar and parser\n- based on [Github: clarin-eric/fcs-ql](https://github.com/clarin-eric/fcs-ql)\n and [Github: clarin-eric/fcs-simple-endpoint](https://github.com/clarin-eric/fcs-simple-endpoint)\n- for more details visit: [CLARIN FCS Technical Details](https://www.clarin.eu/content/federated-content-search-clarin-fcs-technical-details)\n\n\n## Installation\n\n```bash\n# built package\npython3 -m pip install dist/fcs_ql_parser-<version>-py2.py3-none-any.whl\n# or\npython3 -m pip install dist/fcs-ql-parser-<version>.tar.gz\n\n# for local development\npython3 -m pip install -e .\n```\n\n\n## Building\n\nFetch (or update) grammar files:\n```bash\ngit clone https://github.com/clarin-eric/fcs-ql.git\ncp fcs-ql/src/main/antlr4/eu/clarin/sru/fcs/qlparser/*.g4 src/fcsql/\n```\n\n(Re-)Generate python parser code:\n```bash\n# create virtual env\npython3 -m venv venv\nsource venv/bin/activate\npip install -U pip setuptools wheel\n\n# install antler tool\npython3 -m pip install antlr4-tools\n# pip install -e .[antlr]\n\ncd src/fcsql\nantlr4 -Dlanguage=Python3 *.g4\n```\n\nBuild package:\n```bash\n# pip install -e .[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 src\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/fcq-ql](https://github.com/clarin-eric/fcs-ql)\n- [clarin-eric/fcs-simple-endpoint](https://github.com/clarin-eric/fcs-simple-endpoint)\n- [Specification on CLARIN FCS 2.0](https://www.clarin.eu/content/federated-content-search-clarin-fcs-technical-details)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "\"FCS-QL (CLARIN-FCS Core 2.0 Query Language) Grammar and Parser\"",
"version": "1.0.1",
"project_urls": {
"Documentation": "https://fcs-ql-python.readthedocs.io/",
"Homepage": "https://github.com/Querela/fcs-ql-python/",
"Issue Tracker": "https://github.com/Querela/fcs-ql-python/issues",
"Source": "https://github.com/Querela/fcs-ql-python/"
},
"split_keywords": [
"fcs",
"fcs-ql",
"clarin",
"query parser"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0161355aed2249473b6b3d15767deb5346ea84ec02c8e53b0f6d0f12e7c8caf7",
"md5": "bfeec104facffb236db1de2bf593bd00",
"sha256": "6c50385c6e5955f5424b21a69cdc83807fb82f5168431338aa4e2ac514423cb8"
},
"downloads": -1,
"filename": "fcs_ql_parser-1.0.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "bfeec104facffb236db1de2bf593bd00",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.8",
"size": 31218,
"upload_time": "2023-07-12T11:19:56",
"upload_time_iso_8601": "2023-07-12T11:19:56.195468Z",
"url": "https://files.pythonhosted.org/packages/01/61/355aed2249473b6b3d15767deb5346ea84ec02c8e53b0f6d0f12e7c8caf7/fcs_ql_parser-1.0.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0addab3973b8534f7761ef764b3867a7d910a2a8d391b20b16e89eb7446d6012",
"md5": "67c72e69782829652a41502668335f6c",
"sha256": "912ba655d8de915330469cd476cda8a11ae6b07800fbc893c61446817b3eab72"
},
"downloads": -1,
"filename": "fcs-ql-parser-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "67c72e69782829652a41502668335f6c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 28916,
"upload_time": "2023-07-12T11:19:57",
"upload_time_iso_8601": "2023-07-12T11:19:57.841887Z",
"url": "https://files.pythonhosted.org/packages/0a/dd/ab3973b8534f7761ef764b3867a7d910a2a8d391b20b16e89eb7446d6012/fcs-ql-parser-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-12 11:19:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Querela",
"github_project": "fcs-ql-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fcs-ql-parser"
}