Skip to main content

A time library that prioritises clean and safe APIs.

Project description

Welcome to goodtime, a Python date/time library that prioritises safety and correctness.

>>> from goodtime import *
>>> Instant.now()
Instant(unix_timestamp_ns=1770029789026987530)
>>> Instant.now() + hours(1)
Instant(unix_timestamp_ns=1770033404038049963)
>>> Instant.now().to_unix_seconds()
1770029824
>>> Instant.from_unix_seconds(1770029824)
Instant(unix_timestamp_ns=1770029824000000000)

Handling of timestamps, durations and human-readable dates and times is notoriously error-prone due to issues with time zones, ambiguous arithmetics, ambiguous units, etc. This is especially true in distributed systems, where interacting systems may be written by multiple teams that did not have shared assumptions about date/time semantics.

The goal of goodtime is to minimise the potential for errors by:

  • using types that have well-defined semantics,
  • preventing ambiguous conversions (e.g. timestamp to integer),
  • providing explicit interfaces to interoperate with non-goodtime code.

See package documentation for more information on provided types, operations, and best practices.

Getting Started

Install goodtime from PyPI using your favourite Python package manager:

$ python -m pip install goodtime
$ poetry add goodtime
$ uv add goodtime

Contributing

We are open to feedback and contributions under the terms of the MIT license. Feel free to open a Github issue or a pull request.

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

goodtime-0.4.1.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

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

goodtime-0.4.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file goodtime-0.4.1.tar.gz.

File metadata

  • Download URL: goodtime-0.4.1.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for goodtime-0.4.1.tar.gz
Algorithm Hash digest
SHA256 06e68ee8a1cdc3a38ede964c5f28efc30a370aed29c07b7fdd805c2ae6bdb185
MD5 13a165824e6322dff6253b6f5e595a50
BLAKE2b-256 6f4c339220af02a3cc8ed42bf41cee7bbbf7348405911885444389710b06c54e

See more details on using hashes here.

Provenance

The following attestation bundles were made for goodtime-0.4.1.tar.gz:

Publisher: python-publish.yml on hades/goodtime

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

File details

Details for the file goodtime-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: goodtime-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for goodtime-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d829069b1fe261b38919ea3b58e892bf8454f249d73fa7044e9914afa2f6601c
MD5 cf6c4c41e94643976c4eaca8fbb08d27
BLAKE2b-256 ac6e9a411d38b9b957153f826e9a4d5adf2f42b47ec8d242837c66ba35ad9f98

See more details on using hashes here.

Provenance

The following attestation bundles were made for goodtime-0.4.1-py3-none-any.whl:

Publisher: python-publish.yml on hades/goodtime

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