datetime-nepali


Namedatetime-nepali JSON
Version 1.0.0.5 PyPI version JSON
download
home_pagehttps://github.com/44hukum/datetime-nepali
SummaryDatetime module that operates on top of Bikram Sambat Date & Nepal Time.
upload_time2024-06-07 05:42:33
maintainerNone
docs_urlNone
author44hukum <ghukumgh@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 No Travis.
coveralls test coverage No coveralls.
            # Python Nepali Date time Package

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

This Project is a Fork of datetime_nepali and is only developed to used internally.

> Supports: **Python 3.5+**


## Basic Usage

```python
# importing
>>> import datetime
>>> import datetime_nepali

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

# now datetime
>>> datetime.datetime.now()
>>> datetime_nepali.datetime.now()

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

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

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

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

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

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

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

# Bikram Sambat monthly calendar
>>> datetime_nepali.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 datetime-nepali
```

## Documentation

Complete usage documentations can be found [here](https://github.com/44hukum/datetime-nepali).

## Contribution

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/44hukum/datetime-nepali",
    "name": "datetime-nepali",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": null,
    "keywords": "nepali, bs, b.s, date, datetime, time, timezone, nepal, bikram, sambat, samvat, nepali-date, nepali-datetime, nepal-time, npt, nepal-timezone",
    "author": "44hukum <ghukumgh@gmail.com>",
    "author_email": "ghukumgh@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bf/7f/b34ae430b0e02fe617d50fb217279b0075fb093276323f03e059300b840c/datetime_nepali-1.0.0.5.tar.gz",
    "platform": null,
    "description": "# Python Nepali Date time Package\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\nThis Project is a Fork of datetime_nepali and is only developed to used internally.\n\n> Supports: **Python 3.5+**\n\n\n## Basic Usage\n\n```python\n# importing\n>>> import datetime\n>>> import datetime_nepali\n\n# today's date\n>>> datetime.date.today()\n>>> datetime_nepali.date.today()\n\n# now datetime\n>>> datetime.datetime.now()\n>>> datetime_nepali.datetime.now()\n\n# creating date object\n>>> datetime.date(2020, 9, 4)\n>>> datetime_nepali.date(2077, 5, 19)\n\n# creating datetime object\n>>> datetime.datetime(2020, 9, 4, 8, 26, 10, 123456)\n>>> datetime_nepali.datetime(2077, 5, 19, 8, 26, 10, 123456)\n\n# date/datetime formatting\n>>> datetime_nepali.datetime(2077, 5, 19, 8, 26, 10, 123456).strftime(\"%d %B %Y\")\n# 19 Bhadau 2077\n\n# datetime parsed from string (strptime)\n>>> datetime_nepali.datetime.strptime('2077-09-12', '%Y-%m-%d')\n# datetime_nepali.datetime(2077, 9, 12, 0, 0)\n\n# date/datetime formatting with Nepali unicode support\n>>> datetime_nepali.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>>> datetime_nepali.date(1990, 5, 10) + datetime.timedelta(days=350)\n# datetime_nepali.date(1991, 4, 26)\n>>> datetime_nepali.datetime(1990, 5, 10, 5, 10, 20) + datetime.timedelta(hours=3, minutes=15)\n# datetime_nepali.date(1990, 5, 10, 8, 25, 20)\n\n# convert B.S to A.D date and vice-versa\n>>> datetime_nepali.date(1999, 7, 25).to_datetime_date()\n# datetime.date(1942, 11, 10)\n>>> datetime_nepali.date.from_datetime_date(datetime.date(1942, 11, 10))\n# datetime_nepali.date(1999, 7, 25)\n\n# Bikram Sambat monthly calendar\n>>> datetime_nepali.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 datetime-nepali\n```\n\n## Documentation\n\nComplete usage documentations can be found [here](https://github.com/44hukum/datetime-nepali).\n\n## Contribution\n\nAny contributions are most welcome. Do check this guidelines [CONTRIBUTING.md](https://github.com/44hukum/datetime-nepali/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.0.5",
    "project_urls": {
        "Homepage": "https://github.com/44hukum/datetime-nepali"
    },
    "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": "bf7fb34ae430b0e02fe617d50fb217279b0075fb093276323f03e059300b840c",
                "md5": "b111fefff2e7be0ffbc4486c095227fe",
                "sha256": "06d286d989f35e8329cce75188eacf67d379548324273b5cb9265b347a0a8dcc"
            },
            "downloads": -1,
            "filename": "datetime_nepali-1.0.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "b111fefff2e7be0ffbc4486c095227fe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 20417,
            "upload_time": "2024-06-07T05:42:33",
            "upload_time_iso_8601": "2024-06-07T05:42:33.307516Z",
            "url": "https://files.pythonhosted.org/packages/bf/7f/b34ae430b0e02fe617d50fb217279b0075fb093276323f03e059300b840c/datetime_nepali-1.0.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-07 05:42:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "44hukum",
    "github_project": "datetime-nepali",
    "github_not_found": true,
    "lcname": "datetime-nepali"
}
        
Elapsed time: 0.33611s