Rust-powered collection of financial functions.
Project description
PyXIRR
Rust-powered collection of financial functions.
Installation
pip install pyxirr
Usage
xirr
Function signature:
# You have two options:
# 1. Two iterables for dates and amounts
# 2. Single iterable of tuples (date, amount)
DateLike = Union[datetime.date, datetime.datetime]
Amount = Union[int, foat, Decimal]
def xirr(
dates: Union[Iterable[DateLike], Iterable[Tuple[DateLike, Amount]]]
amounts Optional[Iterable[Amount]] = None
guess: Optional[float] = None
)
Example:
from datetime import date
from pyxirr import xirr
dates = [date(2020, 1, 1), date(2020, 2, 1)]
amounts = [-100, 125]
xirr(dates, amounts)
# list of tuples is also possible:
xirr(zip(dates, amounts))
xnpv
Function signature:
# similar to xirr: iterable of tuples or two iterables
def xnpv(
rate: float,
dates: Union[Iterable[DateLike], Iterable[Tuple[DateLike, Amount]]]
amounts Optional[Iterable[Amount]] = None
)
Example:
xnpv(0.1, dates, amounts)
xnpv(0.1, zip(dates, amounts))
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
pyxirr-0.2.0.tar.gz
(6.5 kB
view details)
Built Distributions
File details
Details for the file pyxirr-0.2.0.tar.gz
.
File metadata
- Download URL: pyxirr-0.2.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a941c4b36446f42d98ba487660a42c69c012b7a0f5eb3e57537d70ecd4b58d |
|
MD5 | e07ad9182a1cb528c02cfff978b2718a |
|
BLAKE2b-256 | 4d64ba0f63e1e419537d433def4cdbe2151805fddc111fbcad5ec0e5415ab81c |
File details
Details for the file pyxirr-0.2.0-cp39-cp39-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pyxirr-0.2.0-cp39-cp39-manylinux2010_x86_64.whl
- Upload date:
- Size: 174.1 kB
- Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c796932e5ec958a4ee55f29bfd8e96238288201dc038d4abc50fb6f41c711adc |
|
MD5 | 1104cbd69f3a0f7055dec6b7ca2ec940 |
|
BLAKE2b-256 | 9cf90581944916b737f17f5dd13e3ef9b358ecd016e581467f9717076d09faa8 |
File details
Details for the file pyxirr-0.2.0-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pyxirr-0.2.0-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 174.0 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3174cad970fc22b74c3b7edf383cda364537ccbf9a6e5184baa31de365c8c39 |
|
MD5 | 5c6a6adadf90c2a0d5c61a356b8cfeee |
|
BLAKE2b-256 | b88ebef87ae2b7a9363e2151e5c2d2f27e9757ca00c22916af9c78fed1501ae2 |
File details
Details for the file pyxirr-0.2.0-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pyxirr-0.2.0-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 173.9 kB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1fc24b4b569fb408fed78876e34de214f3f0be37f8de4a0de8611f9cbd63ba9 |
|
MD5 | 26cf74a141f73391b8a3660cf66b42a2 |
|
BLAKE2b-256 | 3d1be0b4b5470ecc6cc4ed1d3bf6b0dde64da64aa78e4d996352fec4c3b0cdca |
File details
Details for the file pyxirr-0.2.0-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pyxirr-0.2.0-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 173.8 kB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.10.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0697b84ef769e278a60e497cfc954d79fd7e4079e2aa12fc1bd773f700c8c4cb |
|
MD5 | e931f9259a4025b471089e9656794167 |
|
BLAKE2b-256 | e6f9e04e5eac42fc066e63ef91553ae88d5f7d0e49a92c43ed52d41c70584529 |