equiframe 0.12.4__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.
- equiframe/__init__.py +832 -0
- equiframe/__main__.py +3 -0
- equiframe/_base.py +84 -0
- equiframe/_cli_support.py +125 -0
- equiframe/_comparison_io.py +161 -0
- equiframe/_dataset_provenance.py +146 -0
- equiframe/_decimal.py +22 -0
- equiframe/_diff_capture.py +433 -0
- equiframe/_doctor.py +123 -0
- equiframe/_document_io.py +61 -0
- equiframe/_documents.py +79 -0
- equiframe/_duckdb_transport.py +149 -0
- equiframe/_error_reporting.py +52 -0
- equiframe/_first_use.py +102 -0
- equiframe/_path_compat.py +26 -0
- equiframe/_physical.py +133 -0
- equiframe/_r_review.R +308 -0
- equiframe/_regular_io.py +167 -0
- equiframe/_report_format_v1.py +298 -0
- equiframe/_report_io.py +591 -0
- equiframe/_stability_inventory.py +1421 -0
- equiframe/_timezones.py +257 -0
- equiframe/_vendor/cyclonedx/LICENSE +201 -0
- equiframe/_vendor/cyclonedx/PROVENANCE.md +18 -0
- equiframe/_vendor/cyclonedx/bom-1.6.schema.json +5673 -0
- equiframe/_vendor/cyclonedx/jsf-0.82.schema.json +240 -0
- equiframe/_vendor/cyclonedx/spdx.schema.json +712 -0
- equiframe/adapters.py +454 -0
- equiframe/assertion_types.py +122 -0
- equiframe/assertions.py +271 -0
- equiframe/benchmark.py +101 -0
- equiframe/bundle.py +240 -0
- equiframe/cli.py +693 -0
- equiframe/comparison.py +937 -0
- equiframe/comparison_report.py +660 -0
- equiframe/comparison_types.py +257 -0
- equiframe/compatibility.py +546 -0
- equiframe/contracts.py +879 -0
- equiframe/datasets.py +1301 -0
- equiframe/decision.py +34 -0
- equiframe/destinations.py +295 -0
- equiframe/detector_types.py +431 -0
- equiframe/detectors.py +389 -0
- equiframe/diff.py +192 -0
- equiframe/diff_contracts.py +523 -0
- equiframe/docs/adoption.md +329 -0
- equiframe/docs/api.md +534 -0
- equiframe/docs/arquitecto.md +143 -0
- equiframe/docs/choosing-api.md +84 -0
- equiframe/docs/cientifico.md +180 -0
- equiframe/docs/compatibility.md +254 -0
- equiframe/docs/contributing.md +171 -0
- equiframe/docs/dependencies.md +237 -0
- equiframe/docs/eda.md +166 -0
- equiframe/docs/extending.md +158 -0
- equiframe/docs/fast-ci.md +52 -0
- equiframe/docs/first-use.md +78 -0
- equiframe/docs/index.md +142 -0
- equiframe/docs/ingestion.md +145 -0
- equiframe/docs/inicio.md +129 -0
- equiframe/docs/installed-private.md +97 -0
- equiframe/docs/journeys.md +362 -0
- equiframe/docs/lectura-conversion.md +211 -0
- equiframe/docs/licensing.md +17 -0
- equiframe/docs/maintenance.md +233 -0
- equiframe/docs/migration-ir.md +333 -0
- equiframe/docs/option-audit.md +45 -0
- equiframe/docs/outcome-gates.md +134 -0
- equiframe/docs/performance.md +263 -0
- equiframe/docs/piloto-simulado.md +56 -0
- equiframe/docs/quickstart.md +156 -0
- equiframe/docs/r_review.md +212 -0
- equiframe/docs/recipes.md +248 -0
- equiframe/docs/releasing.md +183 -0
- equiframe/docs/security.md +218 -0
- equiframe/docs/semantics.md +274 -0
- equiframe/docs/sqlite-snapshots.md +262 -0
- equiframe/docs/universal-sources.md +49 -0
- equiframe/docs/universalidad-cinco-pasos.md +107 -0
- equiframe/docs/upgrading.md +538 -0
- equiframe/duckdb_capture.py +410 -0
- equiframe/eda/__init__.py +36 -0
- equiframe/eda/__main__.py +3 -0
- equiframe/eda/_backend.py +612 -0
- equiframe/eda/_inventory.py +49 -0
- equiframe/eda/_paths.py +49 -0
- equiframe/eda/_report.py +291 -0
- equiframe/eda/api.py +535 -0
- equiframe/eda/cli.py +102 -0
- equiframe/eda/models.py +239 -0
- equiframe/errors.py +83 -0
- equiframe/evidence.py +375 -0
- equiframe/examples/integrations/eda_generic.py +60 -0
- equiframe/examples/integrations/outcome_gates.py +94 -0
- equiframe/examples/integrations/sqlite_snapshot.py +246 -0
- equiframe/examples/integrations/sqlite_snapshot_demo.py +226 -0
- equiframe/examples/integrations/universal_first_use.py +296 -0
- equiframe/examples/journeys/README.md +31 -0
- equiframe/examples/journeys/__init__.py +1 -0
- equiframe/examples/journeys/a_pandas_refactor.py +88 -0
- equiframe/examples/journeys/b_native_migration.py +181 -0
- equiframe/examples/journeys/c_retail_etl.py +460 -0
- equiframe/examples/journeys/common.py +136 -0
- equiframe/examples/journeys/d_financial_reconciliation.py +96 -0
- equiframe/examples/journeys/e_telemetry.py +135 -0
- equiframe/examples/journeys/f_data_science_preparation.py +84 -0
- equiframe/examples/journeys/g_external_snapshots.py +197 -0
- equiframe/examples/journeys/h_portable_ci.py +129 -0
- equiframe/examples/journeys/requirements.lock +249 -0
- equiframe/examples/journeys/verify_journeys.py +117 -0
- equiframe/examples/load_convert_compare.py +85 -0
- equiframe/execution.py +355 -0
- equiframe/execution_types.py +177 -0
- equiframe/ingestion.py +744 -0
- equiframe/local.py +126 -0
- equiframe/migration/__init__.py +94 -0
- equiframe/migration/_physical.py +8 -0
- equiframe/migration/backends/_timestamp_transport.py +109 -0
- equiframe/migration/backends/duckdb.py +651 -0
- equiframe/migration/backends/duckdb_decimal.py +125 -0
- equiframe/migration/backends/duckdb_time.py +87 -0
- equiframe/migration/backends/pandas.py +544 -0
- equiframe/migration/backends/polars.py +915 -0
- equiframe/migration/backends/polars_decimal.py +231 -0
- equiframe/migration/io.py +198 -0
- equiframe/migration/ports.py +96 -0
- equiframe/migration/runner.py +545 -0
- equiframe/migration/runner_types.py +405 -0
- equiframe/migration/types.py +354 -0
- equiframe/migration/validation.py +619 -0
- equiframe/normalization.py +358 -0
- equiframe/pipeline.py +274 -0
- equiframe/pipeline_types.py +247 -0
- equiframe/ports.py +39 -0
- equiframe/preprocessing.py +110 -0
- equiframe/profile_types.py +343 -0
- equiframe/profiles.py +447 -0
- equiframe/py.typed +0 -0
- equiframe/r_review.py +706 -0
- equiframe/reduction.py +518 -0
- equiframe/registry.py +121 -0
- equiframe/report_rendering.py +366 -0
- equiframe/report_types.py +294 -0
- equiframe/reporting.py +26 -0
- equiframe/rule_types.py +178 -0
- equiframe/rules.py +819 -0
- equiframe/schemas/r-execution-binding-1.0.schema.json +46 -0
- equiframe/schemas/r-review-binding-1.0.schema.json +28 -0
- equiframe/schemas/r-review-options-1.0.schema.json +38 -0
- equiframe/schemas/r-review-result-1.0.schema.json +207 -0
- equiframe/schemas/reviewed-decision-1.0.schema.json +3394 -0
- equiframe/serialization.py +152 -0
- equiframe/snapshot.py +296 -0
- equiframe/sources.py +283 -0
- equiframe/tables.py +459 -0
- equiframe/types.py +71 -0
- equiframe/values.py +252 -0
- equiframe/verification_request.py +35 -0
- equiframe/verify.py +799 -0
- equiframe/verify_types.py +255 -0
- equiframe/workflow.py +510 -0
- equiframe/workflow_request.py +38 -0
- equiframe-0.12.4.dist-info/METADATA +268 -0
- equiframe-0.12.4.dist-info/RECORD +170 -0
- equiframe-0.12.4.dist-info/WHEEL +4 -0
- equiframe-0.12.4.dist-info/entry_points.txt +3 -0
- equiframe-0.12.4.dist-info/licenses/LICENSE +21 -0
- equiframe-0.12.4.dist-info/licenses/THIRD_PARTY_NOTICES.md +42 -0
- equiframe-0.12.4.dist-info/licenses/tools/cyclonedx/LICENSE +201 -0
- equiframe-0.12.4.dist-info/licenses/tools/cyclonedx/PROVENANCE.md +18 -0
equiframe/_timezones.py
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
"""Private IANA loader: the locked tzdata package is authoritative on every host."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
import struct
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
from functools import lru_cache
|
|
9
|
+
from hashlib import sha256
|
|
10
|
+
from importlib.resources import files
|
|
11
|
+
from itertools import pairwise
|
|
12
|
+
from typing import Literal
|
|
13
|
+
from zoneinfo import ZoneInfo
|
|
14
|
+
|
|
15
|
+
# This complete TZif resource has no transitions, one zero-offset type and the
|
|
16
|
+
# fixed <-00>0 continuation. Factory's declared name is retained by the timestamp
|
|
17
|
+
# codec; only the native localization kernel uses its equivalent UTC offset.
|
|
18
|
+
_FACTORY_FIXED_ZERO_SHA256 = "d32b579ed0a7427316bea260b9ee2675451046bd58c57c679c24f2671860af76"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def native_timezone_key(key: str) -> str:
|
|
22
|
+
"""Select a native kernel name, preserving the contract's timezone identity.
|
|
23
|
+
|
|
24
|
+
Chrono/ICU need not recognize IANA's Factory name. Its exact installed TZif
|
|
25
|
+
semantics can use their UTC kernel, without a Python row callback or a change
|
|
26
|
+
to output metadata. A different resource must be reviewed before that mapping
|
|
27
|
+
is used; other named zones always use their own native kernel.
|
|
28
|
+
"""
|
|
29
|
+
if key != "Factory":
|
|
30
|
+
return key
|
|
31
|
+
resource = files("tzdata.zoneinfo").joinpath("Factory").read_bytes()
|
|
32
|
+
if sha256(resource).hexdigest() != _FACTORY_FIXED_ZERO_SHA256:
|
|
33
|
+
raise ValueError("Factory timezone resource differs from the verified fixed-zero TZif")
|
|
34
|
+
return "UTC"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
@lru_cache(maxsize=128)
|
|
38
|
+
def timezone(key: str) -> ZoneInfo:
|
|
39
|
+
# Resolve only zone names, never arbitrary paths or other package resources.
|
|
40
|
+
if re.fullmatch(r"[A-Za-z0-9_+-]+(?:/[A-Za-z0-9_+-]+)*", key) is None:
|
|
41
|
+
raise ValueError("unknown IANA time zone: " + key)
|
|
42
|
+
try:
|
|
43
|
+
with files("tzdata.zoneinfo").joinpath(*key.split("/")).open("rb") as stream:
|
|
44
|
+
return ZoneInfo.from_file(stream, key=key)
|
|
45
|
+
except (OSError, ValueError) as exc:
|
|
46
|
+
raise ValueError("unknown IANA time zone: " + key) from exc
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@dataclass(frozen=True)
|
|
50
|
+
class _TimezoneRule:
|
|
51
|
+
kind: Literal["M", "J", "N"]
|
|
52
|
+
values: tuple[int, ...]
|
|
53
|
+
seconds: int = 7200
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
@dataclass(frozen=True)
|
|
57
|
+
class _TimezoneContinuation:
|
|
58
|
+
standard: int
|
|
59
|
+
daylight: int | None = None
|
|
60
|
+
start: _TimezoneRule | None = None
|
|
61
|
+
end: _TimezoneRule | None = None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@dataclass(frozen=True)
|
|
65
|
+
class _TimezoneData:
|
|
66
|
+
transitions: tuple[int, ...]
|
|
67
|
+
interval_offsets: tuple[int, ...]
|
|
68
|
+
offsets: tuple[int, ...]
|
|
69
|
+
continuation: _TimezoneContinuation | None
|
|
70
|
+
resource_sha256: str
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _require_tzif(condition: bool, message: str) -> None:
|
|
74
|
+
if not condition:
|
|
75
|
+
raise ValueError(message)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _tzif_clock(value: str, *, rule_clock: bool = False) -> int:
|
|
79
|
+
match = re.fullmatch(r"([+-]?)([0-9]{1,3})(?::([0-9]{1,2})(?::([0-9]{1,2}))?)?", value)
|
|
80
|
+
if match is None:
|
|
81
|
+
raise ValueError("Invalid TZif POSIX clock or offset")
|
|
82
|
+
sign, hours, minutes, seconds = match.groups()
|
|
83
|
+
hour, minute, second = int(hours), int(minutes or 0), int(seconds or 0)
|
|
84
|
+
_require_tzif(
|
|
85
|
+
hour <= (167 if rule_clock else 24) and minute < 60 and second < 60,
|
|
86
|
+
"TZif POSIX clock or offset exceeds supported bounds",
|
|
87
|
+
)
|
|
88
|
+
return (-1 if sign == "-" else 1) * (hour * 3600 + minute * 60 + second)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def _tzif_rule(value: str) -> _TimezoneRule:
|
|
92
|
+
parts = value.split("/")
|
|
93
|
+
_require_tzif(1 <= len(parts) <= 2, "Invalid TZif POSIX rule clock")
|
|
94
|
+
day = parts[0]
|
|
95
|
+
seconds = _tzif_clock(parts[1], rule_clock=True) if len(parts) == 2 else 7200
|
|
96
|
+
if day.startswith("M"):
|
|
97
|
+
match = re.fullmatch(r"M([0-9]{1,2})\.([1-5])\.([0-6])", day)
|
|
98
|
+
if match is None:
|
|
99
|
+
raise ValueError("Invalid TZif month/week/weekday rule")
|
|
100
|
+
month, week, weekday = map(int, match.groups())
|
|
101
|
+
_require_tzif(1 <= month <= 12, "Invalid TZif rule month")
|
|
102
|
+
return _TimezoneRule("M", (month, week, weekday), seconds)
|
|
103
|
+
if day.startswith("J"):
|
|
104
|
+
_require_tzif(re.fullmatch(r"J[0-9]{1,3}", day) is not None, "Invalid TZif Julian rule")
|
|
105
|
+
number = int(day[1:])
|
|
106
|
+
_require_tzif(1 <= number <= 365, "Invalid TZif Julian day")
|
|
107
|
+
return _TimezoneRule("J", (number,), seconds)
|
|
108
|
+
_require_tzif(re.fullmatch(r"[0-9]{1,3}", day) is not None, "Invalid TZif Julian rule")
|
|
109
|
+
number = int(day)
|
|
110
|
+
_require_tzif(0 <= number <= 365, "Invalid TZif zero-based Julian day")
|
|
111
|
+
return _TimezoneRule("N", (number,), seconds)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def _tzif_continuation(value: str) -> _TimezoneContinuation | None:
|
|
115
|
+
if not value:
|
|
116
|
+
return None
|
|
117
|
+
abbreviation = r"(?:[A-Za-z]{3,}|<[-+A-Za-z0-9]{3,}>)"
|
|
118
|
+
number = r"[+-]?[0-9]{1,3}(?::[0-9]{1,2}(?::[0-9]{1,2})?)?"
|
|
119
|
+
pattern = rf"({abbreviation})({number})(?:({abbreviation})({number})?)?(?:,([^,]+),([^,]+))?"
|
|
120
|
+
match = re.fullmatch(pattern, value)
|
|
121
|
+
if match is None:
|
|
122
|
+
raise ValueError("Invalid TZif POSIX continuation")
|
|
123
|
+
_, standard_text, daylight_name, daylight_text, start, end = match.groups()
|
|
124
|
+
standard = -_tzif_clock(standard_text)
|
|
125
|
+
_require_tzif(abs(standard) <= 86400, "TZif UTC offset exceeds one day")
|
|
126
|
+
if daylight_name is None:
|
|
127
|
+
_require_tzif(start is None and end is None, "Fixed TZif continuation has transition rules")
|
|
128
|
+
return _TimezoneContinuation(standard)
|
|
129
|
+
if start is None or end is None:
|
|
130
|
+
raise ValueError("TZif daylight continuation requires explicit rules")
|
|
131
|
+
daylight = -_tzif_clock(daylight_text) if daylight_text is not None else standard + 3600
|
|
132
|
+
_require_tzif(abs(daylight) <= 86400, "TZif UTC offset exceeds one day")
|
|
133
|
+
return _TimezoneContinuation(standard, daylight, _tzif_rule(start), _tzif_rule(end))
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
@lru_cache(maxsize=128)
|
|
137
|
+
def _parse_timezone_data(raw: bytes) -> _TimezoneData:
|
|
138
|
+
"""Read bounded POSIX TZif metadata; never evaluate code from a resource."""
|
|
139
|
+
_require_tzif(len(raw) <= 1024**2, "TZif metadata exceeds resource size limit")
|
|
140
|
+
|
|
141
|
+
def header(position: int) -> tuple[int, tuple[int, int, int, int, int, int]]:
|
|
142
|
+
_require_tzif(
|
|
143
|
+
raw[position : position + 4] == b"TZif" and len(raw) >= position + 44,
|
|
144
|
+
"Invalid or truncated TZif header",
|
|
145
|
+
)
|
|
146
|
+
version = raw[position + 4]
|
|
147
|
+
_require_tzif(version in (0, ord("2"), ord("3"), ord("4")), "Unsupported TZif version")
|
|
148
|
+
_require_tzif(
|
|
149
|
+
not any(raw[position + 5 : position + 20]), "Nonzero TZif reserved header bytes"
|
|
150
|
+
)
|
|
151
|
+
ut, standard, leaps, times, types, chars = struct.unpack_from(">6I", raw, position + 20)
|
|
152
|
+
counts = (int(ut), int(standard), int(leaps), int(times), int(types), int(chars))
|
|
153
|
+
_require_tzif(
|
|
154
|
+
1 <= types <= 256 and ut in (0, types) and standard in (0, types),
|
|
155
|
+
"Invalid TZif type counts",
|
|
156
|
+
)
|
|
157
|
+
_require_tzif(leaps == 0, "Leap-adjusted TZif does not define POSIX timestamp metadata")
|
|
158
|
+
return version, counts
|
|
159
|
+
|
|
160
|
+
def block_size(counts: tuple[int, int, int, int, int, int], width: int) -> int:
|
|
161
|
+
ut, standard, leaps, times, types, chars = counts
|
|
162
|
+
return width * times + times + 6 * types + chars + (width + 4) * leaps + standard + ut
|
|
163
|
+
|
|
164
|
+
version, counts = header(0)
|
|
165
|
+
position, width = 44, 4
|
|
166
|
+
if version:
|
|
167
|
+
next_header = position + block_size(counts, width)
|
|
168
|
+
second_version, counts = header(next_header)
|
|
169
|
+
_require_tzif(second_version == version, "TZif header versions differ")
|
|
170
|
+
position, width = next_header + 44, 8
|
|
171
|
+
end = position + block_size(counts, width)
|
|
172
|
+
_require_tzif(end <= len(raw), "Truncated TZif data block")
|
|
173
|
+
ut, standard, _, times, types, chars = counts
|
|
174
|
+
transitions = tuple(
|
|
175
|
+
int(value)
|
|
176
|
+
for value in struct.unpack_from(
|
|
177
|
+
">" + str(times) + ("q" if width == 8 else "l"), raw, position
|
|
178
|
+
)
|
|
179
|
+
)
|
|
180
|
+
_require_tzif(
|
|
181
|
+
all(first < second for first, second in pairwise(transitions)),
|
|
182
|
+
"Unsorted TZif transitions",
|
|
183
|
+
)
|
|
184
|
+
position += width * times
|
|
185
|
+
indices = raw[position : position + times]
|
|
186
|
+
position += times
|
|
187
|
+
records: list[tuple[int, int, int]] = []
|
|
188
|
+
for index in range(types):
|
|
189
|
+
offset, daylight, abbreviation = struct.unpack_from(">lBB", raw, position + 6 * index)
|
|
190
|
+
records.append((int(offset), int(daylight), int(abbreviation)))
|
|
191
|
+
_require_tzif(
|
|
192
|
+
all(
|
|
193
|
+
abs(offset) <= 86400 and daylight in (0, 1) and abbreviation < chars
|
|
194
|
+
for offset, daylight, abbreviation in records
|
|
195
|
+
),
|
|
196
|
+
"Invalid TZif offset or type record",
|
|
197
|
+
)
|
|
198
|
+
_require_tzif(all(index < types for index in indices), "TZif transition type outside table")
|
|
199
|
+
abbreviations = raw[position + 6 * types : position + 6 * types + chars]
|
|
200
|
+
_require_tzif(
|
|
201
|
+
all(abbreviations.find(b"\x00", index) >= 0 for _, _, index in records),
|
|
202
|
+
"Unterminated TZif designation",
|
|
203
|
+
)
|
|
204
|
+
indicators = position + 6 * types + chars
|
|
205
|
+
standard_flags = raw[indicators : indicators + standard] if standard else bytes(types)
|
|
206
|
+
ut_flags = raw[indicators + standard : indicators + standard + ut] if ut else bytes(types)
|
|
207
|
+
_require_tzif(
|
|
208
|
+
all(value in (0, 1) for value in (*standard_flags, *ut_flags))
|
|
209
|
+
and all(
|
|
210
|
+
not universal or wall_standard
|
|
211
|
+
for universal, wall_standard in zip(ut_flags, standard_flags, strict=True)
|
|
212
|
+
),
|
|
213
|
+
"Invalid TZif standard/UT indicators",
|
|
214
|
+
)
|
|
215
|
+
# RFC 9636 assigns time type 0 before the first transition. Explicit UTC
|
|
216
|
+
# transition intervals retain historical second offsets and date-line jumps.
|
|
217
|
+
offsets = (records[0][0], *(records[index][0] for index in indices))
|
|
218
|
+
footer = raw[end:]
|
|
219
|
+
if version:
|
|
220
|
+
_require_tzif(
|
|
221
|
+
footer.startswith(b"\n") and footer.endswith(b"\n") and footer.count(b"\n") == 2,
|
|
222
|
+
"Invalid TZif continuation framing",
|
|
223
|
+
)
|
|
224
|
+
continuation = _tzif_continuation(footer[1:-1].decode("ascii"))
|
|
225
|
+
else:
|
|
226
|
+
_require_tzif(not footer, "Unexpected TZif v1 trailing data")
|
|
227
|
+
continuation = None
|
|
228
|
+
possible = set(offsets)
|
|
229
|
+
if continuation is not None:
|
|
230
|
+
possible.add(continuation.standard)
|
|
231
|
+
if continuation.daylight is not None:
|
|
232
|
+
possible.add(continuation.daylight)
|
|
233
|
+
return _TimezoneData(
|
|
234
|
+
transitions, offsets, tuple(sorted(possible)), continuation, sha256(raw).hexdigest()
|
|
235
|
+
)
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def _timezone_resource(key: str) -> bytes:
|
|
239
|
+
if re.fullmatch(r"[A-Za-z0-9_+-]+(?:/[A-Za-z0-9_+-]+)*", key) is None:
|
|
240
|
+
raise ValueError("unknown IANA time zone: " + key)
|
|
241
|
+
try:
|
|
242
|
+
return files("tzdata.zoneinfo").joinpath(*key.split("/")).read_bytes()
|
|
243
|
+
except (OSError, ValueError) as exc:
|
|
244
|
+
raise ValueError("unknown IANA time zone: " + key) from exc
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
def _timezone_data(key: str) -> _TimezoneData:
|
|
248
|
+
# Keep the existing reviewed Factory resource condition. Other keys use
|
|
249
|
+
# their complete installed data, including their own historical transitions.
|
|
250
|
+
raw = _timezone_resource(key)
|
|
251
|
+
if key == "Factory" and sha256(raw).hexdigest() != _FACTORY_FIXED_ZERO_SHA256:
|
|
252
|
+
raise ValueError("Factory timezone resource differs from the verified fixed-zero TZif")
|
|
253
|
+
return _parse_timezone_data(raw)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def _timezone_resource_hash(key: str) -> str:
|
|
257
|
+
return sha256(_timezone_resource(key)).hexdigest()
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright OWASP Foundation
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Vendored CycloneDX schema
|
|
2
|
+
|
|
3
|
+
These unmodified JSON schemas are from the official CycloneDX specification,
|
|
4
|
+
tag `1.6` (retrieved 2026-10-06). JSON Schema draft-07 validates CycloneDX 1.6;
|
|
5
|
+
this is a deliberate fixed schema version, not a claim about the newest release.
|
|
6
|
+
|
|
7
|
+
Source: https://github.com/CycloneDX/specification/tree/1.6/schema
|
|
8
|
+
|
|
9
|
+
- `bom-1.6.schema.json`: SHA-256 `3e92dddbc30cf7f6a02b80f0942b1a4cfd4fb1c26f1dfc4310afa9d613cafb93`
|
|
10
|
+
- `spdx.schema.json`: SHA-256 `baa9d3bd1ed57b6751b0887edead6b5063ff53ff7429cf85d476c6c94af0166e`
|
|
11
|
+
- `jsf-0.82.schema.json`: SHA-256 `8bae002c25e723db7ee1f26afde680ae1a2b1a8f6b4b4b0fd65dc3becb090aae`
|
|
12
|
+
|
|
13
|
+
The Apache-2.0 upstream LICENSE is copied alongside these schemas. This applies
|
|
14
|
+
to the schemas, and does not assign a license to EquiFrame. Local validation
|
|
15
|
+
checks these hashes and uses a closed schema registry without network retrieval.
|
|
16
|
+
|
|
17
|
+
Updating requires explicit schema review, updating the digest pins and tests,
|
|
18
|
+
and regenerating inventory evidence. Never relax the schema to accept a BOM.
|