nepali 1.0.1__py3-none-any.whl → 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,16 +2,16 @@ import unittest
2
2
  from unittest import mock
3
3
 
4
4
  from nepali.phone_number import (
5
+ Operator,
5
6
  _get_area_code,
6
7
  _get_operator,
7
8
  _parse_landline_number,
8
9
  _parse_mobile_number,
9
- is_mobile_number,
10
+ get_exact_number,
10
11
  is_landline_number,
12
+ is_mobile_number,
11
13
  is_valid,
12
- get_exact_number,
13
14
  parse,
14
- Operator,
15
15
  )
16
16
 
17
17
 
@@ -7,13 +7,14 @@ import datetime
7
7
  import unittest
8
8
  from unittest.mock import patch
9
9
 
10
+ from nepali.constants import NEPAL_TIMEZONE
10
11
  from nepali.timezone import (
11
12
  NepaliTimeZone,
13
+ get_timezone,
14
+ now,
12
15
  to_nepali_timezone,
13
16
  to_utc_timezone,
14
17
  utc_now,
15
- now,
16
- get_timezone,
17
18
  )
18
19
 
19
20
 
@@ -32,13 +33,13 @@ class TestNepaliTimeZone(unittest.TestCase):
32
33
  )
33
34
 
34
35
  def test_nepali_timezone_tzname(self):
35
- self.assertEqual(self.nepali_timezone.tzname(None), "Asia/Kathmandu")
36
+ self.assertEqual(self.nepali_timezone.tzname(None), NEPAL_TIMEZONE)
36
37
 
37
38
  def test_nepali_timezone_str(self):
38
- self.assertEqual(str(self.nepali_timezone), "Asia/Kathmandu")
39
+ self.assertEqual(str(self.nepali_timezone), NEPAL_TIMEZONE)
39
40
 
40
41
  def test_nepali_timezone_repr(self):
41
- self.assertEqual(repr(self.nepali_timezone), "Asia/Kathmandu")
42
+ self.assertEqual(repr(self.nepali_timezone), NEPAL_TIMEZONE)
42
43
 
43
44
  def test_datetime_with_nepali_timezone(self):
44
45
  dt = datetime.datetime(2015, 10, 14, tzinfo=self.nepali_timezone)
nepali/timezone.py CHANGED
@@ -1,6 +1,8 @@
1
1
  import datetime
2
2
  from typing import Union
3
3
 
4
+ from .constants import NEPAL_TIMEZONE
5
+
4
6
 
5
7
  class NepaliTimeZone(datetime.tzinfo):
