Metadata-Version: 2.4
Name: gov-service
Version: 0.0.4
Summary: gov-service: A local GOV (Geschichtliches Ortsverzeichnis) server service
Project-URL: Home, https://github.com/WolfgangFahl/gov-service
Project-URL: Documentation, https://wiki.genealogy.net/GOV-Service
Project-URL: Source, https://github.com/WolfgangFahl/gov-service
Author-email: Wolfgang Fahl <wf@WolfgangFahl.com>
Maintainer-email: Wolfgang Fahl <wf@WolfgangFahl.com>
License: Apache-2.0
License-File: LICENSE
Keywords: GOV,SPARQL,genealogy,history,places
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: fastapi>=0.110.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pybasemkit>=0.1.3
Requires-Dist: pylodstorage>=0.19.2
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: uvicorn>=0.29.0
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: isort>=5.12.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: green; extra == 'test'
Requires-Dist: pytest>=7.0.0; extra == 'test'
Description-Content-Type: text/markdown

# gov-service
| | |
| :--- | :--- |
| **PyPi** | [![PyPI Status](https://img.shields.io/pypi/v/gov-service.svg)](https://pypi.python.org/pypi/gov-service/) [![License](https://img.shields.io/github/license/WolfgangFahl/gov-service.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![pypi](https://img.shields.io/pypi/pyversions/gov-service)](https://pypi.org/project/gov-service/) [![format](https://img.shields.io/pypi/format/gov-service)](https://pypi.org/project/gov-service/) [![downloads](https://img.shields.io/pypi/dd/gov-service)](https://pypi.org/project/gov-service/) |
| **GitHub** | [![Github Actions Build](https://github.com/WolfgangFahl/gov-service/actions/workflows/build.yml/badge.svg)](https://github.com/WolfgangFahl/gov-service/actions/workflows/build.yml) [![Release](https://img.shields.io/github/v/release/WolfgangFahl/gov-service)](https://github.com/WolfgangFahl/gov-service/releases) [![Contributors](https://img.shields.io/github/contributors/WolfgangFahl/gov-service)](https://github.com/WolfgangFahl/gov-service/graphs/contributors) [![Last Commit](https://img.shields.io/github/last-commit/WolfgangFahl/gov-service)](https://github.com/WolfgangFahl/gov-service/commits/) [![GitHub issues](https://img.shields.io/github/issues/WolfgangFahl/gov-service.svg)](https://github.com/WolfgangFahl/gov-service/issues) [![GitHub closed issues](https://img.shields.io/github/issues-closed/WolfgangFahl/gov-service.svg)](https://github.com/WolfgangFahl/gov-service/issues/?q=is%3Aissue+is%3Aclosed) |
| **Code** | [![style-black](https://img.shields.io/badge/%20style-black-000000.svg)](https://github.com/psf/black) [![imports-isort](https://img.shields.io/badge/%20imports-isort-%231674b1)](https://pycqa.github.io/isort/) |
| **Docs** | [![API Docs](https://img.shields.io/badge/API-Documentation-blue)](https://WolfgangFahl.github.io/gov-service/) [![formatter-docformatter](https://img.shields.io/badge/%20formatter-docformatter-fedcba.svg)](https://github.com/PyCQA/docformatter) [![style-google](https://img.shields.io/badge/%20style-google-3666d6.svg)](https://google.github.io/styleguide/pyguide.html#s3.8-comments-and-docstrings) |

A local GOV (Geschichtliches Ortsverzeichnis) server service, usable as an alternative GOV server via the GOV-Tag `base_url` option.

## Command Line Testing

You can test queries directly from the command line using the `scripts/gov_query` tool:

```bash
# List available queries
scripts/gov_query -li

# Test the NameByGovId query with Schönberg's GOV-Kennung
scripts/gov_query -qn NameByGovId --params gov_id=SCHERGJO54EJ -f json
```

## API Testing

When the service is running (e.g. via `scripts/startup --gov`), you can test the REST API endpoint directly using curl:

```bash
# HTML (default)
curl -s http://localhost:8000/item/wikihtml/SCHERGJO54EJ

# JSON via Accept header
curl -s -H "Accept: application/json" http://localhost:8000/item/show/SCHERGJO54EJ

# YAML via Accept header
curl -s -H "Accept: application/x-yaml" http://localhost:8000/item/show/SCHERGJO54EJ

# JSON via format query parameter (overrides Accept header)
curl -s "http://localhost:8000/item/show/SCHERGJO54EJ?format=json"
```

## API Documentation

The service is built with [FastAPI](https://fastapi.tiangolo.com/), which automatically provides interactive API documentation when the server is running:

- **Swagger UI**: http://localhost:8000/docs
- **ReDoc**: http://localhost:8000/redoc

## Docs
[GOV-Service on GOV-Wiki](https://gov-wiki.genealogy.net/index.php/GOV-Service)
