Skip to content

Commit

Permalink
update proj infos
Browse files Browse the repository at this point in the history
  • Loading branch information
tfeldmann committed Jul 13, 2023
1 parent 573f663 commit c8857c7
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 2 deletions.
21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) Thomas Feldmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# days360

[![Tests](https://github.com/tfeldmann/days360/actions/workflows/tests.yml/badge.svg)](https://github.com/tfeldmann/days360/actions/workflows/tests.yml)
<a href="https://pypi.org/project/days360/">
<img src="https://img.shields.io/pypi/v/days360" title="PyPI Version">
</a>

Calculates the days between two dates based on the 360-day year.

- Implementation of Excel's (or Number's) `DAYS360` / `TAGE360` formula in python.
- Both EU and US methods of calculation are supported, with optional Excel bug compatibility.

## Installation

```
pip install days360
```

## Usage

```python
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
- https://www.isda.org/2008/12/22/30-360-day-count-conventions/)
- https://web.archive.org/web/20160425044113/http://www.nyift.com/lesson/day-count-convention-bonds/
- https://github.com/miradulo/isda_daycounters

## 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
17 changes: 15 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
[tool.poetry]
name = "days360"
version = "1.0.0"
description = "Calculates the days between two dates based on a 360 day year."
description = "Excel's DAYS360() formula for python."
authors = ["Thomas Feldmann <mail@tfeldmann.de>"]
license = "MIT"
readme = "Readme.md"
readme = "README.md"
repository = "https://github.com/tfeldmann/organize"
keywords = [
"excel",
"formula",
"finance",
"days360",
]
classifiers = [
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
"Development Status :: 5 - Production/Stable",
"Operating System :: OS Independent",
"Typing :: Typed",
]

[tool.poetry.dependencies]
python = "^3.8"
Expand Down

0 comments on commit c8857c7

Please sign in to comment.