Socket
Socket
Sign inDemoInstall

yearfrac

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

yearfrac

Daycount methods to compute date differences in year units


Maintainers
1

Readme

PyPI version yearfrac

yearfrac

Installation

The yearfrac git repo is available as PyPi package

pip install yearfrac

Usage

Check the examples folder for notebooks.

Functions

  • isaleapyear -- Check if a year is leap year
  • eastersunday -- Determine day and month of an Easter Sunday for a given year
  • jd_to_date and date_to_jd -- Julian Day number conversion
  • act_afb -- Actual/Actual AFB
  • act_isda -- Actual/Actual ISDA
  • d30360e -- 30E/360 ISDA daycount method
  • d30365 -- 30/365 daycount method
  • yearfrac -- Wrapper for all daycount methods

Appendix

Install a virtual environment

python3.7 -m venv .venv
source .venv/bin/activate
pip3 install --upgrade pip
pip3 install -r requirements.txt
pip3 install -r requirements-dev.txt
pip3 install -r requirements-demo.txt

(If your git repo is stored in a folder with whitespaces, then don't use the subfolder .venv. Use an absolute path without whitespaces.)

Python Commands

  • Check syntax: flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g')
  • Run Unit Tests: python -W ignore -m unittest discover
  • Remove .pyc files: find . -type f -name "*.pyc" | xargs rm
  • Remove __pycache__ folders: find . -type d -name "__pycache__" | xargs rm -rf

Publish

# pandoc README.md --from markdown --to rst -s -o README.rst  # RST file is too much trouble
python setup.py sdist 
twine upload -r pypi dist/*

Support

Please open an issue for support.

Contributors

Please contribute using Github Flow. Create a branch, add commits, and open a pull request.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc