bsdatetime


Namebsdatetime JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/Rajendra-Katuwal/bsdatetime
SummaryBikram Sambat (Nepali) date/datetime conversion and utilities
upload_time2025-09-08 08:29:12
maintainerNone
docs_urlNone
authorRajendra Katuwal
requires_python>=3.9
licenseMIT
keywords bikram sambat nepali calendar date datetime conversion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # bsdatetime

Lightweight, dependency‑free Bikram Sambat (Nepali) calendar utilities for Python.

Documentation: https://rajendra-katuwal.github.io/bsdatetime.docs/

## What it does
* Convert between Gregorian (AD) and Bikram Sambat (BS)
* Format / parse BS dates (localized month + weekday names)
* Validate dates, get fiscal year, week number, ranges
* Provide current BS date/time helpers

## Install
```bash
pip install bsdatetime
```

## Quick start
```python
import datetime, bsdatetime as bs

ad = datetime.date(2024, 12, 25)
bs_tuple = bs.ad_to_bs(ad)          # (2081, 9, 9)
ad_back = bs.bs_to_ad(*bs_tuple)    # 2024-12-25
text = bs.format_bs_date(*bs_tuple, "%B %d, %Y")  # भदौ 09, 2081
current_bs = bs.utils.get_current_bs_date()
```

Core API (most used)
* ad_to_bs(date)
* bs_to_ad(y, m, d)
* format_bs_date(y, m, d, fmt)
* parse_bs_date(text, fmt)
* is_valid_bs_date(y, m, d)
* utils.get_current_bs_date()

Supported range: BS 1975–2100 (≈ AD 1918–2043)

## Django?
Use the companion package for model fields:
```bash
pip install django-bsdatetime
```

## License
MIT

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Rajendra-Katuwal/bsdatetime",
    "name": "bsdatetime",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "bikram sambat, nepali, calendar, date, datetime, conversion",
    "author": "Rajendra Katuwal",
    "author_email": "Rajendra Katuwal <raj.katuwal2061@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/f8/83/c7b7d56a9e2e532b60e601d32427ab8cf4d9b9723947d5d06d2b069be561/bsdatetime-1.0.1.tar.gz",
    "platform": null,
    "description": "# bsdatetime\r\n\r\nLightweight, dependency\u2011free Bikram Sambat (Nepali) calendar utilities for Python.\r\n\r\nDocumentation: https://rajendra-katuwal.github.io/bsdatetime.docs/\r\n\r\n## What it does\r\n* Convert between Gregorian (AD) and Bikram Sambat (BS)\r\n* Format / parse BS dates (localized month + weekday names)\r\n* Validate dates, get fiscal year, week number, ranges\r\n* Provide current BS date/time helpers\r\n\r\n## Install\r\n```bash\r\npip install bsdatetime\r\n```\r\n\r\n## Quick start\r\n```python\r\nimport datetime, bsdatetime as bs\r\n\r\nad = datetime.date(2024, 12, 25)\r\nbs_tuple = bs.ad_to_bs(ad)          # (2081, 9, 9)\r\nad_back = bs.bs_to_ad(*bs_tuple)    # 2024-12-25\r\ntext = bs.format_bs_date(*bs_tuple, \"%B %d, %Y\")  # \u092d\u0926\u094c 09, 2081\r\ncurrent_bs = bs.utils.get_current_bs_date()\r\n```\r\n\r\nCore API (most used)\r\n* ad_to_bs(date)\r\n* bs_to_ad(y, m, d)\r\n* format_bs_date(y, m, d, fmt)\r\n* parse_bs_date(text, fmt)\r\n* is_valid_bs_date(y, m, d)\r\n* utils.get_current_bs_date()\r\n\r\nSupported range: BS 1975\u20132100 (\u2248 AD 1918\u20132043)\r\n\r\n## Django?\r\nUse the companion package for model fields:\r\n```bash\r\npip install django-bsdatetime\r\n```\r\n\r\n## License\r\nMIT\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Bikram Sambat (Nepali) date/datetime conversion and utilities",
    "version": "1.0.1",
    "project_urls": {
        "Documentation": "https://rajendra-katuwal.github.io/bsdatetime.docs/",
        "Homepage": "https://github.com/Rajendra-Katuwal/bsdatetime",
        "Issues": "https://github.com/Rajendra-Katuwal/bsdatetime/issues",
        "Source": "https://github.com/Rajendra-Katuwal/bsdatetime"
    },
    "split_keywords": [
        "bikram sambat",
        " nepali",
        " calendar",
        " date",
        " datetime",
        " conversion"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f9f04b326e8c466a3f3b54b1b289d44912416a62ca677c1870456a686fd08def",
                "md5": "83eae9345dab6762f26f4aa2b2bd4ba4",
                "sha256": "e9250519ceb6659b9a31a206c8fac24ced9b1ed44e02e709e276d631f9b4dff5"
            },
            "downloads": -1,
            "filename": "bsdatetime-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "83eae9345dab6762f26f4aa2b2bd4ba4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 10606,
            "upload_time": "2025-09-08T08:29:11",
            "upload_time_iso_8601": "2025-09-08T08:29:11.561927Z",
            "url": "https://files.pythonhosted.org/packages/f9/f0/4b326e8c466a3f3b54b1b289d44912416a62ca677c1870456a686fd08def/bsdatetime-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f883c7b7d56a9e2e532b60e601d32427ab8cf4d9b9723947d5d06d2b069be561",
                "md5": "b1f5a9b17366ac86a99d7ebc038c39b2",
                "sha256": "52a52f57fb2c30aeb85356f3f9c6861eaec9f349fa9f93da13098903084bfe16"
            },
            "downloads": -1,
            "filename": "bsdatetime-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b1f5a9b17366ac86a99d7ebc038c39b2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10697,
            "upload_time": "2025-09-08T08:29:12",
            "upload_time_iso_8601": "2025-09-08T08:29:12.836951Z",
            "url": "https://files.pythonhosted.org/packages/f8/83/c7b7d56a9e2e532b60e601d32427ab8cf4d9b9723947d5d06d2b069be561/bsdatetime-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-08 08:29:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Rajendra-Katuwal",
    "github_project": "bsdatetime",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bsdatetime"
}
        
Elapsed time: 0.44739s