Skip to content

Digital-Defiance/brightdate-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

BrightDate python PyPi library

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages