Skip to main content

BrightDate — decimal-SI days since J2000.0 (Python reference slice)

Project description

brightdate-python

Python reference slice for BrightDate — decimal SI days since the J2000.0 UTC label (946_727_935_816 Unix ms → BD 0). Full semantics: specification. Multi-language reference: @brightchain/brightdate.

Repository: Digital-Defiance/brightdate-python

Install

pip install brightdate

BrightVision dev (submodule):

git submodule update --init brightdate-python
pip install -e brightdate-python

Example

from brightdate import J2000_UNIX_MS, bd_from_unix_ms, format_bd_scalar, from_iso, now, to_iso

assert J2000_UNIX_MS == 946_727_935_816
assert abs(from_iso("2000-01-01T11:58:55.816Z")) < 1e-12
print(format_bd_scalar(now()))
print(to_iso(0.0))  # 2000-01-01T11:58:55.816Z

v0.1 scope

Included Planned (npm parity)
Epoch constants, Unix↔BD, now() Leap-second table, TAI↔UTC
format_bd_scalar, millidays, ETC BrightInstant, archival types
parse_bd_bounds (btime stderr) Serialization, astronomy helpers
from_iso / to_iso (UTC label) Leap-second :60 in to_iso

Tests

pip install -e ".[dev]"
pytest -q

Publish

See PUBLISH.md.

Consumers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brightdate-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

brightdate-0.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file brightdate-0.1.0.tar.gz.

File metadata

  • Download URL: brightdate-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for brightdate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7dcd3c3aec2ef5bf6a3e6e03fbe0b6166432093a4bab708929ecc87fce787573
MD5 c3aa7fcc8b25c9950982dddb6057e801
BLAKE2b-256 271f37064bf5a7bec3bf29750d56e03e68720cc681bc4c055a8e0c6834e35261

See more details on using hashes here.

Provenance

The following attestation bundles were made for brightdate-0.1.0.tar.gz:

Publisher: publish.yml on Digital-Defiance/brightdate-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file brightdate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: brightdate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for brightdate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4c48d040c504f8da9c5bf9ec4c762feea358c976bb9824d8be79e3e831b7b8eb
MD5 139460b2d7c6148598de810fcee18b07
BLAKE2b-256 d5916985106c4aeb23c35d41e8b9a3eae80b8371d5344b5288e46a0a00ceb148

See more details on using hashes here.

Provenance

The following attestation bundles were made for brightdate-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Digital-Defiance/brightdate-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page