python-time-functions 2.1.1__tar.gz → 2.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.
Files changed (19) hide show
  1. python_time_functions-2.1.2/PKG-INFO +47 -0
  2. python_time_functions-2.1.2/README.md +30 -0
  3. python_time_functions-2.1.2/pyproject.toml +24 -0
  4. {python_time_functions-2.1.1/src/time_fuctions_cornebester → python_time_functions-2.1.2/src/python_time_fuctions}/time_functions.py +8 -2
  5. python_time_functions-2.1.2/src/python_time_functions.egg-info/PKG-INFO +47 -0
  6. {python_time_functions-2.1.1 → python_time_functions-2.1.2}/src/python_time_functions.egg-info/SOURCES.txt +3 -2
  7. python_time_functions-2.1.2/src/python_time_functions.egg-info/requires.txt +2 -0
  8. python_time_functions-2.1.2/src/python_time_functions.egg-info/top_level.txt +1 -0
  9. {python_time_functions-2.1.1 → python_time_functions-2.1.2}/tests/test_time_function_sanitizer.py +1 -1
  10. {python_time_functions-2.1.1 → python_time_functions-2.1.2}/tests/test_time_functions.py +1 -1
  11. python_time_functions-2.1.1/PKG-INFO +0 -8
  12. python_time_functions-2.1.1/README.md +0 -46
  13. python_time_functions-2.1.1/pyproject.toml +0 -14
  14. python_time_functions-2.1.1/src/python_time_functions.egg-info/PKG-INFO +0 -8
  15. python_time_functions-2.1.1/src/python_time_functions.egg-info/top_level.txt +0 -1
  16. {python_time_functions-2.1.1 → python_time_functions-2.1.2}/LICENSE +0 -0
  17. {python_time_functions-2.1.1 → python_time_functions-2.1.2}/setup.cfg +0 -0
  18. {python_time_functions-2.1.1/src/time_fuctions_cornebester → python_time_functions-2.1.2/src/python_time_fuctions}/__init__.py +0 -0
  19. {python_time_functions-2.1.1 → python_time_functions-2.1.2}/src/python_time_functions.egg-info/dependency_links.txt +0 -0
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.4
2
+ Name: python_time_functions
3
+ Version: 2.1.2
4
+ Summary: Common Python functions for time handling
5
+ Author-email: Corne Bester <corne.bester@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://example.com
8
+ Project-URL: Documentation, https://readthedocs.org
9
+ Project-URL: Repository, https://github.com/cornebester/python_time_functions
10
+ Project-URL: Issues, https://github.com/cornebester/python_time_functions/issues
11
+ Project-URL: Changelog, https://github.com/cornebester/python_time_functions/blob/master/CHANGELOG.md
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: datetime
15
+ Requires-Dist: timezone
16
+ Dynamic: license-file
17
+
18
+ # python_time_functions
19
+
20
+ example
21
+
22
+ ```
23
+ from datetime import datetime, timezone
24
+ from time_functions import get_timestamp_unix_millis
25
+ # OR
26
+ import time_functions
27
+
28
+ timestamp = datetime.now(timezone.utc)
29
+ unix_millis = get_timestamp_unix_millis(timestamp) # create unix timestamp from obj above
30
+
31
+ ```
32
+
33
+ ## local dev
34
+
35
+ pip install -r requirements.txt
36
+
37
+
38
+ ## test
39
+
40
+ pytest
41
+
42
+
43
+ ### other
44
+
45
+ pip3 freeze > requirements.txt
46
+
47
+
@@ -0,0 +1,30 @@
1
+ # python_time_functions
2
+
3
+ example
4
+
5
+ ```
6
+ from datetime import datetime, timezone
7
+ from time_functions import get_timestamp_unix_millis
8
+ # OR
9
+ import time_functions
10
+
11
+ timestamp = datetime.now(timezone.utc)
12
+ unix_millis = get_timestamp_unix_millis(timestamp) # create unix timestamp from obj above
13
+
14
+ ```
15
+
16
+ ## local dev
17
+
18
+ pip install -r requirements.txt
19
+
20
+
21
+ ## test
22
+
23
+ pytest
24
+
25
+
26
+ ### other
27
+
28
+ pip3 freeze > requirements.txt
29
+
30
+
@@ -0,0 +1,24 @@
1
+ [build-system]
2
+ requires = ["setuptools>=65.5.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "python_time_functions"
7
+ version = "2.1.2"
8
+ description = "Common Python functions for time handling"
9
+ readme = "README.md"
10
+ authors = [{name = "Corne Bester", email = "corne.bester@gmail.com"}]
11
+ dependencies = [
12
+ "datetime",
13
+ "timezone"
14
+ ]
15
+ license = "MIT"
16
+ license-files = ["LICEN[CS]E*"]
17
+
18
+ [project.urls]
19
+ Homepage = "https://example.com"
20
+ Documentation = "https://readthedocs.org"
21
+ Repository = "https://github.com/cornebester/python_time_functions"
22
+ Issues = "https://github.com/cornebester/python_time_functions/issues"
23
+ Changelog = "https://github.com/cornebester/python_time_functions/blob/master/CHANGELOG.md"
24
+
@@ -241,8 +241,14 @@ def timestamp_parser_psql_millis(timestamp):
241
241
  def timestamp_sanitizer_psql(input):
242
242
  '''
243
243
  Normalize unix timestamps to postgresl friendly float with millisecond decimals. 14 digits
244
- Attemps to fix/sanitize bad timestamps
245
- handle timestamnp as:
244
+ Attemps to fix/sanitize bad timestamp format I dreamed up like
245
+ >>> time_functions.timestamp_sanitizer_psql(1729755232184)
246
+ 1729755232.184
247
+ >>> time_functions.timestamp_sanitizer_psql(1729765227856.3)
248
+ 1729765227.856
249
+ >>> time_functions.timestamp_sanitizer_psql(1729765228327.051)
250
+ 1729765228.327
251
+ handle timestamp as:
246
252
  unix micros or millis in decimal format
247
253
  unix millis or micros in unix format
248
254
  iso8601
@@ -0,0 +1,47 @@
1
+ Metadata-Version: 2.4
2
+ Name: python_time_functions
3
+ Version: 2.1.2
4
+ Summary: Common Python functions for time handling
5
+ Author-email: Corne Bester <corne.bester@gmail.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://example.com
8
+ Project-URL: Documentation, https://readthedocs.org
9
+ Project-URL: Repository, https://github.com/cornebester/python_time_functions
10
+ Project-URL: Issues, https://github.com/cornebester/python_time_functions/issues
11
+ Project-URL: Changelog, https://github.com/cornebester/python_time_functions/blob/master/CHANGELOG.md
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: datetime
15
+ Requires-Dist: timezone
16
+ Dynamic: license-file
17
+
18
+ # python_time_functions
19
+
20
+ example
21
+
22
+ ```
23
+ from datetime import datetime, timezone
24
+ from time_functions import get_timestamp_unix_millis
25
+ # OR
26
+ import time_functions
27
+
28
+ timestamp = datetime.now(timezone.utc)
29
+ unix_millis = get_timestamp_unix_millis(timestamp) # create unix timestamp from obj above
30
+
31
+ ```
32
+
33
+ ## local dev
34
+
35
+ pip install -r requirements.txt
36
+
37
+
38
+ ## test
39
+
40
+ pytest
41
+
42
+
43
+ ### other
44
+
45
+ pip3 freeze > requirements.txt
46
+
47
+
@@ -1,11 +1,12 @@
1
1
  LICENSE
2
2
  README.md
3
3
  pyproject.toml
4
+ src/python_time_fuctions/__init__.py
5
+ src/python_time_fuctions/time_functions.py
4
6
  src/python_time_functions.egg-info/PKG-INFO
5
7
  src/python_time_functions.egg-info/SOURCES.txt
6
8
  src/python_time_functions.egg-info/dependency_links.txt
9
+ src/python_time_functions.egg-info/requires.txt
7
10
  src/python_time_functions.egg-info/top_level.txt
8
- src/time_fuctions_cornebester/__init__.py
9
- src/time_fuctions_cornebester/time_functions.py
10
11
  tests/test_time_function_sanitizer.py
11
12
  tests/test_time_functions.py
@@ -1,4 +1,4 @@
1
- import src.time_fuctions_cornebester.time_functions as time_functions
1
+ import src.python_time_fuctions.time_functions as time_functions
2
2
 
3
3
  def test_convertions_from_sample23():
4
4
  assert float(time_functions.timestamp_sanitizer_psql(1742758997)) == 1742758997
@@ -1,6 +1,6 @@
1
1
  import logging
2
2
  from datetime import datetime, timezone
3
- import src.time_fuctions_cornebester.time_functions as time_functions
3
+ import src.python_time_fuctions.time_functions as time_functions
4
4
 
5
5
 
6
6
  new_obj = datetime.now(timezone.utc)
@@ -1,8 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python_time_functions
3
- Version: 2.1.1
4
- Summary: Common Python functions for time handling
5
- Author-email: Corne Bester <corne.bester@gmail.com>
6
- License-Expression: MIT
7
- License-File: LICENSE
8
- Dynamic: license-file
@@ -1,46 +0,0 @@
1
- # python_time_functions
2
-
3
- example
4
-
5
- ```
6
- from datetime import datetime, timezone
7
- from modules.time_functions import get_timestamp_unix_millis
8
- # OR
9
- from time_functions import get_timestamp_unix_millis
10
- # OR
11
- import time_functions
12
-
13
- timestamp = datetime.now(timezone.utc)
14
- unix_millis = get_timestamp_unix_millis(timestamp) # create unix timestamp from obj above
15
-
16
- ```
17
-
18
- ## local dev
19
-
20
- pip install pytest build
21
-
22
- ## test
23
-
24
- pytest
25
-
26
- ## build ( create dist artifacts )
27
-
28
- python -m build
29
-
30
- ## install from location
31
-
32
- python -m pip install "C:\Users\corne\Documents\GitHub\python_time_functions\dist\pythom_time_functions-2.1.0-py3-none-any.whl"
33
-
34
-
35
- ### other
36
-
37
- pip3 freeze > requirements.txt
38
-
39
- ## bad formats I dreamed up for iot/psql. fix with sanitizer fx
40
-
41
- >>> time_functions.timestamp_sanitizer_psql(1729755232184)
42
- 1729755232.184
43
- >>> time_functions.timestamp_sanitizer_psql(1729765227856.3)
44
- 1729765227.856
45
- >>> time_functions.timestamp_sanitizer_psql(1729765228327.051)
46
- 1729765228.327
@@ -1,14 +0,0 @@
1
- [build-system]
2
- requires = ["setuptools>=65.5.0"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "python_time_functions"
7
- version = "2.1.1"
8
- description = "Common Python functions for time handling"
9
- authors = [{name = "Corne Bester", email = "corne.bester@gmail.com"}]
10
- dependencies = [
11
- ]
12
-
13
- license = "MIT"
14
- license-files = ["LICEN[CS]E*"]
@@ -1,8 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: python_time_functions
3
- Version: 2.1.1
4
- Summary: Common Python functions for time handling
5
- Author-email: Corne Bester <corne.bester@gmail.com>
6
- License-Expression: MIT
7
- License-File: LICENSE
8
- Dynamic: license-file
@@ -1 +0,0 @@
1
- time_fuctions_cornebester