Skip to main content

Python BS date conversion utility

Project description

pyBSDate

PyPI PyPI - Downloads GitHub license

Python implementation of Date conversion From Bikram Sambat(BS) to English Date(AD) and viceversa. Conversion is done with the help of date mappings so conversion limited to certain range of date.

Tested with python 2.7 and should be ok with python 3

Installation Instruction

  1. Get a copy of the project. Download zip of the project or clone this repo:
git clone https://github.com/SushilShrestha/pyBSDate
  1. Open your terminal, navigate to the project folder and type
python setup.py install

OR

If you have pip installed, simply

pip install pyBSDate

Usage

# Convert BS Date to AD
from pyBSDate import convert_BS_to_AD
adDate = convert_BS_to_AD(2072, 1, 10)
print adDate

# Convert AD Date to BS
from pyBSDate import convert_AD_to_BS
bsDate = convert_AD_to_BS(2015, 4, 23)
print bsDate

Date mapping data taken from https://github.com/bahadurbaniya/Date-Converter-Bikram-Sambat-to-English-Date

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyBSDate-0.3.0rc1.tar.gz (7.0 kB view hashes)

Uploaded Source

Built Distribution

pyBSDate-0.3.0rc1-py2-none-any.whl (8.3 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page