MCPcopy Create free account
hub / github.com/dateutil/dateutil / write_metadata

Function write_metadata

tests/resources/update_tzif.py:202–209  ·  view source on GitHub ↗

Record which tzdb release the data files were generated from.

(json_outfile: pathlib.Path, tzdb_dir: pathlib.Path)

Source from the content-addressed store, hash-verified

200
201
202def write_metadata(json_outfile: pathlib.Path, tzdb_dir: pathlib.Path) -> None:
203 """Record which tzdb release the data files were generated from."""
204 version = (tzdb_dir / "version").read_text().strip()
205 logging.info("Generated data from tzdb version %s", version)
206 metadata = {"tzdata_version": version}
207 json_outfile.write_text(
208 json.dumps(metadata, sort_keys=True, indent=2) + "\n"
209 )
210
211
212def read_required_keys(loc: pathlib.Path) -> frozenset[str]:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected