This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

awaredatetime

Module providing a timezone aware datetime.datetime compatible object.
Supports CPython 2.6 - 3.5 and PyPy.

Features

  • Drop-in replacement for datetime.datetime
  • Simple implementation that leverages the built-in datetime module as much as possible
  • Excellent test coverage

Motivation

datetime.datetime objects aren’t aware by default.
New projects should always use timezone aware datetime.datetime objects, but the Python standard library doesn’t make that easy. AwareDatetime is here to help!

You may also have existing code that needs to become timezone aware and migrating code to become timezone aware is tricky.
Using AwareDatetime will help you track what code has been migrated to support timezone.

awaredatetime.AwareDatetime

A drop-in replacement for datetime.datetime that always provide timezone aware objects.

Example Usage

>>> from awaredatetime import AwareDatetime
>>> AwareDatetime(2016, 1, 1)
AwareDatetime(2016, 1, 1, 0, 0, tzinfo=<UTC>)
>>> import datetime
>>> AwareDatetime.from_datetime(datetime.datetime(2016, 1, 1))
AwareDatetime(2016, 1, 1, 0, 0, tzinfo=<UTC>)
>>>

awaredatetime.AwareTime

Not implemented since times with a timezone don’t make sense.
e.g. What’s the expected behavior for coverting 24:00:00+00:00 to positive UTC offset?

Dependencies

The only dependency is pytz. We recommend that you use the latest version of pytz, but this package will not force that upon you.

Migrating Existing Code

Similar work

  • datetime_tz - Another timezone aware drop-in replacement for the datetime module, but overrides more datetime behavior
  • arrow - An API-compatible re-write of the datetime module

Contributing

Guidelines

  • Do not change the CHANGELOG file or __version__ in awaredatetime/__init__.py. This is the responsibility of the repo and package owners.
  • Before adding a dependency, open an issue to discuss why the dependency is needed.
  • Follow the Google Python Style Guide.

Steps

  1. Setup the development environment

    pip install -U -r requirements.dev.txt
    
  2. Make your changes

  3. Add unittests for your changes

  4. Run tests, which will also check the coding style

    coverage run --source=awaredatetime setup.py test_dev
    
  5. Once tests pass, ensure that your changes have proper test coverage

    coverage html && ls htmlcov/index.html
    
  6. Open a PR

Changelog

0.0.2 (2016-06-20)

  • Change how package versioning is determined

0.0.1 (2016-06-20)

  • Initial commit
    • AwareDatetime is compatible with all known datetime.datetime methods and constants
Release History

Release History

0.0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
awaredatetime-0.0.2-py2.py3-none-any.whl (6.7 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jun 21, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting