nepali 1.1.0__tar.gz → 1.1.2__tar.gz
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.
Potentially problematic release.
This version of nepali might be problematic. Click here for more details.
- {nepali-1.1.0 → nepali-1.1.2}/PKG-INFO +14 -4
- {nepali-1.1.0 → nepali-1.1.2}/README.md +2 -2
- {nepali-1.1.0 → nepali-1.1.2}/nepali/date_converter.py +22 -22
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_date_converter.py +17 -4
- {nepali-1.1.0 → nepali-1.1.2}/nepali.egg-info/PKG-INFO +14 -4
- {nepali-1.1.0 → nepali-1.1.2}/setup.py +1 -1
- {nepali-1.1.0 → nepali-1.1.2}/LICENSE +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/__init__.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/char.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/constants.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/__init__.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/_datetime.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/_formatter.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/_humanize.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/_nepalimonth.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/_nepaliweek.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/parser/__init__.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/parser/_parser.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/parser/validators.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/datetime/utils.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/exceptions.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/locations/__init__.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/locations/_data.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/locations/_locations.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/locations/models.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/locations/utils.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/number/__init__.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/number/_nepalinumber.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/number/_number.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/number/utils.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/phone_number.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/templatetags/__init__.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/templatetags/nepalidatetime.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/templatetags/nepalinumber.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/__init__.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_datetime.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_humanize.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_locations.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_nepalimonth.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_nepaliweek.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_number.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_parser.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_phone_number.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/tests/test_timezone.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/timezone.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali/utils.py +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali.egg-info/SOURCES.txt +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali.egg-info/dependency_links.txt +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/nepali.egg-info/top_level.txt +0 -0
- {nepali-1.1.0 → nepali-1.1.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: nepali
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
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
|
|
@@ -14,6 +14,16 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: keywords
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: project-url
|
|
26
|
+
Dynamic: summary
|
|
17
27
|
|
|
18
28
|
# nepali
|
|
19
29
|
|
|
@@ -310,7 +320,7 @@ np_datetime = parse("Jestha 15, 2079") # 2079-02-15 00:00:00
|
|
|
310
320
|
|
|
311
321
|
| Directive | Meaning | Example |
|
|
312
322
|
| --------- | --------------------------------------------------------- | ------------------------------ |
|
|
313
|
-
| `%
|
|
323
|
+
| `%a` | Weekday as locale’s abbreviated name. | Sun, Mon, …, Sat (आइत, सोम, …) |
|
|
314
324
|
| `%A` | Weekday as locale’s full name. | Sunday, Monday, …, Saturday |
|
|
315
325
|
| `%d` | Day of the month as a zero-padded decimal number. | 01, 02, …, 31 |
|
|
316
326
|
| `%-d` | Day of the month as a decimal number. | 1, 2, …, 31 |
|
|
@@ -456,4 +466,4 @@ We have created a new Django package called [django-nepali](https://github.com/o
|
|
|
456
466
|
|
|
457
467
|
## Contribution
|
|
458
468
|
|
|
459
|
-
We appreciate feedback and contribution to this package. To get started please see our [contribution guide](
|
|
469
|
+
We appreciate feedback and contribution to this package. To get started please see our [contribution guide](./CONTRIBUTING.md)
|
|
@@ -293,7 +293,7 @@ np_datetime = parse("Jestha 15, 2079") # 2079-02-15 00:00:00
|
|
|
293
293
|
|
|
294
294
|
| Directive | Meaning | Example |
|
|
295
295
|
| --------- | --------------------------------------------------------- | ------------------------------ |
|
|
296
|
-
| `%
|
|
296
|
+
| `%a` | Weekday as locale’s abbreviated name. | Sun, Mon, …, Sat (आइत, सोम, …) |
|
|
297
297
|
| `%A` | Weekday as locale’s full name. | Sunday, Monday, …, Saturday |
|
|
298
298
|
| `%d` | Day of the month as a zero-padded decimal number. | 01, 02, …, 31 |
|
|
299
299
|
| `%-d` | Day of the month as a decimal number. | 1, 2, …, 31 |
|
|
@@ -439,4 +439,4 @@ We have created a new Django package called [django-nepali](https://github.com/o
|
|
|
439
439
|
|
|
440
440
|
## Contribution
|
|
441
441
|
|
|
442
|
-
We appreciate feedback and contribution to this package. To get started please see our [contribution guide](
|
|
442
|
+
We appreciate feedback and contribution to this package. To get started please see our [contribution guide](./CONTRIBUTING.md)
|
|
@@ -78,7 +78,7 @@ class NepaliDateConverter:
|
|
|
78
78
|
((31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
79
79
|
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
80
80
|
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30), 365),
|
|
81
|
-
((31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31), 366),
|
|
81
|
+
((31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31), 366), # 2050
|
|
82
82
|
((31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
83
83
|
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
84
84
|
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30), 365),
|
|
@@ -98,7 +98,7 @@ class NepaliDateConverter:
|
|
|
98
98
|
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
99
99
|
((31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30), 365),
|
|
100
100
|
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31), 366),
|
|
101
|
-
((31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30), 365),
|
|
101
|
+
((31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30), 365), # 2070
|
|
102
102
|
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
103
103
|
((31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30), 365),
|
|
104
104
|
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31), 366),
|
|
@@ -108,27 +108,27 @@ class NepaliDateConverter:
|
|
|
108
108
|
((31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31), 366),
|
|
109
109
|
((31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
110
110
|
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
111
|
-
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30), 365),
|
|
112
|
-
((31,
|
|
113
|
-
((
|
|
114
|
-
((31, 31, 32, 31, 31,
|
|
115
|
-
((31, 31, 32, 31,
|
|
116
|
-
((
|
|
117
|
-
((
|
|
118
|
-
((31, 31, 32,
|
|
119
|
-
((
|
|
120
|
-
((30, 32, 31, 32, 31, 30, 30, 30, 29, 30,
|
|
121
|
-
((
|
|
122
|
-
((31, 31, 32,
|
|
123
|
-
((
|
|
124
|
-
((
|
|
125
|
-
((31, 31, 32, 31, 31,
|
|
126
|
-
((31, 31, 32,
|
|
127
|
-
((
|
|
128
|
-
((31,
|
|
129
|
-
((31, 31, 32, 31, 31, 31, 29, 30, 29, 30,
|
|
111
|
+
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 30), 365), # 2080
|
|
112
|
+
((31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31), 366), # 2081
|
|
113
|
+
((31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30), 365), # 2082
|
|
114
|
+
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
115
|
+
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31), 366),
|
|
116
|
+
((30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31), 365),
|
|
117
|
+
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
118
|
+
((31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30), 365),
|
|
119
|
+
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31), 366),
|
|
120
|
+
((30, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31), 365),
|
|
121
|
+
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
122
|
+
((31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30), 365),
|
|
123
|
+
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31), 366),
|
|
124
|
+
((31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 29, 31), 365),
|
|
125
|
+
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
126
|
+
((31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30), 365),
|
|
127
|
+
((31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31), 366),
|
|
128
|
+
((31, 31, 31, 32, 31, 31, 29, 30, 30, 29, 30, 30), 365),
|
|
129
|
+
((31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30), 365),
|
|
130
130
|
(
|
|
131
|
-
(31, 31, 32,
|
|
131
|
+
(31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30),
|
|
132
132
|
365,
|
|
133
133
|
), # 2099 BS - 2042/2043 AD
|
|
134
134
|
]
|
|
@@ -9,6 +9,7 @@ from nepali.date_converter import converter
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class TestNepaliDateConverter(unittest.TestCase):
|
|
12
|
+
"""tests for date_converter.converter module"""
|
|
12
13
|
# test date range
|
|
13
14
|
def test_english_date_range(self):
|
|
14
15
|
self.assertEqual(converter.en_min_year(), 1944)
|
|
@@ -49,6 +50,12 @@ class TestNepaliDateConverter(unittest.TestCase):
|
|
|
49
50
|
self.assertEqual(m, 4)
|
|
50
51
|
self.assertEqual(d, 29)
|
|
51
52
|
|
|
53
|
+
def test_converter_english_to_nepali_returns_valid_past_nepali_date2(self):
|
|
54
|
+
y, m, d = converter.english_to_nepali(1944, 5, 28)
|
|
55
|
+
self.assertEqual(y, 2001)
|
|
56
|
+
self.assertEqual(m, 2)
|
|
57
|
+
self.assertEqual(d, 15)
|
|
58
|
+
|
|
52
59
|
def test_converter_english_to_nepali_returns_valid_recent_nepali_date(self):
|
|
53
60
|
y, m, d = converter.english_to_nepali(2023, 1, 28)
|
|
54
61
|
self.assertEqual(y, 2079)
|
|
@@ -98,25 +105,31 @@ class TestNepaliDateConverter(unittest.TestCase):
|
|
|
98
105
|
with self.assertRaises(Exception):
|
|
99
106
|
converter.nepali_to_english(2079, 1, 40)
|
|
100
107
|
|
|
101
|
-
def
|
|
108
|
+
def test_converter_nepali_to_english_returns_valid_past_english_date(self):
|
|
102
109
|
y, m, d = converter.nepali_to_english(2051, 4, 29)
|
|
103
110
|
self.assertEqual(y, 1994)
|
|
104
111
|
self.assertEqual(m, 8)
|
|
105
112
|
self.assertEqual(d, 13)
|
|
106
113
|
|
|
107
|
-
def
|
|
114
|
+
def test_converter_nepali_to_english_returns_valid_past_english_date2(self):
|
|
115
|
+
y, m, d = converter.nepali_to_english(2001, 2, 15)
|
|
116
|
+
self.assertEqual(y, 1944)
|
|
117
|
+
self.assertEqual(m, 5)
|
|
118
|
+
self.assertEqual(d, 28)
|
|
119
|
+
|
|
120
|
+
def test_converter_nepali_to_english_returns_valid_recent_english_date(self):
|
|
108
121
|
y, m, d = converter.nepali_to_english(2079, 10, 14)
|
|
109
122
|
self.assertEqual(y, 2023)
|
|
110
123
|
self.assertEqual(m, 1)
|
|
111
124
|
self.assertEqual(d, 28)
|
|
112
125
|
|
|
113
|
-
def
|
|
126
|
+
def test_converter_nepali_to_english_returns_valid_future_english_date(self):
|
|
114
127
|
y, m, d = converter.nepali_to_english(2087, 8, 10)
|
|
115
128
|
self.assertEqual(y, 2030)
|
|
116
129
|
self.assertEqual(m, 11)
|
|
117
130
|
self.assertEqual(d, 26)
|
|
118
131
|
|
|
119
|
-
def
|
|
132
|
+
def test_converter_nepali_to_english_returns_valid_english_leap_year_date(self):
|
|
120
133
|
y, m, d = converter.nepali_to_english(2080, 12, 15)
|
|
121
134
|
self.assertEqual(y, 2024)
|
|
122
135
|
self.assertEqual(m, 3)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: nepali
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.2
|
|
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
|
|
@@ -14,6 +14,16 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: keywords
|
|
24
|
+
Dynamic: license
|
|
25
|
+
Dynamic: project-url
|
|
26
|
+
Dynamic: summary
|
|
17
27
|
|
|
18
28
|
# nepali
|
|
19
29
|
|
|
@@ -310,7 +320,7 @@ np_datetime = parse("Jestha 15, 2079") # 2079-02-15 00:00:00
|
|
|
310
320
|
|
|
311
321
|
| Directive | Meaning | Example |
|
|
312
322
|
| --------- | --------------------------------------------------------- | ------------------------------ |
|
|
313
|
-
| `%
|
|
323
|
+
| `%a` | Weekday as locale’s abbreviated name. | Sun, Mon, …, Sat (आइत, सोम, …) |
|
|
314
324
|
| `%A` | Weekday as locale’s full name. | Sunday, Monday, …, Saturday |
|
|
315
325
|
| `%d` | Day of the month as a zero-padded decimal number. | 01, 02, …, 31 |
|
|
316
326
|
| `%-d` | Day of the month as a decimal number. | 1, 2, …, 31 |
|
|
@@ -456,4 +466,4 @@ We have created a new Django package called [django-nepali](https://github.com/o
|
|
|
456
466
|
|
|
457
467
|
## Contribution
|
|
458
468
|
|
|
459
|
-
We appreciate feedback and contribution to this package. To get started please see our [contribution guide](
|
|
469
|
+
We appreciate feedback and contribution to this package. To get started please see our [contribution guide](./CONTRIBUTING.md)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|