6
8
  """
@@ -14,13 +16,13 @@ class NepaliTimeZone(datetime.tzinfo):
14
16
  return datetime.timedelta(0)
15
17
 
16
18
  def tzname(self, dt):
17
- return "Asia/Kathmandu"
19
+ return NEPAL_TIMEZONE
18
20
 
19
21
  def __str__(self):
20
- return "Asia/Kathmandu"
22
+ return NEPAL_TIMEZONE
21
23
 
22
24
  def __repr__(self):
23
- return "Asia/Kathmandu"
25
+ return NEPAL_TIMEZONE
24
26
 
25
27
  def __eq__(self, o: object) -> bool:
26
28
  return isinstance(o, self.__class__)
nepali/utils.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from nepali.datetime.utils import to_nepalidate, to_nepalidatetime
2
- from nepali.timezone import to_utc_timezone, to_nepali_timezone
2
+ from nepali.timezone import to_nepali_timezone, to_utc_timezone
3
3
 
4
4
  __all__ = [
5
5
  "to_nepalidate",
@@ -1,10 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nepali
3
- Version: 1.0.1
3
+ Version: 1.1.0
4
4
  Summary: nepalidatetime compatible with python's datetime feature. Converting nepali date to english, parsing nepali datetime, nepali timezone, and timedelta support in nepali datetime
5
5
  Home-page: https://github.com/opensource-nepal/py-nepali
6
6
  Author: opensource-nepal
7
7
  Author-email: aj3sshh@gmail.com, sugatbajracharya49@gmail.com
8
+ License: MIT
9
+ Project-URL: Source, https://github.com/opensource-nepal/py-nepali
10
+ Project-URL: Changelog, https://github.com/opensource-nepal/py-nepali/blob/main/CHANGELOG.md
8
11
  Keywords: nepali date conversion,convert date,nepali date time,python convert date,parse nepali date time
9
12
  Classifier: Programming Language :: Python :: 3
10
13
  Classifier: License :: OSI Approved :: MIT License
@@ -15,9 +18,9 @@ License-File: LICENSE
15
18
  # nepali
16
19
 
17
20
  [![PyPI version](https://badge.fury.io/py/nepali.svg)](https://badge.fury.io/py/nepali)
18
- [![CI status](https://github.com/opensource-nepal/py-nepali/actions/workflows/python-package.yml/badge.svg?branch=master)](https://github.com/opensource-nepal/py-nepali/actions)
21
+ [![CI status](https://github.com/opensource-nepal/py-nepali/actions/workflows/python-package.yml/badge.svg?branch=main)](https://github.com/opensource-nepal/py-nepali/actions)
19
22
  [![Downloads](https://img.shields.io/pypi/dm/nepali.svg?maxAge=180)](https://pypi.org/project/nepali/)
20
- [![codecov](https://codecov.io/gh/opensource-nepal/py-nepali/branch/master/graph/badge.svg?token=PTUHYWCJ4I)](https://codecov.io/gh/opensource-nepal/py-nepali)
23
+ [![codecov](https://codecov.io/gh/opensource-nepal/py-nepali/branch/main/graph/badge.svg?token=PTUHYWCJ4I)](https://codecov.io/gh/opensource-nepal/py-nepali)
21
24
 
22
25
  `nepali` is a python package containing features that will be useful for Nepali projects.
23
26
 
@@ -311,7 +314,7 @@ np_datetime = parse("Jestha 15, 2079") # 2079-02-15 00:00:00
311
314
  | `%A` | Weekday as locale’s full name. | Sunday, Monday, …, Saturday |
312
315
  | `%d` | Day of the month as a zero-padded decimal number. | 01, 02, …, 31 |
313
316
  | `%-d` | Day of the month as a decimal number. | 1, 2, …, 31 |
314
- | `%B` | Month as locale’s full name. | Baishak, Jestha, …, Chaitra |
317
+ | `%B` | Month as locale’s full name. | Baishakh, Jestha, …, Chaitra |
315
318
  | `%m` | Month as a zero-padded decimal number. | 01, 02, …, 12 |
316
319
  | `%-m` | Month as a decimal number. | 1, 2, …, 12 |
317
320
  | `%y` | Year without century as a zero-padded decimal number. | 00, 01, …, 99 |
@@ -447,86 +450,9 @@ get_municipality(name_nepali="विराटनगर")
447
450
 
448
451
  ---
449
452
 
450
- ## For Django Template
451
-
452
- Add `'nepali'` to your `INSTALLED_APPS` setting.
453
-
454
- ```python
455
- INSTALLED_APPS = [
456
- ...
457
- 'nepali',
458
- ...
459
- ]
460
- ```
461
-
462
- ### nepalidatetime
463
-
464
- In your Template
465
-
466
- ```python
467
- {% load nepalidatetime %}
468
- ```
469
-
470
- #### nepalinow
471
-
472
- `nepalinow` renders the current Nepali date and time in 'en-US' locale (English).
473
-
474
- ```python
475
- {% nepalinow %}
476
- ```
477
-
478
- ```python
479
- {% nepalinow '%Y-%m-%d' %}
480
- ```
481
-
482
- #### nepalinow_ne
483
-
484
- `nepalinow_ne` renders the current Nepali date and time in 'ne' locale (Nepali).
485
-
486
- ```python
487
- {% nepalinow_ne %}
488
- ```
489
-
490
- #### nepalidate
491
-
492
- `nepalidate` renders the datetime object into nepali datetime format in 'en-US' locale (English).
493
-
494
- ```python
495
- {{ datetime_obj|nepalidate:"%Y-%m-%d" }}
496
- ```
497
-
498
- #### nepalidate_ne
499
-
500
- `nepalidate_ne` renders the datetime object into nepali datetime format in 'ne' locale (Nepali).
501
-
502
- ```python
503
- {{ datetime_obj|nepalidate_ne:"%Y-%m-%d" }}
504
- ```
505
-
506
- #### nepalihumanize
507
-
508
- `nepalihumanize` renders the datetime object to a human readable form for 'ne' locale (Nepali)
509
-
510
- ```python
511
- {{ datetime_obj|nepalihumanize }}
512
- ```
513
-
514
- ### nepalinumber
515
-
516
- In your Template
517
-
518
- ```python
519
- {% load nepalinumber %}
520
- ```
521
-
522
- `nepalinumber` renders the english number into nepali format (devanagari)
523
-
524
- ```python
525
- {{ forloop.counter|nepalinumber }}
526
-
527
- {{ 150|nepalinumber }}
528
- ```
453
+ ## For Django
529
454
 
455
+ We have created a new Django package called [django-nepali](https://github.com/opensource-nepal/django-nepali) to support `nepali` package. For more information, please visit [django-nepali](https://github.com/opensource-nepal/django-nepali).
530
456
 
531
457
  ## Contribution
532
458
 
@@ -0,0 +1,46 @@
1
+ nepali/__init__.py,sha256=8Vx8S0r8UT5PoFdlGHBp59j84si87m4mWgGipzwhVvs,16
2
+ nepali/char.py,sha256=WglBe0AefpsHwIXaPXr0FVjdI4qvmr06U8kSQLtvjdQ,3437
3
+ nepali/constants.py,sha256=FA5qvFaiNKyQ5APQytDovbr9tBPIITgLpPMrR0UlbsY,1309
4
+ nepali/date_converter.py,sha256=ZRmjTl7GjKW8Gvx2KKN3kyAd62lepHk8f6SJ8f0kLzQ,13551
5
+ nepali/exceptions.py,sha256=CKg1wEUuzcog7w8Q7pGBNthi9oTOeg_3Aapx1WaTveY,329
6
+ nepali/phone_number.py,sha256=QCAas5yyVVAXiS-CkO_-BGINmVTj96IwOyIn0-XVDZo,4172
7
+ nepali/timezone.py,sha256=qRO9ALaEDH4LkPPKGtUlHbDo6TysfQclgVmmQmFrkMU,1995
8
+ nepali/utils.py,sha256=rOHuHuUZzcTCQTfFXn3RneS9lx9RbtDTifnkO-buoDc,241
9
+ nepali/datetime/__init__.py,sha256=5tfqVCXri3zACb2twLI1QcYw9wp4-Omj6tJhSny-mxo,427
10
+ nepali/datetime/_datetime.py,sha256=jIeSotLQ_rLe5keRGZt31usDIt0RiXuM4SsPkbxmFsI,12049
11
+ nepali/datetime/_formatter.py,sha256=U0Fe-mPwM25VSru124SRG9Olv0FD1WwaFjR22G9TuOU,8744
12
+ nepali/datetime/_humanize.py,sha256=mfucIbpdZqq2-GjolfhLUP22dKkmy7484hE1FpzHvnM,3636
13
+ nepali/datetime/_nepalimonth.py,sha256=chyLZFh3vDt4StUia5GGxDNCTBLBjVatK4uYiumo5po,3224
14
+ nepali/datetime/_nepaliweek.py,sha256=kKuya3qo8lUokkuOGsgcsiHJx2Hf6Ith0nPZsaA1iQI,3400
15
+ nepali/datetime/utils.py,sha256=UpBhiwRrNg8bpTW018_gSzk3w8BMZiqVcK0C3x16JYU,1482
16
+ nepali/datetime/parser/__init__.py,sha256=IXGIIG8KO3VP4BPPQegoz2LRven1L9pLkM0mYbvHf7I,81
17
+ nepali/datetime/parser/_parser.py,sha256=U7W3wrY5hAPoB9XMD5KMT8OCEy6ZyIF48UHXnJRfny0,1930
18
+ nepali/datetime/parser/validators.py,sha256=Zd9KFEUVkWKY57_Oa1S7jOnPsnJjvEbNp38QwTglgeM,10597
19
+ nepali/locations/__init__.py,sha256=kaBcuMBHrf38Zj7BTXRIwP6rdXnzc_bpQMcig8BzDcQ,117
20
+ nepali/locations/_data.py,sha256=8qrkNLZAMgqTxopPaFOcO9HpwqapF7WfjPL20Qrcvyc,216494
21
+ nepali/locations/_locations.py,sha256=DpnE4lcTbxTDfKv5EsCupDqCi2K5-jSDICzF5DpKpss,1348
22
+ nepali/locations/models.py,sha256=OZ2C-ZK2Fz-eC8up-j0HLliFWOqMMyO_cvzTLkTIFs8,2870
23
+ nepali/locations/utils.py,sha256=dPV8tJDTajgfJaQ6qNMgnemMTlilYzza0m6DhrxkdOs,1546
24
+ nepali/number/__init__.py,sha256=r1qwwG-HQ_QtMt_qvfBZMmBKgWQArBERYRs4tJdFjKY,384
25
+ nepali/number/_nepalinumber.py,sha256=dwI-u7jXUi8SajjOT28yhDos1x4vykSSPvhVz4NRaTk,19561
26
+ nepali/number/_number.py,sha256=qPqXSeU7YxIR1IXxjgmfFeIlCWre8_6IHtPD_0ip20I,1892
27
+ nepali/number/utils.py,sha256=ieGpY0DK5_FZaTvSKp8q4hMepjWqyXtGtf7T7-0iVp4,1878
28
+ nepali/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
+ nepali/templatetags/nepalidatetime.py,sha256=g6UtfkToZtVDVe_Z9aGPwYPhNrPpZzvfi1bzFdTjSpg,5789
30
+ nepali/templatetags/nepalinumber.py,sha256=hjq0cxI1o_uny_8aH9skUhqzhWi4YvnvY3ivdt1ulGU,2452
31
+ nepali/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ nepali/tests/test_date_converter.py,sha256=rVUelyeuPziIN_1YewZqa0bgzCG-BzbjH_Dk7AKkJy4,5282
33
+ nepali/tests/test_datetime.py,sha256=YjXGxnqeu4ytn5HpDU4CxwYTNmiB-KilJv10T2Wc5Eo,13581
34
+ nepali/tests/test_humanize.py,sha256=DX0-I1aXZkBNSPtXKbRrIPiBVxzVaFRItlDwx4lDzko,3845
35
+ nepali/tests/test_locations.py,sha256=DoiqiLh8FdvervTyqbbeG-f7QQDTOiQ4GJS68OheNPs,5968
36
+ nepali/tests/test_nepalimonth.py,sha256=1e-nFpCvk_JGUhRtjAL9_NDck2Ue828Gp3sN_uAWGxU,6575
37
+ nepali/tests/test_nepaliweek.py,sha256=ycGE3gY1d6JjF0VyAy5DbVGg3ayLcRTwAHruSqAWF_4,6468
38
+ nepali/tests/test_number.py,sha256=wDrAygSskvsLWGD3NqL8ButVdCwKbouzzmdL-ncqjpY,117664
39
+ nepali/tests/test_parser.py,sha256=_p6H09Ybw-sTRpNNgf7qMibEtnubI-HRECxrbLlgRnw,6712
40
+ nepali/tests/test_phone_number.py,sha256=fswHlwgaiS3outmHOevNj1IVh0ZOYyrvuFKYBYODGRE,11726
41
+ nepali/tests/test_timezone.py,sha256=-GBtiRU5msL9SjPeBBrZuXKMn89k_Q4mqhiT48W0BJE,6542
42
+ nepali-1.1.0.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
43
+ nepali-1.1.0.dist-info/METADATA,sha256=qAeuDu_ItzCjEHcbDisDuaVMqQRmKzBK4hVm0QDCfhY,14154
44
+ nepali-1.1.0.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
45
+ nepali-1.1.0.dist-info/top_level.txt,sha256=joX2GOfHg0KHYsDxi7eXDVTBQK0t6ZsvKz9uz7S6mFE,7
46
+ nepali-1.1.0.dist-info/RECORD,,
@@ -1,46 +0,0 @@
1
- nepali/__init__.py,sha256=8Vx8S0r8UT5PoFdlGHBp59j84si87m4mWgGipzwhVvs,16
2
- nepali/char.py,sha256=WglBe0AefpsHwIXaPXr0FVjdI4qvmr06U8kSQLtvjdQ,3437
3
- nepali/date_converter.py,sha256=ZRmjTl7GjKW8Gvx2KKN3kyAd62lepHk8f6SJ8f0kLzQ,13551
4
- nepali/exceptions.py,sha256=CKg1wEUuzcog7w8Q7pGBNthi9oTOeg_3Aapx1WaTveY,329
5
- nepali/phone_number.py,sha256=x4lYjHjkXfQYMf8Lawl5v-eHwMLkmnbyu33eWUcZ8IM,4182
6
- nepali/timezone.py,sha256=xDjw73xhhb6ub-M_NzZJBJ0yDobe6CAiCrHAFUUaP50,1962
7
- nepali/utils.py,sha256=0dNNZwzYiK7XxSaUeH_NQcsplc-EQglwGA3eWOtBXAk,241
8
- nepali/datetime/__init__.py,sha256=nyhLV-y803az7F28qKAwyQcwJYW46t-A8ZYntnZtz_Y,427
9
- nepali/datetime/_datetime.py,sha256=yi2pkdVby_rCaiCTwgCMzHC8InK291GF3kdSfCglPB0,12071
10
- nepali/datetime/_formatter.py,sha256=mFX6c0XCuuVfkN_-WANIhNS9J461wLKYG12CcRUJN-k,8750
11
- nepali/datetime/_humanize.py,sha256=sPvyYqtdwsJtJlkLnCU4oZntDwYlo4P3VbE3c_2VUnQ,4420
12
- nepali/datetime/_nepalimonth.py,sha256=l2jYL_GQvLjP01ulvOb2OU9cyPffXKeAyR4i6et_rmU,3162
13
- nepali/datetime/_nepaliweek.py,sha256=OYQm_GAXwuwZ8-M_hMfDps9mngFXIHrxoCpoDBMkgY8,3383
14
- nepali/datetime/constants.py,sha256=P0O0g2koC_KOd-AgCqHbQHIWMWWY1rezs38MRSa26eg,965
15
- nepali/datetime/utils.py,sha256=h616TYFIy7cFbl0gFXgp1rQJ-D7NDJwAGW_yWTx1WyM,1481
16
- nepali/datetime/parser/__init__.py,sha256=sngXPD5hrjkBOIMeS9TbjtA489yoBv0MIltbVr9qcJM,81
17
- nepali/datetime/parser/_parser.py,sha256=fdrm6R4HnT9TJ22kihYli_THBeH6uOEkBtK49h3GRFo,2074
18
- nepali/datetime/parser/validators.py,sha256=vxaKRdvgQtXHbsOnYgU2kjBSPAD4grTn-hefJKRAVeE,8546
19
- nepali/locations/__init__.py,sha256=1ZPHODk6lP0w9k6rZsfumX8BCbhvqoqJGvHVFXEP3UY,117
20
- nepali/locations/_data.py,sha256=8qrkNLZAMgqTxopPaFOcO9HpwqapF7WfjPL20Qrcvyc,216494
21
- nepali/locations/_locations.py,sha256=C8NBtSbRsd049eGbIxtPd-vxp-9Vpv43DNRit_1Bc9o,1348
22
- nepali/locations/models.py,sha256=OZ2C-ZK2Fz-eC8up-j0HLliFWOqMMyO_cvzTLkTIFs8,2870
23
- nepali/locations/utils.py,sha256=b7q3UQeGMsautBSCPAdWFeGi8L8khh2xtIrM0H3sOn4,1547
24
- nepali/number/__init__.py,sha256=blTGsavxmNmL_mZP9jpxOFk239kpKZv6lsMW4sJVnvk,384
25
- nepali/number/_nepalinumber.py,sha256=TUcmRSRwbfE-gvMCMMba49j_E-iSHqqhvfwG4WqzEVM,19019
26
- nepali/number/_number.py,sha256=dDfv4MLxK2iS3z-0ryTVTEbFIO4o4KwMP84J9R3W7z0,1913
27
- nepali/number/utils.py,sha256=CABRrMndpmn3-PKTFgJi3RB0_dRdnmQrzwiU-VsvOUE,1887
28
- nepali/templatetags/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- nepali/templatetags/nepalidatetime.py,sha256=tcrSMs_pGJmAqJ8fQ5iwFT8pD1YqWu5HzDp0Q6BfuYU,4754
30
- nepali/templatetags/nepalinumber.py,sha256=ENjB7FriZORrSvlHAFc5J0TV5q8-lyRQAxFBFZnlrU4,1749
31
- nepali/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
- nepali/tests/test_date_converter.py,sha256=rVUelyeuPziIN_1YewZqa0bgzCG-BzbjH_Dk7AKkJy4,5282
33
- nepali/tests/test_datetime.py,sha256=j1XW1vSkc6Rq5GhwQVBuObdMR6ftgY7v_F_632Zpk2I,13621
34
- nepali/tests/test_humanize.py,sha256=MxiRCCGtZtqcMKUQSh6ViKuEu9A1sSI3J2LdrWjJyZE,3846
35
- nepali/tests/test_locations.py,sha256=DEszPh-F_d2XZi7TKcaHxKI8MR4pl5rg4xRtAGyd-_U,5968
36
- nepali/tests/test_nepalimonth.py,sha256=1e-nFpCvk_JGUhRtjAL9_NDck2Ue828Gp3sN_uAWGxU,6575
37
- nepali/tests/test_nepaliweek.py,sha256=ycGE3gY1d6JjF0VyAy5DbVGg3ayLcRTwAHruSqAWF_4,6468
38
- nepali/tests/test_number.py,sha256=Q8DaQNeWEKH5WK4NN8f5FTU2m3HOyTn2OBdZITPgu1Y,117623
39
- nepali/tests/test_parser.py,sha256=_p6H09Ybw-sTRpNNgf7qMibEtnubI-HRECxrbLlgRnw,6712
40
- nepali/tests/test_phone_number.py,sha256=ND2yJj5pHkkICTdZzVPBxUW4vc0Wib8qMDzBJ03G87s,11726
41
- nepali/tests/test_timezone.py,sha256=cYzTF4G0fKxwO8Verf6NH9K5reZMQmB1OpPk8aTSsME,6504
42
- nepali-1.0.1.dist-info/LICENSE,sha256=2bm9uFabQZ3Ykb_SaSU_uUbAj2-htc6WJQmS_65qD00,1073
43
- nepali-1.0.1.dist-info/METADATA,sha256=2g62AVob3esUz5pHQM-zt5DXtlU3_Ydfkk0tAdnnhWs,14992
44
- nepali-1.0.1.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
45
- nepali-1.0.1.dist-info/top_level.txt,sha256=joX2GOfHg0KHYsDxi7eXDVTBQK0t6ZsvKz9uz7S6mFE,7
46
- nepali-1.0.1.dist-info/RECORD,,
File without changes