A small pure-python package for time-related utility functions.
Project description
A small pure-python package for utility decorators.
from utilitime.datetime import datetime_to_dateint
from utilitime.dateint import shift_dateint, today_int, dateint_range
start_dateint = datetime_to_dateint(some_dt_obj)
day_after_tomorrow = shift_dateint(today_int, 2)
dateints_to_check = dateint_range(start_dateint, day_after_tomorrow)
1 Installation
Install utilitime with:
pip install utilitime
2 Components
The package is composed of several sub-components, each dedicated to functions dealing with mainly one type of time representation.
2.1 dateint
The dateint format uses integer objects to decipt a specific calendaric day; e.g. 20161225. This components deals with converintg and transforming objects of this type.
2.2 datetime
Utilitu methods for standard dateime.dateime objects.
2.3 time
Utilitu methods for standard dateime.time objects.
2.4 timestamp
The timestamp format uses integer objects to decipt a specific moment in time by seconds (or sometimes milliseconds) since the epoc;h e.g. 1506984924. This components deals with converintg and transforming objects of this type.
2.5 weekday
Utility methods for ordered lists of weekday names.
2.6 TimeInterval
Defines a type corresponding to a time interval between two specific points in time (and not their difference, like datetime.timedelta).
3 Contributing
Package author and current maintainer is Shay Palachy (shay.palachy@gmail.com); You are more than welcome to approach him for help. Contributions are very welcomed.
3.1 Installing for development
Clone:
git clone git@github.com:shaypal5/utilitime.git
Install in development mode with test dependencies:
cd utilitime
pip install -e ".[test]"
3.2 Running the tests
To run the tests, use:
python -m pytest --cov=utilitime
3.3 Adding documentation
This project is documented using the numpy docstring conventions, which were chosen as they are perhaps the most widely-spread conventions that are both supported by common tools such as Sphinx and result in human-readable docstrings (in my personal opinion, of course). When documenting code you add to this project, please follow these conventions.
4 Credits
Created by Shay Palachy (shay.palachy@gmail.com).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file utilitime-0.0.1.tar.gz
.
File metadata
- Download URL: utilitime-0.0.1.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0b39d7d56e6d74505d4aebec12226496bf0f4f168f35328b6b687e0ce5d0068 |
|
MD5 | 3ec36eca1901994160b2ca56f74957f4 |
|
BLAKE2b-256 | 4c5d8e39da0d4bb064053159a296559ed0417afcb23b9db8f18ad6db13ddd41f |