yearfrac


Nameyearfrac JSON
Version 0.4.8 PyPI version JSON
download
home_pagehttp://github.com/kmedian/yearfrac
SummaryDaycount methods to compute date differences in year units
upload_time2023-02-06 11:29:26
maintainer
docs_urlNone
authorUlf Hamster
requires_python>=3.6
licenseMIT
keywords
VCS
bugtrack_url
requirements numpy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI version](https://badge.fury.io/py/yearfrac.svg)](https://badge.fury.io/py/yearfrac)
[![yearfrac](https://snyk.io/advisor/python/yearfrac/badge.svg)](https://snyk.io/advisor/python/yearfrac)


# yearfrac

## Installation
The `yearfrac` [git repo](http://github.com/kmedian/yearfrac) is available as [PyPi package](https://pypi.org/project/yearfrac)

```
pip install yearfrac
```


## Usage
Check the [examples](https://github.com/kmedian/yearfrac/tree/master/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

```sh
# 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](https://github.com/kmedian/yearfrac/issues/new) for support.


### Contributors
* Adam Groszer [@agroszer](https://github.com/agroszer)
* Emilio Basualdo [@emiliobasualdo](https://github.com/emiliobasualdo)
* Ivan Nesic [@fatkaratekid](https://github.com/fatkaratekid)
* Vinay Gupta [@vinschess](https://github.com/vinschess)
* Ulf Hamster [@ulf1](https://github.com/ulf1)

Please contribute using [Github Flow](https://guides.github.com/introduction/flow/). Create a branch, add commits, and [open a pull request](https://github.com/kmedian/yearfrac/compare/).

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/kmedian/yearfrac",
    "name": "yearfrac",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Ulf Hamster",
    "author_email": "554c46@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ff/39/6d7d62fe0183ab1f50ff6bb4f744c2ddfc788d8ec65a41117808d1e15758/yearfrac-0.4.8.tar.gz",
    "platform": null,
    "description": "[![PyPI version](https://badge.fury.io/py/yearfrac.svg)](https://badge.fury.io/py/yearfrac)\n[![yearfrac](https://snyk.io/advisor/python/yearfrac/badge.svg)](https://snyk.io/advisor/python/yearfrac)\n\n\n# yearfrac\n\n## Installation\nThe `yearfrac` [git repo](http://github.com/kmedian/yearfrac) is available as [PyPi package](https://pypi.org/project/yearfrac)\n\n```\npip install yearfrac\n```\n\n\n## Usage\nCheck the [examples](https://github.com/kmedian/yearfrac/tree/master/examples) folder for notebooks.\n\nFunctions\n\n* `isaleapyear` -- Check if a year is leap year\n* `eastersunday` -- Determine day and month of an Easter Sunday for a given year\n* `jd_to_date` and `date_to_jd` -- Julian Day number conversion\n* `act_afb` -- Actual/Actual AFB\n* `act_isda` -- Actual/Actual ISDA\n* `d30360e` -- 30E/360 ISDA daycount method\n* `d30365` -- 30/365 daycount method\n* `yearfrac` -- Wrapper for all daycount methods\n\n\n## Appendix\n\n### Install a virtual environment\n\n```\npython3.7 -m venv .venv\nsource .venv/bin/activate\npip3 install --upgrade pip\npip3 install -r requirements.txt\npip3 install -r requirements-dev.txt\npip3 install -r requirements-demo.txt\n```\n\n(If your git repo is stored in a folder with whitespaces, then don't use the subfolder `.venv`. Use an absolute path without whitespaces.)\n\n### Python Commands\n* Check syntax: `flake8 --ignore=F401 --exclude=$(grep -v '^#' .gitignore | xargs | sed -e 's/ /,/g')`\n* Run Unit Tests: `python -W ignore -m unittest discover`\n* Remove `.pyc` files: `find . -type f -name \"*.pyc\" | xargs rm`\n* Remove `__pycache__` folders: `find . -type d -name \"__pycache__\" | xargs rm -rf`\n\nPublish\n\n```sh\n# pandoc README.md --from markdown --to rst -s -o README.rst  # RST file is too much trouble\npython setup.py sdist \ntwine upload -r pypi dist/*\n```\n\n### Support\nPlease [open an issue](https://github.com/kmedian/yearfrac/issues/new) for support.\n\n\n### Contributors\n* Adam Groszer [@agroszer](https://github.com/agroszer)\n* Emilio Basualdo [@emiliobasualdo](https://github.com/emiliobasualdo)\n* Ivan Nesic [@fatkaratekid](https://github.com/fatkaratekid)\n* Vinay Gupta [@vinschess](https://github.com/vinschess)\n* Ulf Hamster [@ulf1](https://github.com/ulf1)\n\nPlease contribute using [Github Flow](https://guides.github.com/introduction/flow/). Create a branch, add commits, and [open a pull request](https://github.com/kmedian/yearfrac/compare/).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Daycount methods to compute date differences in year units",
    "version": "0.4.8",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ff396d7d62fe0183ab1f50ff6bb4f744c2ddfc788d8ec65a41117808d1e15758",
                "md5": "28f76295ff8da6b6d39e2e9c0c8a0d5b",
                "sha256": "bef201c4ade087e2f21848ef16efc4ea6047ecf384ebb3f6e9eb9e84153bb175"
            },
            "downloads": -1,
            "filename": "yearfrac-0.4.8.tar.gz",
            "has_sig": false,
            "md5_digest": "28f76295ff8da6b6d39e2e9c0c8a0d5b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 7663,
            "upload_time": "2023-02-06T11:29:26",
            "upload_time_iso_8601": "2023-02-06T11:29:26.673680Z",
            "url": "https://files.pythonhosted.org/packages/ff/39/6d7d62fe0183ab1f50ff6bb4f744c2ddfc788d8ec65a41117808d1e15758/yearfrac-0.4.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-06 11:29:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "kmedian",
    "github_project": "yearfrac",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "numpy",
            "specs": [
                [
                    "<",
                    "2"
                ],
                [
                    ">=",
                    "1.14"
                ]
            ]
        }
    ],
    "lcname": "yearfrac"
}
        
Elapsed time: 0.03728s