Excel's DAYS360() formula for python.
Project description
days360
Calculates the days between two dates based on the 360-day year.
- Implementation of Excel's (or Number's)
DAYS360/TAGE360formula in python. - Both EU and US methods of calculation are supported, with optional Excel bug compatibility.
Installation
pip install days360
Usage
from datetime import date
from days360 import days360
date_a = date(2022, 10, 2)
date_b = date(2023, 11, 30)
# supported methods: "US" (default), "US_NASD", "EU"
days = days360(date_a, date_b, method="US")
print(days) # prints 418
Planned
- ISDA, PSA and SIA methods
Notes and credits
- Implementations are based on https://en.wikipedia.org/wiki/360-day_calendar.
- This library started as a port of this ruby gem: https://github.com/tamaloa/days360/tree/master
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
days360-1.0.2.tar.gz
(3.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file days360-1.0.2.tar.gz.
File metadata
- Download URL: days360-1.0.2.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96d0e4dbd2e398fbd1a9b93b618540a1f3894176dfefcdde4e205f4dfdae6832
|
|
| MD5 |
1b60ac17128cba8a16647c203587c04a
|
|
| BLAKE2b-256 |
97eac9d4bdd10671f97d96c7e700635ac90899be410c454da39ecfbd3ce7e740
|
File details
Details for the file days360-1.0.2-py3-none-any.whl.
File metadata
- Download URL: days360-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.4 Darwin/22.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3bdcce8f3ca2b046f5e63015a878bf56a560fe6fcaae657a399c3d6342232fc
|
|
| MD5 |
bd038fc2a3875fd58b11b1277b52b36c
|
|
| BLAKE2b-256 |
fe47ec18e652c92c06d518f75819e4e09f97b841d19d21879d709c49fa53946c
|