dnhydb 0.3.0__cp315-cp315-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dnhydb/__init__.py ADDED
@@ -0,0 +1,69 @@
1
+ """dNHyDB (directNHyDB) – database with direct structural addressing.
2
+
3
+ Cell identity ``(R1, u, v, s)`` with ``u, v`` in ``1 … 2^64−1`` and the side
4
+ ``s`` (0 = NL, 1 = NR). ``N`` is computed arithmetically only on demand
5
+ (:func:`n_of`, :func:`address_of`).
6
+
7
+ Quick start::
8
+
9
+ import dnhydb
10
+ with dnhydb.create("data.dnhydb") as db:
11
+ db.define_base([("date", "u64"), ("text", "utf8")])
12
+ with db.transaction():
13
+ db.put_record(1, [20261015, "Hello"])
14
+ db.put_cell(1, 1_000_001, "Poem …")
15
+ reader = dnhydb.open_reader("data.dnhydb")
16
+ print(reader.get_cell(1, 1_000_001))
17
+
18
+ Access model: exactly one writer (:func:`create`, :func:`open`), any number
19
+ of readers (:func:`open_reader`) with a snapshot at the commit boundary and
20
+ ``refresh()``.
21
+ """
22
+
23
+ from ._native import ( # noqa: F401
24
+ AddressError,
25
+ CorruptionError,
26
+ Database,
27
+ DnhydbError,
28
+ ENGINE_VERSION,
29
+ FILE_FORMAT_VERSION,
30
+ LockedError,
31
+ ProfileError,
32
+ ReadOnlyError,
33
+ SchemaError,
34
+ StaleIndexError,
35
+ TYPES,
36
+ address_of,
37
+ compact_file,
38
+ create,
39
+ dyn_address,
40
+ inspect_tail,
41
+ n_of,
42
+ open,
43
+ open_reader,
44
+ repair_file,
45
+ )
46
+
47
+ __version__ = ENGINE_VERSION
48
+
49
+ NL = 0
50
+ NR = 1
51
+
52
+
53
+ def load_options(path):
54
+ """Options from a TOML file (``config/dnhydb_config.example.toml``)
55
+ as a dict for :func:`create`, :func:`open` and :func:`open_reader`
56
+ (standard library ``tomllib``)."""
57
+ import builtins
58
+ import tomllib
59
+
60
+ with builtins.open(path, "rb") as f:
61
+ return tomllib.load(f)
62
+
63
+ __all__ = [
64
+ "AddressError", "CorruptionError", "Database", "DnhydbError", "LockedError",
65
+ "ProfileError", "ReadOnlyError", "SchemaError", "StaleIndexError",
66
+ "ENGINE_VERSION", "FILE_FORMAT_VERSION", "TYPES", "NL", "NR",
67
+ "address_of", "compact_file", "create", "dyn_address", "inspect_tail", "load_options",
68
+ "n_of", "open", "open_reader", "repair_file", "__version__",
69
+ ]
dnhydb/__main__.py ADDED
@@ -0,0 +1,3 @@
1
+ from .cli import main
2
+
3
+ raise SystemExit(main())
Binary file
dnhydb/cli.py ADDED
@@ -0,0 +1,155 @@
1
+ """Command line: ``python -m dnhydb <command> <file> …``.
2
+
3
+ Read commands open the database as a reader (without lock); write commands
4
+ (``checkpoint``, ``compact``, ``repair --apply``) open it as the writer.
5
+
6
+ Exit codes: 0 = ok, 1 = problems found (``verify``/``health`` not ok,
7
+ ``tail``/``repair`` without ``--apply`` on a file that is not clean),
8
+ 2 = error (message on stderr, no traceback) or invalid usage.
9
+ """
10
+
11
+ import argparse
12
+ import json
13
+ import sys
14
+
15
+ import dnhydb
16
+
17
+
18
+ def _out(obj):
19
+ def default(x):
20
+ if isinstance(x, (bytes, bytearray)):
21
+ return {"__bytes__": bytes(x).hex()}
22
+ return str(x)
23
+
24
+ print(json.dumps(obj, ensure_ascii=False, indent=2, default=default))
25
+
26
+
27
+ def _lane(s):
28
+ return 1 if str(s).upper() in ("1", "NR", "R") else 0
29
+
30
+
31
+ def _col(s):
32
+ return int(s) if s.isdigit() else s
33
+
34
+
35
+ def _verify(a):
36
+ """verify, also for damaged files: if the database cannot be opened
37
+ because it is damaged, the physical tail inspection is reported."""
38
+ try:
39
+ db = dnhydb.open_reader(a.file)
40
+ except dnhydb.CorruptionError as e:
41
+ _out({"ok": False, "open_error": f"{type(e).__name__}: {e}", "tail": dnhydb.inspect_tail(a.file)})
42
+ return 1
43
+ r = db.verify(deep=a.deep)
44
+ _out(r)
45
+ return 0 if r["ok"] else 1
46
+
47
+
48
+ def main(argv=None):
49
+ p = argparse.ArgumentParser(prog="dnhydb", description="dNHyDB tool")
50
+ sub = p.add_subparsers(dest="cmd", required=True)
51
+ for name in ("stats", "schema", "health", "verify", "tail", "checkpoint"):
52
+ s = sub.add_parser(name)
53
+ s.add_argument("file")
54
+ if name in ("health", "verify"):
55
+ s.add_argument("--deep", action="store_true")
56
+ s = sub.add_parser("get", help="read a cell: get FILE u v")
57
+ s.add_argument("file")
58
+ s.add_argument("u", type=int)
59
+ s.add_argument("v")
60
+ s.add_argument("--lane", default="0")
61
+ s = sub.add_parser("record", help="read a record: record FILE u")
62
+ s.add_argument("file")
63
+ s.add_argument("u", type=int)
64
+ s.add_argument("--lane", default="0")
65
+ s = sub.add_parser("cells", help="cells of a u group")
66
+ s.add_argument("file")
67
+ s.add_argument("u", type=int)
68
+ s.add_argument("--lane", default="0")
69
+ s.add_argument("--limit", type=int, default=100)
70
+ s = sub.add_parser("records", help="records of a u range")
71
+ s.add_argument("file")
72
+ s.add_argument("--from", dest="u_from", type=int, default=1)
73
+ s.add_argument("--to", dest="u_to", type=int, default=None)
74
+ s.add_argument("--lane", default="0")
75
+ s.add_argument("--limit", type=int, default=100)
76
+ s = sub.add_parser("n", help="N of a cell: n u v [--lane]")
77
+ s.add_argument("u", type=int)
78
+ s.add_argument("v", type=int)
79
+ s.add_argument("--lane", default="0")
80
+ s = sub.add_parser("addr", help="address of an N number")
81
+ s.add_argument("n")
82
+ s = sub.add_parser("compact")
83
+ s.add_argument("file")
84
+ s.add_argument("--output")
85
+ s.add_argument("--backup", action="store_true")
86
+ s = sub.add_parser("repair")
87
+ s.add_argument("file")
88
+ s.add_argument("--apply", action="store_true")
89
+ s.add_argument("--no-backup", action="store_true")
90
+ s.add_argument("--allow-data-loss", action="store_true")
91
+ s.add_argument("--keep-uncommitted", action="store_true")
92
+ a = p.parse_args(argv)
93
+
94
+ try:
95
+ if a.cmd == "n":
96
+ print(dnhydb.n_of(a.u, a.v, _lane(a.lane)))
97
+ return 0
98
+ if a.cmd == "addr":
99
+ u, v, lane = dnhydb.address_of(a.n if a.n.upper().startswith("N") else int(a.n))
100
+ _out({"u": u, "v": v, "lane": lane, "lane_name": "NR" if lane else "NL"})
101
+ return 0
102
+ if a.cmd == "tail":
103
+ r = dnhydb.inspect_tail(a.file)
104
+ _out(r)
105
+ return 0 if r.get("clean") else 1
106
+ if a.cmd == "repair":
107
+ r = dnhydb.repair_file(
108
+ a.file,
109
+ apply=a.apply,
110
+ make_backup=not a.no_backup,
111
+ allow_data_loss=a.allow_data_loss,
112
+ keep_uncommitted=a.keep_uncommitted,
113
+ )
114
+ _out(r)
115
+ return 0 if a.apply or r.get("clean") else 1
116
+ if a.cmd == "compact":
117
+ _out(dnhydb.compact_file(a.file, output=a.output, make_backup=a.backup))
118
+ return 0
119
+ if a.cmd == "checkpoint":
120
+ with dnhydb.open(a.file) as db:
121
+ print(db.checkpoint())
122
+ return 0
123
+ if a.cmd == "verify":
124
+ return _verify(a)
125
+ db = dnhydb.open_reader(a.file)
126
+ if a.cmd == "stats":
127
+ _out(db.stats())
128
+ elif a.cmd == "schema":
129
+ _out(db.schema())
130
+ elif a.cmd == "health":
131
+ r = db.health(deep=a.deep)
132
+ _out(r)
133
+ return 0 if r["ok"] else 1
134
+ elif a.cmd == "get":
135
+ _out(db.cell(a.u, _col(a.v), lane=_lane(a.lane)))
136
+ elif a.cmd == "record":
137
+ _out(db.get_record(a.u, lane=_lane(a.lane)))
138
+ elif a.cmd == "cells":
139
+ out = []
140
+ for v, x in db.cells(a.u, lane=_lane(a.lane)):
141
+ out.append([v, x])
142
+ if len(out) >= a.limit:
143
+ break
144
+ _out(out)
145
+ elif a.cmd == "records":
146
+ out = []
147
+ for u, r in db.records(a.u_from, a.u_to, lane=_lane(a.lane)):
148
+ out.append({"u": u, **r})
149
+ if len(out) >= a.limit:
150
+ break
151
+ _out(out)
152
+ return 0
153
+ except (dnhydb.DnhydbError, OSError, ValueError, TypeError, LookupError, OverflowError, MemoryError) as e:
154
+ print(f"{type(e).__name__}: {e}", file=sys.stderr)
155
+ return 2
@@ -0,0 +1,226 @@
1
+ Metadata-Version: 2.4
2
+ Name: dnhydb
3
+ Version: 0.3.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: License :: Other/Proprietary License
6
+ Classifier: Intended Audience :: Developers
7
+ Classifier: Intended Audience :: Science/Research
8
+ Classifier: Operating System :: MacOS
9
+ Classifier: Operating System :: POSIX :: Linux
10
+ Classifier: Operating System :: Microsoft :: Windows
11
+ Classifier: Programming Language :: Rust
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Programming Language :: Python :: 3.14
16
+ Classifier: Programming Language :: Python :: 3.15
17
+ Classifier: Programming Language :: Python :: Implementation :: CPython
18
+ Classifier: Topic :: Database :: Database Engines/Servers
19
+ Requires-Dist: numpy>=1.22 ; extra == 'numpy'
20
+ Requires-Dist: pytest>=7 ; extra == 'test'
21
+ Requires-Dist: numpy>=1.22 ; extra == 'test'
22
+ Provides-Extra: numpy
23
+ Provides-Extra: test
24
+ License-File: LICENSE.md
25
+ License-File: THIRD-PARTY-LICENSES.txt
26
+ Summary: dNHyDB (directNHyDB) – general-purpose database with direct addressing (u, v, side); native Rust engine with Python bindings
27
+ Keywords: database,storage-engine,rust,numpy,append-only
28
+ Author-email: Achim Meissner <achim.meissner@nhydb.de>
29
+ Requires-Python: >=3.12
30
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
31
+ Project-URL: Changelog, https://github.com/nhydb-run4/dNHyDB/blob/main/CHANGELOG.md
32
+ Project-URL: Documentation, https://github.com/nhydb-run4/dNHyDB/blob/main/docs/cookbook/PYTHON_COOKBOOK.md
33
+ Project-URL: Issues, https://github.com/nhydb-run4/dNHyDB/issues
34
+ Project-URL: Repository, https://github.com/nhydb-run4/dNHyDB
35
+
36
+ # dNHyDB (directNHyDB)
37
+
38
+ **A compact record store with direct mathematical addressing.**
39
+
40
+ dNHyDB is the streamlined member of the **Dynadron** database family. Every
41
+ value lives in a cell `(u, v, s)`: `u` is the record, `v` the field or
42
+ position, `s` one of two sides. There are no tables and no primary index –
43
+ the address space itself provides order, and each cell has an exact natural
44
+ number `N` that is computed when needed, never stored. The engine is written
45
+ in native Rust and used from Python.
46
+
47
+ [![PyPI](https://img.shields.io/pypi/v/dnhydb)](https://pypi.org/project/dnhydb/)
48
+ · Python 3.12–3.15 · Linux, macOS, Windows ·
49
+ [License: source-available, non-production](#license)
50
+
51
+ **→ [Python Cookbook](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/cookbook/PYTHON_COOKBOOK.md)** –
52
+ task-oriented guide with tested examples for the complete Python API.
53
+
54
+ ## The addressing idea
55
+
56
+ `u` and `v` are integers from 1 to 2⁶⁴ − 1, the side `s` is `NL` or `NR`.
57
+ The number of a cell is
58
+
59
+ ```text
60
+ G = u + v N = G² − u (side NL) N = G² + v (side NR)
61
+ ```
62
+
63
+ so `(u, v) = (11, 13)` is `N = 565` on NL and `N = 589` on NR. The mapping is
64
+ exact in both directions (`dnhydb.n_of`, `dnhydb.address_of`); `N` needs up
65
+ to 130 bits and is handled as a Python integer.
66
+
67
+ ## Installation
68
+
69
+ ```bash
70
+ pip install dnhydb
71
+ pip install numpy # optional, for the NumPy batch API
72
+ ```
73
+
74
+ Prebuilt wheels are available for CPython 3.12–3.15 on Linux (x86_64,
75
+ aarch64), macOS (x86_64, arm64) and Windows (x64). No Rust toolchain is
76
+ needed; building from source is described in
77
+ [`BUILDING.md`](https://github.com/nhydb-run4/dNHyDB/blob/main/BUILDING.md).
78
+
79
+ ## A first example
80
+
81
+ Create a database, write two records and a free cell, close it, open it
82
+ again as a reader and read:
83
+
84
+ ```python
85
+ import os
86
+ import tempfile
87
+
88
+ import dnhydb
89
+
90
+ path = os.path.join(tempfile.mkdtemp(), "cities.dnhydb")
91
+
92
+ # Create: a typed BASE record layout, two records and one free cell.
93
+ with dnhydb.create(path) as db:
94
+ db.define_base([("city", "utf8"), ("population", "u64")])
95
+ db.put_record(1, ["Berlin", 3_685_000])
96
+ db.put_record(2, ["Hamburg", 1_862_000])
97
+ db.put_cell(2, 1_000, "port city")
98
+ # Leaving the block commits and closes the database.
99
+
100
+ db = dnhydb.open_reader(path)
101
+ print(db.get_record(2))
102
+ print(db.get_cell(2, 1_000))
103
+ n = dnhydb.n_of(2, 1)
104
+ print(n, dnhydb.address_of(n))
105
+ db.close()
106
+ ```
107
+
108
+ ```text
109
+ {'city': 'Hamburg', 'population': 1862000, 'v1000': 'port city'}
110
+ port city
111
+ 7 (2, 1, 0)
112
+ ```
113
+
114
+ The database is a single file (`cities.dnhydb`); next to it the engine keeps
115
+ a `.lock` file for the writer and a catalog (`.dnhydb-index`) that speeds up
116
+ opening and is rebuilt automatically. For a backup the `.dnhydb` file is
117
+ enough – see
118
+ [Cookbook, section 17](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/cookbook/PYTHON_COOKBOOK.md#17-files-on-disk-backup-and-restore).
119
+
120
+ ## What dNHyDB offers
121
+
122
+ * **Records and cells:** a typed BASE record layout (`define_base`), named
123
+ extensions, free cells anywhere in the address space, deletion with
124
+ tombstones, two sides per cell.
125
+ * **Write path:** write buffer, batches, NumPy column batches, commit policy
126
+ (manual or by thresholds), transactions with rollback, durability `fsync`,
127
+ `full` or `none`.
128
+ * **One writer, many readers:** a reader – also in another process – sees
129
+ the last commit as a consistent snapshot and moves forward with
130
+ `refresh()`.
131
+ * **Crash safety:** append-only file with two CRC-protected superblocks; after
132
+ a crash the last commit is valid, never half a batch.
133
+ * **Reading:** point access, records, iterators that skip gaps, column reads
134
+ into NumPy, a VALUE index for equality and range lookups.
135
+ * **Maintenance:** stats, health, verify, checkpoint, compaction (in place or
136
+ as a copy), tail inspection and repair.
137
+
138
+ Measured throughput figures and their exact test conditions are documented
139
+ in the
140
+ [technical documentation, section 16.3](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/en/dNHyDB_Technical_Documentation.md#163-benchmarks).
141
+
142
+ ## Documentation
143
+
144
+ * **[Python Cookbook](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/cookbook/PYTHON_COOKBOOK.md)** –
145
+ installation, the model, records and cells, addresses and `N`, types,
146
+ iterators, batches, NumPy, transactions and durability, readers and
147
+ writers, options, the VALUE index, maintenance, backups, errors, the
148
+ command line, complete application examples and an API reference. All
149
+ examples are executed by the test suite.
150
+ * [Technical documentation (English)](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/en/dNHyDB_Technical_Documentation.md) ·
151
+ [Technische Dokumentation (Deutsch)](https://github.com/nhydb-run4/dNHyDB/blob/main/docs/de/dNHyDB_Technische_Dokumentation.md) –
152
+ mathematics, architecture, file format, guarantees.
153
+ * [Example programs](https://github.com/nhydb-run4/dNHyDB/tree/main/examples/python) ·
154
+ [example configuration](https://github.com/nhydb-run4/dNHyDB/blob/main/config/dnhydb_config.example.toml) ·
155
+ [`CHANGELOG.md`](https://github.com/nhydb-run4/dNHyDB/blob/main/CHANGELOG.md)
156
+ * Command line: `dnhydb --help` (or `python -m dnhydb`).
157
+ * Rust: the core crate `crates/dnhydb-core` has no Python dependency and can
158
+ be used directly; see the technical documentation.
159
+
160
+ ## Sibling project: NHyDB
161
+
162
+ [**NHyDB**](https://github.com/nhydb-run4/NHyDB) (`pip install nhydb`) is the full
163
+ Dynadron database: several realms, layouts CLASSIC, COLUMN, PACKED and
164
+ CUSTOM, MATH_MAP (placing values by formulas), text and full-text indexes,
165
+ the QueryEngine and NHySQL, and an encrypted external layout plan. Choose
166
+ **dNHyDB** for a compact, direct record store and **NHyDB** when you need
167
+ the full model.
168
+
169
+ ## Scientific background
170
+
171
+ The mathematical foundations (in German):
172
+
173
+ * *Das Dynadron als mathematisches Datenbankprinzip* –
174
+ [doi:10.5281/zenodo.23438748](https://doi.org/10.5281/zenodo.23438748)
175
+ * *Das Dynadron der natürlichen Zahlen* –
176
+ [doi:10.5281/zenodo.22549415](https://doi.org/10.5281/zenodo.22549415)
177
+ * *Geometrie und Arithmetik im Dynadron* –
178
+ [doi:10.5281/zenodo.22694525](https://doi.org/10.5281/zenodo.22694525)
179
+
180
+ ## Known limitations
181
+
182
+ * **Scope:** one realm (R1) and the CLASSIC record layout only; `u` and `v`
183
+ are `u64`; integer values up to 128 bits; no query language (access via
184
+ API, iterators and the VALUE index).
185
+ * **One writer at a time** (exclusive lock on `<file>.lock`); readers see the
186
+ last commit and call `refresh()` for newer commits.
187
+ * **`None` in BASE fields:** use extensions or free cells for optional values
188
+ (see the Cookbook).
189
+ * **Durability `full`:** on macOS `F_FULLFSYNC` is used; if the file system
190
+ rejects it, dNHyDB falls back to a plain `fsync` without reporting an
191
+ error. On Linux `full` is the same as `fsync`; on Windows both use
192
+ `FlushFileBuffers`.
193
+ * **Windows:** replacing the database file while readers hold it open
194
+ (compaction) uses POSIX rename semantics (Windows 10 or newer, NTFS).
195
+ * **Status:** alpha – the API may still change between minor versions.
196
+
197
+ ## License
198
+
199
+ dNHyDB is licensed under the **NHyDB / dNHyDB Experimental Software License
200
+ 1.0** ([`LICENSE.md`](https://github.com/nhydb-run4/dNHyDB/blob/main/LICENSE.md)).
201
+ The source code is available, but this is **not an open-source license**:
202
+ free use is limited to non-production purposes (unlimited for private
203
+ individuals, time-limited for teaching, research and businesses), and
204
+ **production use is not permitted** without a separate written license.
205
+ Please read the license text before using the software.
206
+
207
+ The compiled extension module contains third-party Rust components under
208
+ MIT/Apache-2.0-style licenses; their notices are in
209
+ [`THIRD-PARTY-LICENSES.txt`](https://github.com/nhydb-run4/dNHyDB/blob/main/THIRD-PARTY-LICENSES.txt),
210
+ which is also shipped inside the wheel.
211
+
212
+ ## Development
213
+
214
+ Building from source: [`BUILDING.md`](https://github.com/nhydb-run4/dNHyDB/blob/main/BUILDING.md) ·
215
+ release procedure: [`RELEASING.md`](https://github.com/nhydb-run4/dNHyDB/blob/main/RELEASING.md)
216
+
217
+ ```bash
218
+ cargo clippy --workspace --all-targets -- -D warnings
219
+ pip install ".[test]"
220
+ python -m pytest tests/smoke # smoke tests of the installed package
221
+ ```
222
+
223
+ ## Contact
224
+
225
+ Achim Meissner – achim.meissner@nhydb.de
226
+
@@ -0,0 +1,11 @@
1
+ dnhydb/__init__.py,sha256=AtRjvz_0OnmfnnpkqoTt3JAudyISmzo4PIx1j5aR9GM,2008
2
+ dnhydb/__main__.py,sha256=SCuGk-L-bb1zLj15YeA4J9PvoYe60R0p2hiL5YDrvuo,51
3
+ dnhydb/_native.cp315-win_amd64.pyd,sha256=xQotIhslAUL5fDtPg-yMYr9d6GuE0Wis5Nuv1Wi-n_4,1723392
4
+ dnhydb/cli.py,sha256=JYjs8KYSyMa0moTLa4vp8U1XtXvzyuAjx-Hjk_RMyAA,5779
5
+ dnhydb-0.3.0.dist-info/METADATA,sha256=b9zLqsFtlAsKjWxdEpPFA6NgyvDhscIc8xeea5AzI74,10143
6
+ dnhydb-0.3.0.dist-info/WHEEL,sha256=Q5QdGvjBfn8x6ihg-B4VQuuGKk7DT67L9DVrwEH_qj8,97
7
+ dnhydb-0.3.0.dist-info/entry_points.txt,sha256=IhsA9Zn9B7zSY-F1bJ7cg-tNi-65hS-gjNBLVw-tbCI,41
8
+ dnhydb-0.3.0.dist-info/licenses/LICENSE.md,sha256=chRO36jpa6VQ_fuuZ-_GnNqc4YEchFG-QDvYlwDfJCI,14767
9
+ dnhydb-0.3.0.dist-info/licenses/THIRD-PARTY-LICENSES.txt,sha256=eZTyDNdKna3Nn0YLVmERS1b_xPmgPQ-hg4frVg3FGVs,16871
10
+ dnhydb-0.3.0.dist-info/sboms/dnhydb-py.cyclonedx.json,sha256=dmM0zAi9A0ktwN0YuKOw5DBQU_Db8Mb6-u7aLn4NYqc,63097
11
+ dnhydb-0.3.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.16.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp315-cp315-win_amd64
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dnhydb=dnhydb.cli:main
@@ -0,0 +1,167 @@
1
+ # NHyDB / dNHyDB Experimental Software License
2
+
3
+ **License Version 1.0 — 17 October 2026**
4
+
5
+ Copyright (c) 2026 Achim Meissner. All rights reserved.
6
+
7
+ **Official website:** https://nhy-db.com
8
+ **Licensing contact:** achim.meissner@nhydb.de
9
+
10
+ **SOURCE-AVAILABLE SOFTWARE — NOT AN OPEN-SOURCE LICENSE**
11
+
12
+ This License governs both **NHyDB** and **dNHyDB** when distributed under these terms by the Licensor. Each is referred to below as a **Product**; together they are referred to as the **Software**. The same License text may be included unchanged in both repositories.
13
+
14
+ The Software is provided free of charge for limited experimental purposes only. **This License grants no right to use either Product in production.**
15
+
16
+ ## 1. Definitions
17
+
18
+ **Licensor:** Achim Meissner, to the extent he owns or controls the rights being licensed.
19
+
20
+ **Licensee:** The individual or legal entity exercising the permissions of this License. When a Product is used for an organization, that organization is the Licensee; individual employees do not receive separate organizational evaluation periods.
21
+
22
+ **Software:** The relevant Product's code, binaries, and accompanying materials that the Licensor distributes under this License, including modifications made under its permissions. Independently licensed third-party components remain subject to their respective terms.
23
+
24
+ **Non-Production Use:** Internal, isolated testing, experimentation, evaluation, teaching, research, or development that does not operate, support, or form part of any live operational system and on which no real-world process relies.
25
+
26
+ **First Use:** The first actual execution or operation of the relevant Product by or for the Licensee, including running tests or an evaluation. Merely viewing or downloading source code does not count as First Use.
27
+
28
+ **Written Permission:** Express permission from the Licensor in durable written form, including email, identifying the additional permitted activity. Silence is not permission.
29
+
30
+ ## 2. Limited license grant
31
+
32
+ Subject to compliance with this License, the Licensor grants the Licensee a non-exclusive, worldwide, non-transferable, royalty-free permission, for the applicable period in Section 3, to:
33
+
34
+ 1. Download, inspect, build, execute, and test the Software for authorized Non-Production Use.
35
+ 2. Make copies reasonably necessary for the Licensee's own authorized internal testing and for backups, without prejudice to mandatory statutory rights.
36
+ 3. Modify the source code and create derivative experimental versions **for the Licensee's own internal Non-Production Use only**.
37
+
38
+ No sublicense, redistribution, third-party service provision, publication of modified versions, or Production Use is granted. Employees within the same legal entity may participate in its authorized internal tests. Separate entities, external contractors, clients, and other third parties do not acquire rights through the Licensee.
39
+
40
+ These permissions do not affect activities expressly allowed by mandatory law.
41
+
42
+ ## 3. Categories and duration of free use
43
+
44
+ | Licensee / purpose | Free-use period | Permitted activity |
45
+ |---|---|---|
46
+ | **Private individuals** | **Unlimited** | Own private, non-commercial, strictly non-production experimentation, learning, and development |
47
+ | **Schools and universities — teaching** | **24 calendar months** | Internal non-production teaching, exercises, instruction, and educational development |
48
+ | **Non-commercial academic or scientific research** | **6 calendar months** | Internal non-production research and evaluation |
49
+ | **Businesses and other commercial organizations** | **3 calendar months** | **Exclusively their own internal, isolated, non-production tests and evaluation** |
50
+
51
+ The category is determined by the real Licensee and actual purpose, not by an individual's job title or a project's label. Research conducted by a commercial organization falls under its **three-month commercial evaluation period**. University teaching falls under the **24-month teaching period**; research conducted by that institution falls under the **six-month research period**, unless otherwise authorized. An employee or researcher cannot use the unlimited private permission to evade the restrictions applicable to an organization.
52
+
53
+ ### 3.1 Start and calculation
54
+
55
+ A limited period begins on the date of **First Use** of the relevant Product by or on behalf of the Licensee and expires at the start of the corresponding calendar date after the applicable number of months (or at the start of the final calendar day if no corresponding date exists).
56
+
57
+ A period runs once per Licensee and per Product. A different employee, device, installation, project name, software modification, download, or later version **does not reset or extend** that Licensee's period for the same Product. There is no registration, telephone-home function, or technical license-expiration requirement under this License; compliance with the dates remains the Licensee's responsibility.
58
+
59
+ Extensions, cooperation arrangements, and other exceptions require **Written Permission** from the Licensor and may be free of charge or separately negotiated. No category grants Production Use, regardless of its duration.
60
+
61
+ ## 4. Experimental prototype — strict prohibition of Production Use
62
+
63
+ **THE SOFTWARE IS AN EXPERIMENTAL RESEARCH AND DEVELOPMENT PROTOTYPE. IT IS NOT APPROVED, CERTIFIED, WARRANTED, OR REPRESENTED AS PRODUCTION-READY.**
64
+
65
+ **PRODUCTION USE IS EXPRESSLY PROHIBITED UNDER THIS LICENSE IN ALL CIRCUMSTANCES, INCLUDING PRIVATE, EDUCATIONAL, ACADEMIC, SCIENTIFIC, INSTITUTIONAL, GOVERNMENTAL, AND COMMERCIAL SETTINGS.**
66
+
67
+ **Production Use** includes, without limitation:
68
+
69
+ 1. Operating the Software in any live, operational, customer-facing, or production environment, even if the operator calls the deployment a trial, demonstration, pilot, or test.
70
+ 2. Using the Software to conduct, record, administer, or support actual financial transactions, business operations, services, or other real-world processes.
71
+ 3. Using the Software as the authoritative, primary, or operationally relied-upon store for financial, business, customer, personal, or other records needed in real-world activities.
72
+ 4. Connecting the Software to live services, workloads, or systems in a way that may affect their operation, availability, security, or data integrity.
73
+ 5. Relying on the Software's outputs, correctness, availability, or durability for operational decisions or for indispensable records.
74
+ 6. Incorporating the Software into a product, hosted service, or other system offered to or operated for third parties.
75
+
76
+ **The prohibition applies even if the Software is free, even during an otherwise valid evaluation period, and even when a user voluntarily accepts the risks.**
77
+
78
+ All permitted tests must be isolated in **non-production testing, research, teaching, or development environments**. Commercial Licensees may use the Software **only in their own internal non-production environments**; live-system evaluations and production pilots are not permitted. Test data must be used lawfully and safeguarded independently. The Software must never be the only or authoritative copy of data, and an experiment must not be able to impair operational systems or indispensable records.
79
+
80
+ **Any Production Use without a separate express written license is outside the scope of this License and breaches its conditions.**
81
+
82
+ ## 5. Redistribution and derivative works
83
+
84
+ Unless separately authorized by Written Permission or permitted by mandatory law, the Licensee must **not**:
85
+
86
+ - Give, transmit, redistribute, publish, mirror, sell, rent, or sublicense copies of the original or modified Software to third parties.
87
+ - Publish modified source code, independent public derivatives, modified packages, binaries, or releases.
88
+ - Incorporate the Software into third-party products or provide its operation to third parties as a service.
89
+
90
+ Internal copies within the same legal entity are permitted only insofar as necessary for licensed Non-Production Use. Required copyright and license notices must remain intact.
91
+
92
+ Independent scientific results, descriptions, and benchmark findings may be published without permission **provided that the publication does not distribute the Software or substantial portions of protected source code** and does not falsely claim endorsement by the Licensor.
93
+
94
+ ## 6. GitHub forks
95
+
96
+ When a Product is published in a public GitHub repository, GitHub users may view and fork it through GitHub's normal functionality to the extent provided by GitHub's applicable Terms of Service.
97
+
98
+ **Forking an unmodified public repository through GitHub is permitted.** It does **not** grant any additional right to execute, deploy, distribute, sublicense, commercialize, or use the Software in production.
99
+
100
+ **Publishing modified versions in public forks, distributing releases from forks, or otherwise publishing independent derivative software requires prior Written Permission** from the Licensor, except where an overriding right under the GitHub Terms of Service or mandatory law applies.
101
+
102
+ This License does not purport to withdraw rights already granted by the Licensor under GitHub's applicable Terms of Service.
103
+
104
+ ## 7. Copyright and attribution
105
+
106
+ **Copyright (c) 2026 Achim Meissner. All rights reserved.**
107
+
108
+ All authorized copies and modifications must retain existing copyright notices, this License, and applicable third-party notices. The Licensee must not remove or falsify provenance or imply that the Licensor endorses an independent project.
109
+
110
+ No ownership rights are transferred. All rights not expressly granted are reserved. No trademark, branding, or logo rights are granted beyond accurate identification of the Software. Third-party components continue to be governed by their own licenses.
111
+
112
+ ## 8. Use entirely at the Licensee's own risk
113
+
114
+ **THE LICENSEE USES THE SOFTWARE ENTIRELY AT THE LICENSEE'S OWN RISK.**
115
+
116
+ The Software is an **unfinished experimental development prototype**. It may contain defects, incorrect results, security vulnerabilities, incomplete features, platform limitations, crashes, data corruption, data loss, or unrecoverable files.
117
+
118
+ The Licensee is solely responsible for using isolated test environments, selecting appropriate non-critical test data, maintaining independent backups, and preventing experiments from affecting operational systems. Passing tests, published benchmarks, source availability, and documentation **are not warranties and do not authorize Production Use**.
119
+
120
+ ## 9. No warranties or support obligation
121
+
122
+ To the maximum extent permitted by applicable law, the Software is provided free of charge **"AS IS" and "AS AVAILABLE"**, without warranties or guarantees of any kind, including warranties of correctness, reliability, security, fitness for a particular purpose, availability, data integrity, durability, recoverability, or freedom from defects.
123
+
124
+ The Licensor has no obligation to provide support, maintenance, compatibility updates, security patches, continuing availability of downloads, corrections, or data-recovery assistance unless separately agreed in writing.
125
+
126
+ Mandatory rights or liabilities that cannot lawfully be excluded remain unaffected.
127
+
128
+ ## 10. Limitation of liability
129
+
130
+ **TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW**, the Licensor excludes liability for loss or damage arising from the use, attempted use, inability to use, or unauthorized Production Use of the Software, including data loss, data corruption, financial loss, interruption of operations, lost profit, and consequential damage.
131
+
132
+ For ordinary (slight) negligence, liability is excluded to the extent legally permissible. Where liability cannot be excluded because an essential contractual obligation has been breached, it is limited, insofar as legally permissible, to damage that was foreseeable and typical in view of this **free, experimental, strictly non-production** license.
133
+
134
+ **Nothing in this License excludes or limits liability** for intentional misconduct, gross negligence where its exclusion is impermissible, injury to life, body, or health where liability cannot legally be excluded, fraudulent concealment, express guarantees assumed by the Licensor, or any other liability that mandatory law prevents the Licensor from excluding or limiting.
135
+
136
+ Use outside the permitted scope, in particular prohibited Production Use, is not authorized by this License. This fact does not remove any mandatory statutory liability of the Licensor.
137
+
138
+ ## 11. Expiration and termination
139
+
140
+ A time-limited license expires automatically at the end of its permitted period unless extended in writing. A material breach, including prohibited Production Use, unauthorized redistribution, or unauthorized public derivatives, terminates the relevant permission for the affected Product, subject to mandatory applicable law.
141
+
142
+ Upon expiration or termination, the Licensee must **immediately cease executing, deploying, modifying, and otherwise using the affected Software**, unless a separate valid license applies.
143
+
144
+ **Deletion of existing copies is not required.** Retention of a copy does not confer any further right of use. This License does not transfer ownership of the Licensee's independently owned data to the Licensor, but it also does not promise subsequent software access or data export or recovery services.
145
+
146
+ The clauses on ownership, attribution, restrictions, warranty disclaimers, liability, and applicable law survive to the extent legally permissible.
147
+
148
+ ## 12. Separate commercial licenses and individual permissions
149
+
150
+ **Any Production Use requires a separate, express written agreement** identifying the Product, authorized use, term, and any commercial, warranty, support, or liability conditions. No such rights are granted here.
151
+
152
+ Requests for commercial licenses, academic cooperation, extensions, or permission to publish modified versions should be sent to:
153
+
154
+ **achim.meissner@nhydb.de**
155
+ **https://nhy-db.com**
156
+
157
+ ## 13. Applicable law and mandatory rights
158
+
159
+ This License is intended to be governed by the laws of the Federal Republic of Germany, subject to any overriding mandatory rules, including applicable consumer-protection provisions.
160
+
161
+ Nothing here restricts rights that cannot be contractually excluded under applicable law, including mandatory statutory rights concerning computer programs.
162
+
163
+ If a provision is invalid or unenforceable, the remaining provisions shall continue to apply to the extent legally permissible; mandatory statutory provisions govern the invalid part.
164
+
165
+ ---
166
+
167
+ **End of NHyDB / dNHyDB Experimental Software License, Version 1.0.**