Skip to main content

No description has been added so far.

Project description

Build Status PyPI version License Test Coverage

This is a small python package that wraps useful extension helper methods around the standard library datetime package.

$ pip install datemore

This package extends date and datetime objects with useful methods for:

  • Localizing date and datetime objects

  • Adding and subtracting

  • Generating date ranges

  • Mocking (you cannot mock builtins, so why not use this library in the first place :wink:)

Example:

import datemore.date
sunday = datemore.date.Date(2020, 2, 2)
tuesday = sunday.add_days(2)
passed_days = sunday.range_to(tuesday)
tuesday.native()  # Get the native datetime.date object

Do you want to add new extensions? Go ahead! Contributions are welcome, have a look at CONTRIBUTING.

Development

For detailed instructions see CONTRIBUTING.

Tests

You can run tests with

$ invoke test
$ invoke test --min-coverage=90     # Fail when code coverage is below 90%
$ invoke type-check                 # Run mypy type checks

Linting and formatting

Lint and format the code with

$ invoke format
$ invoke lint

All of this happens when you run invoke pre-commit.

Note

This project is still in the alpha stage and should not be considered production ready.

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

datemore-1.0.1.tar.gz (8.9 kB view hashes)

Uploaded Source

Built Distribution

datemore-1.0.1-py2.py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 2 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