statcatlib 0.16.0__tar.gz → 0.16.1__tar.gz
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.
- {statcatlib-0.16.0 → statcatlib-0.16.1}/PKG-INFO +1 -1
- {statcatlib-0.16.0 → statcatlib-0.16.1}/pyproject.toml +1 -1
- {statcatlib-0.16.0 → statcatlib-0.16.1}/pyproject.toml.orig +1 -1
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/cli/EGM.md +3 -2
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/cli/__init__.py +35 -6
- {statcatlib-0.16.0 → statcatlib-0.16.1}/LICENSE +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/README.md +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/EGM.md +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/__init__.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/admin.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/bundle.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/catalog.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/checks.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/diagnostics.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/expr.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/EGM.md +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/__init__.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/agents.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/catalog.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/classification.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/dataset.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/distribution.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/licence.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/quality.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/skos.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/spatial.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/temporal.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/model/types.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/py.typed +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/query.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/sources/EGM.md +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/sources/__init__.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/sources/ckan.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/sources/sdmx.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/EGM.md +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/__init__.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/blob.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/cross_product.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/inventory.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/lance.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/row.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/schema.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/scopes.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/sentinel.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/store.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/working_copy.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/store/xhtml.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/testing.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/upload.py +0 -0
- {statcatlib-0.16.0 → statcatlib-0.16.1}/src/statcatlib/urn.py +0 -0
|
@@ -39,7 +39,7 @@ Commands:
|
|
|
39
39
|
| `statcat verify-catalog PATH` | `verify_catalog` | `diagnostics.verify_catalog(path)` | any finding, each printed as `FAIL <file>: <detail>`; exit 2 on `CatalogUnreadableError`. Each stale data edition prints as `STALE <StaleEdition>` and leaves the exit code alone |
|
|
40
40
|
| `statcat doctor PATH` | `doctor` | `diagnostics.doctor(path)` | the report holds a warning (topic `stale data editions`: a stale embargoed data edition is one; a stale live edition is `info` and leaves the exit code alone; topic `partials with no structure home`: each item is one) |
|
|
41
41
|
| `statcat prune PATH --older-than DAYS --reason TEXT [--apply]` | `prune` | `sc.CatalogAdmin.open(path).prune(older_than=timedelta(days=DAYS), reason=TEXT, dry_run=not apply)` | `catalog.json` is missing, the catalog cannot be opened, the retire commit is refused, or a deletion failed (each printed as `FAIL <path>: <error>`) |
|
|
42
|
-
| `statcat upload EDITION_DIR AZ_URL [--release-at TIME]` | `upload` | `upload_edition(edition_dir, location, release_at=)` | a finding, each printed as `FAIL <file>: <detail>`, or a `ManifestError`, `BlobStoreError` or `ClientAuthenticationError`, printed as `ERROR <message>`; exit 2 on a usage error, a bad `AZ_URL`, `s3://`, no `AZURE_STORAGE_ACCOUNT_NAME`, a
|
|
42
|
+
| `statcat upload EDITION_DIR AZ_URL [--release-at TIME]` | `upload` | `upload_edition(edition_dir, location, release_at=)` | a finding, each printed as `FAIL <file>: <detail>`, or a `ManifestError`, `BlobStoreError` or `ClientAuthenticationError`, printed as `ERROR <message>`; exit 2 on a usage error, a bad `AZ_URL`, `s3://`, no `AZURE_STORAGE_ACCOUNT_NAME`, a refused `obstore` variable set, even empty, in any spelling `obstore` reads (`_REFUSED_VARIABLES`, matched by `_refused_variables`: `AZURE_` then any case), a naive time, or a missing `blob` extra |
|
|
43
43
|
|
|
44
44
|
`build-index` options and their `WorkingCopy.build_index` keyword:
|
|
45
45
|
|
|
@@ -75,7 +75,8 @@ Private helpers that tests and later commands rely on:
|
|
|
75
75
|
`statcatlib.cli` logger (currently unused).
|
|
76
76
|
- `_usage(message)` — prints it and exits 2. `_release_time(raw)`, `_catalog_uri(raw)`
|
|
77
77
|
and `_azure_account()` parse `upload`'s inputs, each through `_usage`.
|
|
78
|
-
`
|
|
78
|
+
`_refused_variables()` lists the environment's names that `obstore` would parse as a
|
|
79
|
+
refused key, as spelled. `_azure_location(uri, account)` builds the store with `obstore.store.from_url`,
|
|
79
80
|
`TokenIdentity(AzureCredentialProvider(DefaultAzureCredential()))` and the one-hour
|
|
80
81
|
timeout; `upload` is the only code in statcatlib that reads the environment for a
|
|
81
82
|
store.
|
|
@@ -60,9 +60,12 @@ _DEFAULT_MODEL = "intfloat/multilingual-e5-base"
|
|
|
60
60
|
|
|
61
61
|
_ACCEPTED_CODELIST_MODES = frozenset({"fts_only"})
|
|
62
62
|
|
|
63
|
-
#: The `obstore` variables `statcat upload` refuses
|
|
64
|
-
#:
|
|
65
|
-
#:
|
|
63
|
+
#: The `obstore` variables `statcat upload` refuses: every ``azure_`` spelling that object_store 0.14.2's
|
|
64
|
+
#: `AzureConfigKey::from_str` accepts for these keys, the crate obstore 0.12.1 bundles. Spec §10.1 allows the
|
|
65
|
+
#: publish job no account key or SAS. The credential provider's token wins beside the key, SAS and token variables
|
|
66
|
+
#: on obstore 0.12.1, and a later obstore could change that order. An endpoint, the emulator or the Fabric
|
|
67
|
+
#: endpoint sends the writes to another host than the digest read. Skipping the signature sends unsigned writes. A
|
|
68
|
+
#: customer-provided key encrypts blobs that the digest read sends no key for.
|
|
66
69
|
_REFUSED_VARIABLES = (
|
|
67
70
|
"AZURE_STORAGE_ACCOUNT_KEY",
|
|
68
71
|
"AZURE_STORAGE_ACCESS_KEY",
|
|
@@ -72,8 +75,16 @@ _REFUSED_VARIABLES = (
|
|
|
72
75
|
"AZURE_STORAGE_TOKEN",
|
|
73
76
|
"AZURE_STORAGE_ENDPOINT",
|
|
74
77
|
"AZURE_ENDPOINT",
|
|
78
|
+
"AZURE_STORAGE_USE_EMULATOR",
|
|
79
|
+
"AZURE_USE_FABRIC_ENDPOINT",
|
|
80
|
+
"AZURE_SKIP_SIGNATURE",
|
|
81
|
+
"AZURE_STORAGE_ENCRYPTION_KEY",
|
|
75
82
|
)
|
|
76
83
|
|
|
84
|
+
#: The refused names as `MicrosoftAzureBuilder::from_env` compares them: it reads each variable whose name starts
|
|
85
|
+
#: with ``AZURE_`` and parses the name lowercased.
|
|
86
|
+
_REFUSED_KEYS = frozenset(name.lower() for name in _REFUSED_VARIABLES)
|
|
87
|
+
|
|
77
88
|
#: How long one request may take: a 5,000 MiB Put at about 1.4 MB/s.
|
|
78
89
|
_UPLOAD_TIMEOUT = "1h"
|
|
79
90
|
|
|
@@ -633,10 +644,24 @@ def _catalog_uri(raw: str) -> str:
|
|
|
633
644
|
return f"az://{'/'.join(segments)}/"
|
|
634
645
|
|
|
635
646
|
|
|
647
|
+
def _refused_variables() -> list[str]:
|
|
648
|
+
"""The environment's names that `obstore` parses as a refused key, spelled as the environment spells them.
|
|
649
|
+
|
|
650
|
+
`MicrosoftAzureBuilder::from_env` lowercases ASCII letters only, so a name with any other character never
|
|
651
|
+
matches a key there, and is not refused here.
|
|
652
|
+
"""
|
|
653
|
+
return sorted(
|
|
654
|
+
name for name in os.environ if name.startswith("AZURE_") and name.isascii() and name.lower() in _REFUSED_KEYS
|
|
655
|
+
)
|
|
656
|
+
|
|
657
|
+
|
|
636
658
|
def _azure_account() -> str:
|
|
637
659
|
"""The storage account from the environment; a refused variable, even empty, or no account, exits 2."""
|
|
638
|
-
if found :=
|
|
639
|
-
_usage(
|
|
660
|
+
if found := _refused_variables():
|
|
661
|
+
_usage(
|
|
662
|
+
"upload writes with its own credential, signed and with no customer-provided key, "
|
|
663
|
+
f"to the account's URL; unset {', '.join(found)}"
|
|
664
|
+
)
|
|
640
665
|
account = os.environ.get("AZURE_STORAGE_ACCOUNT_NAME")
|
|
641
666
|
if not account:
|
|
642
667
|
_usage("set AZURE_STORAGE_ACCOUNT_NAME to the storage account's name")
|
|
@@ -688,7 +713,11 @@ def upload(
|
|
|
688
713
|
empty: ``AZURE_STORAGE_ACCOUNT_KEY``, ``AZURE_STORAGE_ACCESS_KEY``,
|
|
689
714
|
``AZURE_STORAGE_MASTER_KEY``, ``AZURE_STORAGE_SAS_KEY``,
|
|
690
715
|
``AZURE_STORAGE_SAS_TOKEN``, ``AZURE_STORAGE_TOKEN``,
|
|
691
|
-
``AZURE_STORAGE_ENDPOINT
|
|
716
|
+
``AZURE_STORAGE_ENDPOINT``, ``AZURE_ENDPOINT``,
|
|
717
|
+
``AZURE_STORAGE_USE_EMULATOR``, ``AZURE_USE_FABRIC_ENDPOINT``,
|
|
718
|
+
``AZURE_SKIP_SIGNATURE`` and ``AZURE_STORAGE_ENCRYPTION_KEY``. Any case
|
|
719
|
+
after ``AZURE_`` counts, such as ``AZURE_storage_endpoint``, since
|
|
720
|
+
``obstore`` reads that spelling too.
|
|
692
721
|
"""
|
|
693
722
|
when = _release_time(release_at)
|
|
694
723
|
uri = _catalog_uri(az_url)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|