nepali-datetime


Namenepali-datetime JSON
Version 1.0.8.2 PyPI version JSON
download
home_pagehttps://github.com/amitgaru2/nepali-datetime
SummaryDatetime module that operates on top of Bikram Sambat Date & Nepal Time.
upload_time2024-02-22 16:16:41
maintainer
docs_urlNone
authorAmit Garu <amitgaru2@gmail.com>
requires_python>=3.5
licenseMIT
keywords nepali bs b.s date datetime time timezone nepal bikram sambat samvat nepali-date nepali-datetime nepal-time npt nepal-timezone
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # Nepali Datetime (Bikram Sambat Date & Nepal Time)

The package inspired from Python's core `datetime` package that
operates on top of Bikram Sambat (B.S) Date & Nepal Time (NPT) `+05:45`.

> Supports: **Python 3.5+**


## Basic Usage

```python
# importing
>>> import datetime
>>> import nepali_datetime

# today's date
>>> datetime.date.today()
>>> nepali_datetime.date.today()

# now datetime
>>> datetime.datetime.now()
>>> nepali_datetime.datetime.now()

# creating date object
>>> datetime.date(2020, 9, 4)
>>> nepali_datetime.date(2077, 5, 19)

# creating datetime object
>>> datetime.datetime(2020, 9, 4, 8, 26, 10, 123456)
>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456)

# date/datetime formatting
>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456).strftime("%d %B %Y")
# 19 Bhadau 2077

# datetime parsed from string (strptime)
>>> nepali_datetime.datetime.strptime('2077-09-12', '%Y-%m-%d')
# nepali_datetime.datetime(2077, 9, 12, 0, 0)

# date/datetime formatting with Nepali unicode support
>>> nepali_datetime.date(1977, 10, 25).strftime('%K-%n-%D (%k %N %G)')
# १९७७-१०-२५ (७७ माघ आइतबार)

# datetime.timedelta addition/subtraction
>>> nepali_datetime.date(1990, 5, 10) + datetime.timedelta(days=350)
# nepali_datetime.date(1991, 4, 26)
>>> nepali_datetime.datetime(1990, 5, 10, 5, 10, 20) + datetime.timedelta(hours=3, minutes=15)
# nepali_datetime.date(1990, 5, 10, 8, 25, 20)

# convert B.S to A.D date and vice-versa
>>> nepali_datetime.date(1999, 7, 25).to_datetime_date()
# datetime.date(1942, 11, 10)
>>> nepali_datetime.date.from_datetime_date(datetime.date(1942, 11, 10))
# nepali_datetime.date(1999, 7, 25)

# Bikram Sambat monthly calendar
>>> nepali_datetime.date(2078, 1, 1).calendar()

          Baishakh 2078
Sun  Mon  Tue  Wed  Thu  Fri  Sat
                1    2    3    4
5     6    7    8    9   10   11
12   13   14   15   16   17   18
19   20   21   22   23   24   25
26   27   28   29   30   31
```

## Installation

```shell
$ pip install nepali-datetime
```

## Documentation

