Skip to main content

Hightime Python API

Project description

Hightime

Overview

Hightime allows for up to yoctosecond precision replacements for the datetime datetime and timedelta types.

Installation

Hightime can be installed by cloning the master branch and then in a command line in the directory of setup.py run:

pip install --pre .

Or by installing from PyPI using:

pip install hightime

Examples

>>> from hightime import datetime
>>> from hightime import timedelta

>>> high_noon = datetime(
...   year=1952,
...   month=7,
...   day=24,
...   hour=12,
...   minute=0,
...   second=30,
...   microsecond=0,
... )

>>> print(high_noon)
1952-07-24 12:00:30

>>> hesitation = timedelta(microseconds=10, femtoseconds=203456)

>>> print(hesitation)
0:00:00.000010000203456

>>> reaction = high_noon + hesitation

>>> print(reaction)
1952-07-24 12:00:30.000010000203456

>>> print(high_noon + high_noon)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'datetime' and 'datetime'

>>> print(hesitation * 2)
0:00:00.000020000406912

See the readthedocs page for more detailed examples and documentation.

License

Hightime is licensed under an MIT-style license.

See LICENSE for details about how hightime is licensed.

Other incorporated projects may be licensed under different licenses. All licenses allow for non-commercial and commercial use.

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

hightime-1.0.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

hightime-1.0.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file hightime-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for hightime-1.0.0.tar.gz
Algorithm Hash digest
SHA256 480d2a03e2c3ed44916d2406d40ab6d10a276ed7f101619fc3fcc1e00c46aacf
MD5 cde2acb8e9410904eb435b337e2643fe
BLAKE2b-256 25373466f0022ea7879f48c35b7869b83ccc76ed365f2e12f4cf48555252d76a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hightime-1.0.0.tar.gz:

Publisher: publish.yml on ni/hightime

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

File details

Details for the file hightime-1.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for hightime-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba86d42976c36451b14e11c736e61f296f9f00dbb79c8488e18d70c6b2dbb395
MD5 05d7a8c8bcc6f1a1870b706118b4cff8
BLAKE2b-256 0af93b018f6eec88a35f3cce2103015cb1918b66cc8316ff5c2510ff1c19cb26

See more details on using hashes here.

Provenance

The following attestation bundles were made for hightime-1.0.0-py3-none-any.whl:

Publisher: publish.yml on ni/hightime

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