sysnet-sekm-model
Pydantic 2 domain models and Beanie/MongoDB persistence layer for SEKM — the Czech System of Evidence of Contaminated Sites (Systém Evidence Kontaminovaných Míst).
This library is the shared data layer for any service that reads or writes SEKM data
from MongoDB. It has no dependency on Elasticsearch; migration tooling lives in the
companion package sysnet-sekm-migrate.
Installation
pip install sysnet-sekm-model
Requirements
- Python ≥ 3.12
- MongoDB instance (no Elasticsearch required)
.envfile withMONGO_HOST,MONGO_PORT,MONGO_USERNAME,MONGO_PASSWORD,MONGO_DB
Quick start
from sysnet_sekm_model.config import MongoSettings
from sysnet_sekm_model.db import init_mongo, close_mongo
from sysnet_sekm_model.models.persistence import AreaSourceDoc
# Initialise Beanie (reads credentials from .env / environment variables)
settings = MongoSettings()
client = await init_mongo(settings.mongo_uri, settings.mongo_db)
# Query
doc = await AreaSourceDoc.find_one(AreaSourceDoc.sekm_id == "12345678")
# Shutdown
await close_mongo(client)
What's inside
Domain models (sysnet_sekm_model.models.domain)
Pydantic 2 models for all 21 SEKM entities — validation and business logic only, no MongoDB awareness:
| Model | Entity |
|---|---|
AreaSource |
Contaminated site (lokalita) — the central SEKM entity |
AsObject, AsRegion, AsDocument |
Site sub-entities |
Observation |
Field observation record |
Sample, SampleAdvanced |
Environmental measurement (up to 28 M records) |
User, Organisation |
Auth and organisation |
Template |
Document template |
Dictionary, Substance |
Reference data |
HistoryEvent, LockDocument, Approval |
Audit trail |
Region, District, Municipality, … |
Geographic reference data |
Persistence models (sysnet_sekm_model.models.persistence)
Beanie documents backed by sysnet-docversion's VersionedDocument for entities
that carry audit history. Each document stores:
sekm_id— SEKM business key (unique index)current_version— version counter managed bysysnet-docversionmigration_meta— provenance metadata (source ES index, migrated_at, batch ID)
MongoDB connection (sysnet_sekm_model.db)
from sysnet_sekm_model.db import init_mongo, close_mongo, ALL_DOCUMENT_MODELS
init_mongo(uri, db) initialises Beanie with all document models and creates indexes.
Uses pymongo.AsyncMongoClient directly — Motor is not used.
Settings (sysnet_sekm_model.config)
from sysnet_sekm_model.config import MongoSettings
MongoSettings is a Pydantic BaseSettings subclass that reads MONGO_* variables
from the environment or .env.
Documentation
| Document | Contents |
|---|---|
| Data Model | Full domain and persistence model reference |
| Trial Migration Report | Migration results and entity volumes |
| Data Quality Report | Post-migration data quality findings |
License
Metadata
Release files for sysnet-sekm-model 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sysnet_sekm_model-0.2.0.tar.gz | 28.4 kB | Without provenance | Details for sysnet_sekm_model-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sysnet_sekm_model-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for sysnet_sekm_model-0.2.0-py3-none-any.whl |
Total release size: 44.5 kB
Release files / sysnet_sekm_model-0.2.0.tar.gz
| Download URL | sysnet_sekm_model-0.2.0.tar.gz |
|---|---|
| Size | 28.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0af0999988a63f2931f4eb23f93167371328ceab5ff7f70b6328bcba5cc773f8
|
|
BLAKE2b-256 checksum How to use checksums |
ea83ded8ec527fa3e9559413630fc3ea0c73f1fcb0c86fafb3f23feb1a4326dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / sysnet_sekm_model-0.2.0-py3-none-any.whl
| Download URL | sysnet_sekm_model-0.2.0-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a988aaa8803318c5396bf1a3d242ae2b25614afce61beab9d8caf546924608f5
|
|
BLAKE2b-256 checksum How to use checksums |
d1700617e680d0ac2ad523b39dd8751a59d20762ade7f68b9663416270d8dfde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for sysnet-sekm-model 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.