libdev 0.94__tar.gz → 0.95__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 (40) hide show
  1. {libdev-0.94 → libdev-0.95}/PKG-INFO +1 -1
  2. {libdev-0.94 → libdev-0.95}/libdev/__init__.py +1 -1
  3. {libdev-0.94 → libdev-0.95}/libdev/time.py +6 -0
  4. {libdev-0.94 → libdev-0.95}/libdev.egg-info/PKG-INFO +1 -1
  5. {libdev-0.94 → libdev-0.95}/tests/test_time.py +9 -0
  6. {libdev-0.94 → libdev-0.95}/LICENSE +0 -0
  7. {libdev-0.94 → libdev-0.95}/README.md +0 -0
  8. {libdev-0.94 → libdev-0.95}/libdev/cfg.py +0 -0
  9. {libdev-0.94 → libdev-0.95}/libdev/check.py +0 -0
  10. {libdev-0.94 → libdev-0.95}/libdev/codes.py +0 -0
  11. {libdev-0.94 → libdev-0.95}/libdev/crypt.py +0 -0
  12. {libdev-0.94 → libdev-0.95}/libdev/dev.py +0 -0
  13. {libdev-0.94 → libdev-0.95}/libdev/doc.py +0 -0
  14. {libdev-0.94 → libdev-0.95}/libdev/fin.py +0 -0
  15. {libdev-0.94 → libdev-0.95}/libdev/gen.py +0 -0
  16. {libdev-0.94 → libdev-0.95}/libdev/img.py +0 -0
  17. {libdev-0.94 → libdev-0.95}/libdev/lang.py +0 -0
  18. {libdev-0.94 → libdev-0.95}/libdev/log.py +0 -0
  19. {libdev-0.94 → libdev-0.95}/libdev/num.py +0 -0
  20. {libdev-0.94 → libdev-0.95}/libdev/req.py +0 -0
  21. {libdev-0.94 → libdev-0.95}/libdev/s3.py +0 -0
  22. {libdev-0.94 → libdev-0.95}/libdev.egg-info/SOURCES.txt +0 -0
  23. {libdev-0.94 → libdev-0.95}/libdev.egg-info/dependency_links.txt +0 -0
  24. {libdev-0.94 → libdev-0.95}/libdev.egg-info/requires.txt +0 -0
  25. {libdev-0.94 → libdev-0.95}/libdev.egg-info/top_level.txt +0 -0
  26. {libdev-0.94 → libdev-0.95}/setup.cfg +0 -0
  27. {libdev-0.94 → libdev-0.95}/setup.py +0 -0
  28. {libdev-0.94 → libdev-0.95}/tests/test_cfg.py +0 -0
  29. {libdev-0.94 → libdev-0.95}/tests/test_check.py +0 -0
  30. {libdev-0.94 → libdev-0.95}/tests/test_codes.py +0 -0
  31. {libdev-0.94 → libdev-0.95}/tests/test_crypt.py +0 -0
  32. {libdev-0.94 → libdev-0.95}/tests/test_dev.py +0 -0
  33. {libdev-0.94 → libdev-0.95}/tests/test_doc.py +0 -0
  34. {libdev-0.94 → libdev-0.95}/tests/test_gen.py +0 -0
  35. {libdev-0.94 → libdev-0.95}/tests/test_img.py +0 -0
  36. {libdev-0.94 → libdev-0.95}/tests/test_lang.py +0 -0
  37. {libdev-0.94 → libdev-0.95}/tests/test_log.py +0 -0
  38. {libdev-0.94 → libdev-0.95}/tests/test_num.py +0 -0
  39. {libdev-0.94 → libdev-0.95}/tests/test_req.py +0 -0
  40. {libdev-0.94 → libdev-0.95}/tests/test_s3.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libdev
3
- Version: 0.94
3
+ Version: 0.95
4
4
  Summary: Set of standard functions for development
5
5
  Home-page: https://github.com/chilleco/lib
6
6
  Author: Alex Poloz
@@ -2,6 +2,6 @@
2
2
  Initializing the Python package
3
3
  """
4
4
 
5
- __version__ = "0.94"
5
+ __version__ = "0.95"
6
6
 
7
7
  __all__ = ("__version__",)
@@ -380,3 +380,9 @@ def get_next_month(timestamp=None, tz=0):
380
380
  )
381
381
 
382
382
  return int(next_month.timestamp())
383
+
384
+
385
+ def get_delta_days(start, end, digits=0):
386
+ """Get the number of days between two timestamps"""
387
+ delta = round((end - start) / (24 * 60 * 60), digits)
388
+ return delta if delta % 1 else int(delta)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: libdev
3
- Version: 0.94
3
+ Version: 0.95
4
4
  Summary: Set of standard functions for development
5
5
  Home-page: https://github.com/chilleco/lib
6
6
  Author: Alex Poloz
@@ -15,6 +15,7 @@ from libdev.time import (
15
15
  get_month_start,
16
16
  get_next_day,
17
17
  get_next_month,
18
+ get_delta_days,
18
19
  )
19
20
 
20
21
 
@@ -128,3 +129,11 @@ def test_get_next_day():
128
129
  def test_get_next_month():
129
130
  assert get_next_month(1703980800) == 1704067200
130
131
  assert get_next_month(1703970000, tz=3) == 1704056400
132
+
133
+
134
+ def test_get_delta_days():
135
+ assert get_delta_days(1756670400, 1759262400) == 30
136
+ assert isinstance(get_delta_days(1756670400, 1759262400, 0), int)
137
+ assert isinstance(get_delta_days(1756670400, 1759262401, 1), int)
138
+ assert isinstance(get_delta_days(1756670400, 1759262401, 0), int)
139
+ assert isinstance(get_delta_days(1756670400, 1759263511, 2), float)
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