openstatspec 0.1.0__py3-none-any.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.
- openstatspec/__init__.py +6 -0
- openstatspec/api.py +95 -0
- openstatspec/cli.py +42 -0
- openstatspec/core/__init__.py +33 -0
- openstatspec/core/results.py +47 -0
- openstatspec/spss/__init__.py +22 -0
- openstatspec/spss/dictionary.py +180 -0
- openstatspec/spss/raw_dictionary.py +393 -0
- openstatspec/spss/sav.py +569 -0
- openstatspec/sql/__init__.py +14 -0
- openstatspec/sql/capabilities.py +260 -0
- openstatspec/sql/normative.py +513 -0
- openstatspec/sql/profiles.py +217 -0
- openstatspec/sql/wide.py +1087 -0
- openstatspec-0.1.0.dist-info/METADATA +90 -0
- openstatspec-0.1.0.dist-info/RECORD +18 -0
- openstatspec-0.1.0.dist-info/WHEEL +4 -0
- openstatspec-0.1.0.dist-info/entry_points.txt +2 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openstatspec
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Reference adapter for the OpenStatSpec relational contract
|
|
5
|
+
Author: OpenStatSpec
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Requires-Dist: openstatspec-pyspssio==0.5.1.post2
|
|
9
|
+
Requires-Dist: pandas>=2.2
|
|
10
|
+
Requires-Dist: sqlalchemy>=2.0
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
13
|
+
Provides-Extra: sql
|
|
14
|
+
Requires-Dist: psycopg[binary]>=3.2; extra == 'sql'
|
|
15
|
+
Requires-Dist: pymysql>=1.1; extra == 'sql'
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# OpenStatSpec Python
|
|
19
|
+
|
|
20
|
+
The reference Python implementation of the OpenStatSpec specification.
|
|
21
|
+
|
|
22
|
+
This package implements the specification; it does not define or extend it.
|
|
23
|
+
The normative model lives in the `OpenStatSpec/specification` repository.
|
|
24
|
+
|
|
25
|
+
## Boundaries
|
|
26
|
+
|
|
27
|
+
For each supported import, one source dataset becomes one dedicated wide SQL
|
|
28
|
+
table. Cases are rows and source variables are physical SQL columns. The
|
|
29
|
+
singular UUID-keyed tables from the specification (`dataset`, `variable`,
|
|
30
|
+
`operation`, `fidelity_event`, and related metadata tables) are the public
|
|
31
|
+
catalog contract. Historical `*_catalog` tables are an internal compatibility
|
|
32
|
+
layer for the current exporter and are not the standard database interface.
|
|
33
|
+
The adapter does not reshape data, create EAV
|
|
34
|
+
or long-form tables, or harmonize studies or waves.
|
|
35
|
+
|
|
36
|
+
Unsupported source features, SQL targets, or export paths fail explicitly.
|
|
37
|
+
There is no silent truncation, type conversion, metadata loss, or partial
|
|
38
|
+
import.
|
|
39
|
+
|
|
40
|
+
## Package layout
|
|
41
|
+
|
|
42
|
+
- `openstatspec.core`: pure standard concepts, validation, versions,
|
|
43
|
+
capabilities, and loss reports.
|
|
44
|
+
- `openstatspec.sql`: database connection and wide-table/catalog operations.
|
|
45
|
+
- `openstatspec.spss`: SAV/ZSAV adapter boundary.
|
|
46
|
+
|
|
47
|
+
## Intended workflow
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
from openstatspec import export_sav, import_sav
|
|
51
|
+
|
|
52
|
+
import_sav("responses.sav", database_url="postgresql+psycopg://user:password@server/database", dataset_id="responses-2026")
|
|
53
|
+
export_sav(database_url="postgresql+psycopg://user:password@server/database", dataset_id="responses-2026", destination="responses-roundtrip.sav")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
openstatspec import responses.sav --database-url postgresql+psycopg://... --dataset-id responses-2026
|
|
58
|
+
openstatspec export --database-url postgresql+psycopg://... --dataset-id responses-2026 --output responses-roundtrip.sav
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 0.1.0 support status
|
|
62
|
+
|
|
63
|
+
The adapter requires `openstatspec-pyspssio==0.5.1.post2` as its sole SPSS
|
|
64
|
+
engine. Its import module remains `pyspssio`; the exact source commit is recorded
|
|
65
|
+
in operation metadata. There is no fallback reader or writer. It supports unencrypted SAV and ZSAV import and
|
|
66
|
+
SAV/ZSAV export for the semantics exposed by that engine. SQLite is the local
|
|
67
|
+
reference path.
|
|
68
|
+
PostgreSQL, MySQL, and MariaDB are each covered by separate service-backed CI
|
|
69
|
+
conformance checks. Use these explicit SQLAlchemy URLs:
|
|
70
|
+
|
|
71
|
+
- SQLite: `sqlite:///dataset.sqlite`
|
|
72
|
+
- PostgreSQL: `postgresql+psycopg://user:password@host/database`
|
|
73
|
+
- MySQL/MariaDB: `mysql+pymysql://user:password@host/database`
|
|
74
|
+
|
|
75
|
+
Run `openstatspec capabilities` before an integration to inspect the
|
|
76
|
+
machine-readable feature matrix. Export is deliberately strict: if known
|
|
77
|
+
dictionary semantics cannot be reproduced, it stops until you pass the exact
|
|
78
|
+
diagnostic code with `--allow-loss`. This avoids silent loss while making an
|
|
79
|
+
intentional lossy export auditable.
|
|
80
|
+
|
|
81
|
+
The matrix is also available to Python callers as
|
|
82
|
+
`openstatspec.capability_matrix()`. It distinguishes supported semantics from
|
|
83
|
+
unobservable and fail-closed paths; see the SAV profile for the exact
|
|
84
|
+
the openstatspec-pyspssio boundary.
|
|
85
|
+
|
|
86
|
+
See [the SAV profile](docs/sav-profile.md) for feature boundaries and
|
|
87
|
+
[release readiness](docs/release-readiness.md) for the pre-tag checklist.
|
|
88
|
+
Read [third-party notices](THIRD_PARTY_NOTICES.md) before distributing a
|
|
89
|
+
bundled application: the required engine includes IBM redistributables under
|
|
90
|
+
separate terms.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
openstatspec/__init__.py,sha256=iRyg5vqDG5vAAKaVd-ydAw3A7zeZnM1VstlBayv93bw,411
|
|
2
|
+
openstatspec/api.py,sha256=Ro8MZOm5gpgLjb_urJ1xxbVWlHwiz1P8BhxqSFKkPQA,4256
|
|
3
|
+
openstatspec/cli.py,sha256=0jgq5nL6KIOnRoPf2vyRH96b41MQJCYbuqWKoOP0LTw,2354
|
|
4
|
+
openstatspec/core/__init__.py,sha256=Qbf46KjoTiQOGdxVmC1w95jI3eFPOlf9dQF6QClETr8,1081
|
|
5
|
+
openstatspec/core/results.py,sha256=hujBICiAWG2rc4opw6RyeetJFO4tfTP8e9LL1rGieto,1413
|
|
6
|
+
openstatspec/spss/__init__.py,sha256=yGwHe2mNYAykpfKqAvUWsiwASZUS1GKiaXNrw0b99Lk,869
|
|
7
|
+
openstatspec/spss/dictionary.py,sha256=orrA3pgfGWmJADS79bZrj-d6ObQWs-TFFMk0szZ7BxM,7285
|
|
8
|
+
openstatspec/spss/raw_dictionary.py,sha256=OEjqIcePtdaYcFtbURkq_rU4jzpR_wuUrvb-3XX3Wjk,15743
|
|
9
|
+
openstatspec/spss/sav.py,sha256=Evj7gQ9zfhGHrOCf1hPI1Vl_7ZbnPFf29FLPTguN-nQ,24025
|
|
10
|
+
openstatspec/sql/__init__.py,sha256=TqBsoucGyI-ETtop-t88czw80ZL8OHZYVf4kRqvsShU,496
|
|
11
|
+
openstatspec/sql/capabilities.py,sha256=JCS2DJX_mAT9a04P8aQELG_YzTOQn1s2gYhmZewhKro,11445
|
|
12
|
+
openstatspec/sql/normative.py,sha256=QNN44RDUGxnPest7_mWTFWxoBxQGL7H4XFuptcvjjtA,24373
|
|
13
|
+
openstatspec/sql/profiles.py,sha256=OPhorXcPBTDO3ItMxeQEthYP71v2WqVhjuaIlkage30,9276
|
|
14
|
+
openstatspec/sql/wide.py,sha256=gSeDTk3n4O_9t1zap_dvhsh8Npn6HTKzqXBlqoeWZFw,53841
|
|
15
|
+
openstatspec-0.1.0.dist-info/METADATA,sha256=pywML9sicWwklme13t-kDn1jll65KA-QCxSERxeigk8,3893
|
|
16
|
+
openstatspec-0.1.0.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
17
|
+
openstatspec-0.1.0.dist-info/entry_points.txt,sha256=D_2AwhN31w0hQiC_K6auh-GW5FfCH_xF3_QyzjXIuYI,55
|
|
18
|
+
openstatspec-0.1.0.dist-info/RECORD,,
|