Complete usage documentations can be found [here](https://amitgaru2.github.io/nepali-datetime/).

## Contribution

Any contributions are most welcome. Do check this guidelines [CONTRIBUTING.md](https://github.com/amitgaru2/nepali-datetime/blob/master/CONTRIBUTING.md) for code contribution.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/amitgaru2/nepali-datetime",
    "name": "nepali-datetime",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "nepali,bs,b.s,date,datetime,time,timezone,nepal,bikram,sambat,samvat,nepali-date,nepali-datetime,nepal-time,npt,nepal-timezone",
    "author": "Amit Garu <amitgaru2@gmail.com>",
    "author_email": "amitgaru2@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bb/d7/f8fc07addff4a59e87d6f0e23982938964e0ff9830a68319766ab68d0c08/nepali-datetime-1.0.8.2.tar.gz",
    "platform": null,
    "description": "# Nepali Datetime (Bikram Sambat Date & Nepal Time)\n\nThe package inspired from Python's core `datetime` package that\noperates on top of Bikram Sambat (B.S) Date & Nepal Time (NPT) `+05:45`.\n\n> Supports: **Python 3.5+**\n\n\n## Basic Usage\n\n```python\n# importing\n>>> import datetime\n>>> import nepali_datetime\n\n# today's date\n>>> datetime.date.today()\n>>> nepali_datetime.date.today()\n\n# now datetime\n>>> datetime.datetime.now()\n>>> nepali_datetime.datetime.now()\n\n# creating date object\n>>> datetime.date(2020, 9, 4)\n>>> nepali_datetime.date(2077, 5, 19)\n\n# creating datetime object\n>>> datetime.datetime(2020, 9, 4, 8, 26, 10, 123456)\n>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456)\n\n# date/datetime formatting\n>>> nepali_datetime.datetime(2077, 5, 19, 8, 26, 10, 123456).strftime(\"%d %B %Y\")\n# 19 Bhadau 2077\n\n# datetime parsed from string (strptime)\n>>> nepali_datetime.datetime.strptime('2077-09-12', '%Y-%m-%d')\n# nepali_datetime.datetime(2077, 9, 12, 0, 0)\n\n# date/datetime formatting with Nepali unicode support\n>>> nepali_datetime.date(1977, 10, 25).strftime('%K-%n-%D (%k %N %G)')\n# \u0967\u096f\u096d\u096d-\u0967\u0966-\u0968\u096b (\u096d\u096d \u092e\u093e\u0918 \u0906\u0907\u0924\u092c\u093e\u0930)\n\n# datetime.timedelta addition/subtraction\n>>> nepali_datetime.date(1990, 5, 10) + datetime.timedelta(days=350)\n# nepali_datetime.date(1991, 4, 26)\n>>> nepali_datetime.datetime(1990, 5, 10, 5, 10, 20) + datetime.timedelta(hours=3, minutes=15)\n# nepali_datetime.date(1990, 5, 10, 8, 25, 20)\n\n# convert B.S to A.D date and vice-versa\n>>> nepali_datetime.date(1999, 7, 25).to_datetime_date()\n# datetime.date(1942, 11, 10)\n>>> nepali_datetime.date.from_datetime_date(datetime.date(1942, 11, 10))\n# nepali_datetime.date(1999, 7, 25)\n\n# Bikram Sambat monthly calendar\n>>> nepali_datetime.date(2078, 1, 1).calendar()\n\n          Baishakh 2078\nSun  Mon  Tue  Wed  Thu  Fri  Sat\n                1    2    3    4\n5     6    7    8    9   10   11\n12   13   14   15   16   17   18\n19   20   21   22   23   24   25\n26   27   28   29   30   31\n```\n\n## Installation\n\n```shell\n$ pip install nepali-datetime\n```\n\n## Documentation\n\nComplete usage documentations can be found [here](https://amitgaru2.github.io/nepali-datetime/).\n\n## Contribution\n\nAny contributions are most welcome. Do check this guidelines [CONTRIBUTING.md](https://github.com/amitgaru2/nepali-datetime/blob/master/CONTRIBUTING.md) for code contribution.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Datetime module that operates on top of Bikram Sambat Date & Nepal Time.",
    "version": "1.0.8.2",
    "project_urls": {
        "Homepage": "https://github.com/amitgaru2/nepali-datetime"
    },
    "split_keywords": [
        "nepali",
        "bs",
        "b.s",
        "date",
        "datetime",
        "time",
        "timezone",
        "nepal",
        "bikram",
        "sambat",
        "samvat",
        "nepali-date",
        "nepali-datetime",
        "nepal-time",
        "npt",
        "nepal-timezone"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6bc6e9395b813fcdc0a63cb86d0e041d672e7b376e90798c50ed10395041ab00",
                "md5": "1523fc76a7a52d34c37d7e48634d409e",
                "sha256": "8b0e453d13dab59e2b5090a04cdbab73fbbeef2798d267b8851073fc13b4343c"
            },
            "downloads": -1,
            "filename": "nepali_datetime-1.0.8.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1523fc76a7a52d34c37d7e48634d409e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 18572,
            "upload_time": "2024-02-22T16:16:34",
            "upload_time_iso_8601": "2024-02-22T16:16:34.990798Z",
            "url": "https://files.pythonhosted.org/packages/6b/c6/e9395b813fcdc0a63cb86d0e041d672e7b376e90798c50ed10395041ab00/nepali_datetime-1.0.8.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bbd7f8fc07addff4a59e87d6f0e23982938964e0ff9830a68319766ab68d0c08",
                "md5": "c12d390c09cb7a5eb161b667dc09e8a1",
                "sha256": "56f6110dc02ea823550ec62ad8c9ae30ff85cf1672aca145115ea28bcc7da773"
            },
            "downloads": -1,
            "filename": "nepali-datetime-1.0.8.2.tar.gz",
            "has_sig": false,
            "md5_digest": "c12d390c09cb7a5eb161b667dc09e8a1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 20193,
            "upload_time": "2024-02-22T16:16:41",
            "upload_time_iso_8601": "2024-02-22T16:16:41.757360Z",
            "url": "https://files.pythonhosted.org/packages/bb/d7/f8fc07addff4a59e87d6f0e23982938964e0ff9830a68319766ab68d0c08/nepali-datetime-1.0.8.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-22 16:16:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "amitgaru2",
    "github_project": "nepali-datetime",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nepali-datetime"
}
        
Elapsed time: 0.18701s