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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

hightime-0.2.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hightime-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for hightime-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5109a449bb3a75dbf305147777de71634c91b943d47cfbee18ed2f34a8307e0b
MD5 743b5065767d56692d4e897048ece0cc
BLAKE2b-256 6bf679c14ef38f75a2a554ac4e0c285d6c23a142fc37bae6633ef46140c61e44

See more details on using hashes here.

Supported by

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