Skip to main content

Opinionated wrapper over the built-in ``datetime`` module.

Project description

https://badge.fury.io/py/sickdt.svg

Opinionated wrapper over the built-in datetime module. Exposes a subset of just the right functionality to avoid common gotchas with dates in Python.

Yo, these datetimes are sick!

~anonymous

Features

  • Robust, automated timezone handling.

  • ISO 8601-compliant timestamp strings.

  • Unix epoch seconds.

  • Only depends on Python standard library.

  • Uses built-in data types: datetime, float, str.

Driving Principles

  • A datetime object represents an instant, a particular point in time. A snapshot of the universe. It doesn’t matter what was the timezone, DST mode, the user’s calendar, nor their locale.

  • A datetime on its own isn’t human-readable. If you need to show it to the user, you need to provide the timezone or locale.

  • All datetime objects must be timezone-aware.

  • When in need of string timestamps, use ISO 8601 with milliseconds and Zulu time.

  • When in need of numerical timestamps, use a float for UNIX epoch seconds in UTC.

  • This must be easy to integrate with existing codebase. No custom data types over stdlib.

  • Inspired by the design choices of NSDate.

Similar Projects

  • Arrow. Requires a total buy-in, you have to switch to using their datatypes.

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

sickdt-0.1.0.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

sickdt-0.1.0-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

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