toolbox-utils 5.1.4__tar.gz → 5.2.0__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 (73) hide show
  1. toolbox_utils-5.2.0/.github/dependabot.yml +7 -0
  2. toolbox_utils-5.2.0/.github/workflows/pypi-package.yml +49 -0
  3. toolbox_utils-5.2.0/.github/workflows/tests.yml +95 -0
  4. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.pre-commit-config.yaml +7 -7
  5. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/BADGES.rst +0 -5
  6. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/CHANGELOG.md +6 -0
  7. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/PKG-INFO +4 -7
  8. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/README.rst +0 -5
  9. toolbox_utils-5.2.0/VERSION +1 -0
  10. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/pyproject.toml +2 -1
  11. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/tsutils.py +49 -52
  12. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/PKG-INFO +4 -7
  13. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/requires.txt +1 -0
  14. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_date_slice.py +6 -3
  15. toolbox_utils-5.1.4/.github/dependabot.yml +0 -11
  16. toolbox_utils-5.1.4/.github/workflows/pypi-package.yml +0 -91
  17. toolbox_utils-5.1.4/.github/workflows/tests.yml +0 -58
  18. toolbox_utils-5.1.4/VERSION +0 -1
  19. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.deepsource.toml +0 -0
  20. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.github/workflows/clean-workflow-runs.yml +0 -0
  21. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.gitignore +0 -0
  22. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.sourcery.yaml +0 -0
  23. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/AUTHORS.rst +0 -0
  24. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/CONTRIBUTING.rst +0 -0
  25. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/LICENSE.txt +0 -0
  26. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/Makefile +0 -0
  27. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/authors.rst +0 -0
  28. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/conf.py +0 -0
  29. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/contributing.rst +0 -0
  30. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/index.rst +0 -0
  31. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/license.rst +0 -0
  32. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/make.bat +0 -0
  33. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/readme.rst +0 -0
  34. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/setup.cfg +0 -0
  35. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/__init__.py +0 -0
  36. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/readers/__init__.py +0 -0
  37. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/readers/hbn.py +0 -0
  38. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/readers/plotgen.py +0 -0
  39. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/readers/wdm.py +0 -0
  40. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/SOURCES.txt +0 -0
  41. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/dependency_links.txt +0 -0
  42. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/top_level.txt +0 -0
  43. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data.wdm +0 -0
  44. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_bi_daily.csv +0 -0
  45. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_bivl.hbn +0 -0
  46. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_end.bivl.csv +0 -0
  47. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_end.daily.csv +0 -0
  48. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_end.monthly.csv +0 -0
  49. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_end.yearly.csv +0 -0
  50. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_flow_stage.xlsx +0 -0
  51. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_period.bivl.csv +0 -0
  52. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_period.daily.csv +0 -0
  53. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_period.monthly.csv +0 -0
  54. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_period.yearly.csv +0 -0
  55. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_plotgen.plt +0 -0
  56. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_simple.csv +0 -0
  57. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_start.bivl.csv +0 -0
  58. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_start.daily.csv +0 -0
  59. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_start.monthly.csv +0 -0
  60. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_start.yearly.csv +0 -0
  61. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_wdm_1.csv +0 -0
  62. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_wdm_2.csv +0 -0
  63. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_yearly.hbn +0 -0
  64. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_asbestfreq.py +0 -0
  65. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_dateparse.py +0 -0
  66. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_extract.py +0 -0
  67. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_hbn.py +0 -0
  68. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_make_list.py +0 -0
  69. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_period_timestamp.py +0 -0
  70. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_plotgen.py +0 -0
  71. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_range_to_numlist.py +0 -0
  72. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_read.py +0 -0
  73. {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_wdm.py +0 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: github-actions
5
+ directory: /
6
+ schedule:
7
+ interval: weekly
@@ -0,0 +1,49 @@
1
+ ---
2
+ # This workflow will install Python dependencies, run tests and lint with
3
+ # a variety of Python versions For more information see:
4
+ # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
5
+
6
+ name: PyPI package tests
7
+
8
+ on: # yamllint disable-line rule:truthy
9
+ push:
10
+ branches: [main]
11
+ pull_request:
12
+ branches: [main]
13
+ workflow_dispatch:
14
+
15
+ jobs:
16
+ tests:
17
+ uses: ./.github/workflows/tests.yml
18
+
19
+ pypi-publish:
20
+ needs: tests
21
+ runs-on: ubuntu-latest
22
+ environment: release
23
+ name: upload release to PyPI
24
+
25
+ permissions:
26
+ # IMPORTANT: this permission is mandatory for trusted publishing
27
+ id-token: write
28
+
29
+ steps:
30
+ - name: Checkout source
31
+ uses: actions/checkout@v4
32
+ with:
33
+ submodules: recursive
34
+
35
+ - name: Build sdist and wheel
36
+ run: |
37
+ python -m pip install build
38
+ python -m build
39
+
40
+ - name: Download artifact
41
+ uses: actions/download-artifact@v4
42
+ with:
43
+ path: dist
44
+ merge-multiple: true
45
+
46
+ - name: Publish package distributions to PyPI
47
+ uses: pypa/gh-action-pypi-publish@release/v1
48
+ with:
49
+ skip-existing: true
@@ -0,0 +1,95 @@
1
+ ---
2
+ # This workflow will install Python dependencies, run tests and lint with
3
+ # a variety of Python versions For more information see:
4
+ # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
5
+
6
+ name: Tests
7
+
8
+ on: # yamllint disable-line rule:truthy
9
+ push:
10
+ branches: [develop]
11
+ pull_request:
12
+ branches: [develop]
13
+ workflow_dispatch:
14
+ workflow_call:
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ${{ matrix.os }}
19
+
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ os: [ubuntu-latest, macos-latest, windows-latest]
24
+ python-versions: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
25
+ pandas-versions: [1.5.3, 2.0.0, 2.2.0, 2.2.3]
26
+ toolchain:
27
+ - {compiler: gcc, version: 13}
28
+ exclude:
29
+ - python-versions: '3.13'
30
+ pandas-versions: 1.5.3
31
+ - python-versions: '3.13'
32
+ pandas-versions: 2.0.0
33
+ - python-versions: '3.13'
34
+ pandas-versions: 2.2.0
35
+ - python-versions: '3.8'
36
+ pandas-versions: 2.2.0
37
+ - python-versions: '3.8'
38
+ pandas-versions: 2.2.3
39
+ - os: windows-latest
40
+ python-versions: '3.8'
41
+ - os: windows-latest
42
+ python-versions: '3.9'
43
+ pandas-versions: 2.2.0
44
+ - os: windows-latest
45
+ python-versions: '3.10'
46
+ pandas-versions: 2.2.0
47
+ - os: windows-latest
48
+ python-versions: '3.11'
49
+ pandas-versions: 2.2.0
50
+ - os: windows-latest
51
+ python-versions: '3.12'
52
+ pandas-versions: 2.2.0
53
+ - os: windows-latest
54
+ python-versions: '3.13'
55
+
56
+ steps:
57
+ - name: Checkout repository
58
+ uses: actions/checkout@v4
59
+ with:
60
+ submodules: recursive
61
+
62
+ - name: Set up Python ${{ matrix.python-versions }}
63
+ uses: actions/setup-python@v5
64
+ with:
65
+ python-version: ${{ matrix.python-versions }}
66
+
67
+ - name: Install dependencies pytest
68
+ run: |
69
+ python -m pip install --upgrade pip
70
+ python -m pip install pytest pytest-cov
71
+
72
+ - name: >
73
+ Install package and dependencies
74
+ version ${{ matrix.pandas-versions }}
75
+ run: >
76
+ python -m pip install
77
+ pandas==${{ matrix.pandas-versions }} 'numpy<2' .
78
+
79
+ - name: Test with pytest
80
+ run: python -m pytest --cov
81
+
82
+ - name: Upload coverage data to coveralls.io
83
+ uses: coverallsapp/github-action@v2
84
+ with:
85
+ parallel: true
86
+
87
+ finish:
88
+ needs: test
89
+ if: ${{ always() }}
90
+ runs-on: ubuntu-latest
91
+ steps:
92
+ - name: Coveralls Finished
93
+ uses: coverallsapp/github-action@v2
94
+ with:
95
+ parallel-finished: true
@@ -11,7 +11,7 @@ exclude: |
11
11
 
12
12
  repos:
13
13
  - repo: https://github.com/pre-commit/pre-commit-hooks
14
- rev: v4.6.0
14
+ rev: v5.0.0
15
15
  hooks:
16
16
  - id: check-case-conflict
17
17
  - id: check-docstring-first
@@ -31,7 +31,7 @@ repos:
31
31
 
32
32
  - repo: https://github.com/astral-sh/ruff-pre-commit
33
33
  # Ruff version.
34
- rev: v0.4.10
34
+ rev: v0.9.3
35
35
  hooks:
36
36
  # Run the linter.
37
37
  - id: ruff
@@ -42,7 +42,7 @@ repos:
42
42
  types_or: [python, pyi, jupyter]
43
43
 
44
44
  - repo: https://github.com/pycqa/isort
45
- rev: 5.13.2
45
+ rev: 6.0.0
46
46
  hooks:
47
47
  - id: isort
48
48
  name: isort (python)
@@ -54,7 +54,7 @@ repos:
54
54
  types: [pyi]
55
55
 
56
56
  - repo: https://github.com/pappasam/toml-sort
57
- rev: v0.23.1
57
+ rev: v0.24.2
58
58
  hooks:
59
59
  - id: toml-sort-fix
60
60
  args: [--in-place, --spaces-indent-inline-array, '4']
@@ -83,17 +83,17 @@ repos:
83
83
  args: [--indent-size, '4']
84
84
 
85
85
  - repo: https://github.com/asottile/blacken-docs
86
- rev: 1.16.0
86
+ rev: 1.19.1
87
87
  hooks:
88
88
  - id: blacken-docs
89
89
 
90
90
  - repo: https://github.com/asottile/pyupgrade
91
- rev: v3.16.0
91
+ rev: v3.19.1
92
92
  hooks:
93
93
  - id: pyupgrade
94
94
 
95
95
  - repo: https://github.com/commitizen-tools/commitizen
96
- rev: v3.27.0
96
+ rev: v4.1.1
97
97
  hooks:
98
98
  - id: commitizen
99
99
  stages: [commit-msg]
@@ -18,11 +18,6 @@
18
18
  :target: https://pypi.python.org/pypi/toolbox_utils/
19
19
  :height: 20
20
20
 
21
- .. image:: http://img.shields.io/pypi/dd/toolbox_utils.svg
22
- :alt: toolbox_utils downloads
23
- :target: https://pypi.python.org/pypi/toolbox_utils/
24
- :height: 20
25
-
26
21
  .. image:: https://img.shields.io/pypi/pyversions/toolbox_utils
27
22
  :alt: PyPI - Python Version
28
23
  :target: https://pypi.org/project/toolbox_utils/
@@ -1,3 +1,9 @@
1
+ ## v5.2.0 (2025-05-10)
2
+
3
+ ### Feat
4
+
5
+ - added pandas_offset_by_version function
6
+
1
7
  ## v5.1.4 (2024-06-24)
2
8
 
3
9
  ### Fix
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: toolbox_utils
3
- Version: 5.1.4
3
+ Version: 5.2.0
4
4
  Summary: Python toolbox for common utilities
5
5
  Author-email: Tim Cera <tim@cerazone.net>
6
6
  License: BSD-3-Clause
@@ -30,12 +30,14 @@ Description-Content-Type: text/x-rst
30
30
  License-File: LICENSE.txt
31
31
  Requires-Dist: dateparser
32
32
  Requires-Dist: numpy<2.0,>=1.20; python_version <= "3.9"
33
+ Requires-Dist: openpyxl
33
34
  Requires-Dist: pandas[excel]
34
35
  Requires-Dist: pint!=0.21.*,<0.22; python_version < "3.9"
35
36
  Requires-Dist: pint-pandas
36
37
  Requires-Dist: pydantic
37
38
  Requires-Dist: scipy
38
39
  Requires-Dist: tabulate
40
+ Dynamic: license-file
39
41
 
40
42
  .. image:: https://github.com/timcera/toolbox_utils/actions/workflows/pypi-package.yml/badge.svg
41
43
  :alt: Tests
@@ -57,11 +59,6 @@ Requires-Dist: tabulate
57
59
  :target: https://pypi.python.org/pypi/toolbox_utils/
58
60
  :height: 20
59
61
 
60
- .. image:: http://img.shields.io/pypi/dd/toolbox_utils.svg
61
- :alt: toolbox_utils downloads
62
- :target: https://pypi.python.org/pypi/toolbox_utils/
63
- :height: 20
64
-
65
62
  .. image:: https://img.shields.io/pypi/pyversions/toolbox_utils
66
63
  :alt: PyPI - Python Version
67
64
  :target: https://pypi.org/project/toolbox_utils/
@@ -18,11 +18,6 @@
18
18
  :target: https://pypi.python.org/pypi/toolbox_utils/
19
19
  :height: 20
20
20
 
21
- .. image:: http://img.shields.io/pypi/dd/toolbox_utils.svg
22
- :alt: toolbox_utils downloads
23
- :target: https://pypi.python.org/pypi/toolbox_utils/
24
- :height: 20
25
-
26
21
  .. image:: https://img.shields.io/pypi/pyversions/toolbox_utils
27
22
  :alt: PyPI - Python Version
28
23
  :target: https://pypi.org/project/toolbox_utils/
@@ -0,0 +1 @@
1
+ 5.2.0
@@ -13,6 +13,7 @@ description = "Python toolbox for common utilities"
13
13
  dependencies = [
14
14
  "dateparser",
15
15
  "numpy >= 1.20, < 2.0 ; python_version <= '3.9'",
16
+ "openpyxl",
16
17
  "pandas[excel]",
17
18
  "pint != 0.21.*, < 0.22 ; python_version < '3.9'",
18
19
  "pint-pandas",
@@ -64,7 +65,7 @@ bitbucket = "https://bitbucket.org/timcera/toolbox_utils/src/main/"
64
65
  name = "cz_conventional_commits"
65
66
  tag_format = "v$version"
66
67
  update_changelog_on_bump = true
67
- version = "5.1.4"
68
+ version = "5.2.0"
68
69
  version_files = ["VERSION"]
69
70
 
70
71
  [tool.isort]
@@ -47,58 +47,55 @@ from .readers.wdm import wdm_extract as wdm
47
47
  # needed to use pint in pandas
48
48
  _ = pint_pandas.version("pint")
49
49
 
50
- new_to_old_freq = {}
51
- major, minor = pd.__version__.split(".")[:2]
52
- if (int(major) + int(minor) / 10) < 2.2:
53
- #
54
- # +--------------+--------------+
55
- # | Old | New |
56
- # +==============+==============+
57
- # | A | Y |
58
- # +--------------+--------------+
59
- # | M | ME |
60
- # +--------------+--------------+
61
- # | H | h |
62
- # +--------------+--------------+
63
- # | BH | bh |
64
- # +--------------+--------------+
65
- # | CBH | cbh |
66
- # +--------------+--------------+
67
- # | T | min |
68
- # +--------------+--------------+
69
- # | S | s |
70
- # +--------------+--------------+
71
- # | L | ms |
72
- # +--------------+--------------+
73
- # | U | us |
74
- # +--------------+--------------+
75
- # | N | ns |
76
- # +--------------+--------------+
77
- #
78
- new_to_old_freq = {
79
- "Y": "A",
80
- "ME": "M",
81
- "h": "H",
82
- "bh": "BH",
83
- "cbh": "CBH",
84
- "min": "T",
85
- "s": "S",
86
- "ms": "L",
87
- "us": "U",
88
- "ns": "N",
89
- "YE-JAN": "A-JAN",
90
- "YE-FEB": "A-FEB",
91
- "YE-MAR": "A-MAR",
92
- "YE-APR": "A-APR",
93
- "YE-MAY": "A-MAY",
94
- "YE-JUN": "A-JUN",
95
- "YE-JUL": "A-JUL",
96
- "YE-AUG": "A-AUG",
97
- "YE-SEP": "A-SEP",
98
- "YE-OCT": "A-OCT",
99
- "YE-NOV": "A-NOV",
100
- "YE-DEC": "A-DEC",
101
- }
50
+
51
+ def pandas_offset_by_version(new_offset: str) -> str:
52
+ """
53
+ Convert the time offset code to match the version of pandas.
54
+
55
+ Parameters
56
+ ----------
57
+ offset
58
+ The offset to convert.
59
+
60
+ Returns
61
+ -------
62
+ offset_by_version
63
+ The offset converted to the correct version of pandas.
64
+ """
65
+ new_to_old_freq = {}
66
+ major, minor = pd.__version__.split(".")[:2]
67
+ if (int(major) + int(minor) / 10) < 2.2:
68
+ new_to_old_freq = {
69
+ "Y": "A",
70
+ "ME": "M",
71
+ "BME": "BM",
72
+ "SME": "SM",
73
+ "CBME": "CBM",
74
+ "QE": "Q",
75
+ "BQE": "BQ",
76
+ "BYE": "BY",
77
+ "h": "H",
78
+ "bh": "BH",
79
+ "cbh": "CBH",
80
+ "min": "T",
81
+ "s": "S",
82
+ "ms": "L",
83
+ "us": "U",
84
+ "ns": "N",
85
+ "YE-JAN": "A-JAN",
86
+ "YE-FEB": "A-FEB",
87
+ "YE-MAR": "A-MAR",
88
+ "YE-APR": "A-APR",
89
+ "YE-MAY": "A-MAY",
90
+ "YE-JUN": "A-JUN",
91
+ "YE-JUL": "A-JUL",
92
+ "YE-AUG": "A-AUG",
93
+ "YE-SEP": "A-SEP",
94
+ "YE-OCT": "A-OCT",
95
+ "YE-NOV": "A-NOV",
96
+ "YE-DEC": "A-DEC",
97
+ }
98
+ return new_to_old_freq.get(new_offset, new_offset)
102
99
 
103
100
 
104
101
  def normalize_command_line_args(args: List) -> List:
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: toolbox_utils
3
- Version: 5.1.4
3
+ Version: 5.2.0
4
4
  Summary: Python toolbox for common utilities
5
5
  Author-email: Tim Cera <tim@cerazone.net>
6
6
  License: BSD-3-Clause
@@ -30,12 +30,14 @@ Description-Content-Type: text/x-rst
30
30
  License-File: LICENSE.txt
31
31
  Requires-Dist: dateparser
32
32
  Requires-Dist: numpy<2.0,>=1.20; python_version <= "3.9"
33
+ Requires-Dist: openpyxl
33
34
  Requires-Dist: pandas[excel]
34
35
  Requires-Dist: pint!=0.21.*,<0.22; python_version < "3.9"
35
36
  Requires-Dist: pint-pandas
36
37
  Requires-Dist: pydantic
37
38
  Requires-Dist: scipy
38
39
  Requires-Dist: tabulate
40
+ Dynamic: license-file
39
41
 
40
42
  .. image:: https://github.com/timcera/toolbox_utils/actions/workflows/pypi-package.yml/badge.svg
41
43
  :alt: Tests
@@ -57,11 +59,6 @@ Requires-Dist: tabulate
57
59
  :target: https://pypi.python.org/pypi/toolbox_utils/
58
60
  :height: 20
59
61
 
60
- .. image:: http://img.shields.io/pypi/dd/toolbox_utils.svg
61
- :alt: toolbox_utils downloads
62
- :target: https://pypi.python.org/pypi/toolbox_utils/
63
- :height: 20
64
-
65
62
  .. image:: https://img.shields.io/pypi/pyversions/toolbox_utils
66
63
  :alt: PyPI - Python Version
67
64
  :target: https://pypi.org/project/toolbox_utils/
@@ -1,4 +1,5 @@
1
1
  dateparser
2
+ openpyxl
2
3
  pandas[excel]
3
4
  pint-pandas
4
5
  pydantic
@@ -1,6 +1,7 @@
1
1
  import pandas as pd
2
2
  import pytest
3
3
  from pandas._libs.tslibs.parsing import DateParseError
4
+ from pandas.errors import ParserError
4
5
 
5
6
 
6
7
  @pytest.mark.parametrize(
@@ -56,14 +57,14 @@ from pandas._libs.tslibs.parsing import DateParseError
56
57
  "invalid_date",
57
58
  "2020-12-31",
58
59
  False,
59
- DateParseError,
60
+ (ValueError, ParserError, DateParseError),
60
61
  ),
61
62
  (
62
63
  pd.DataFrame(index=pd.date_range("2020-01-01", "2020-12-31")),
63
64
  "2020-01-01",
64
65
  "invalid_date",
65
66
  False,
66
- DateParseError,
67
+ (ValueError, ParserError, DateParseError),
67
68
  ),
68
69
  ],
69
70
  ids=[
@@ -88,7 +89,9 @@ def test_date_slice(input_tsd, start_date, end_date, por, expected):
88
89
  input_tsd = pd.DataFrame(index=pd.to_datetime(input_tsd.index))
89
90
 
90
91
  # Act
91
- if isinstance(expected, type) and issubclass(expected, Exception):
92
+ if isinstance(expected, tuple) or (
93
+ isinstance(expected, type) and issubclass(expected, Exception)
94
+ ):
92
95
  with pytest.raises(expected):
93
96
  _date_slice(input_tsd, start_date, end_date, por)
94
97
  else:
@@ -1,11 +0,0 @@
1
- ---
2
- version: 2
3
- updates:
4
- - package-ecosystem: github-actions
5
- directory: /
6
- schedule:
7
- interval: weekly
8
- ignore:
9
- # Optional: Official actions have moving tags like v1;
10
- # if you use those, you don't need updates.
11
- - dependency-name: actions/*
@@ -1,91 +0,0 @@
1
- ---
2
- # This workflow will install Python dependencies, run tests and lint with
3
- # a variety of Python versions For more information see:
4
- # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
5
-
6
- name: PyPI package tests
7
-
8
- on: # yamllint disable-line rule:truthy
9
- push:
10
- branches: [main]
11
- pull_request:
12
- branches: [main]
13
- workflow_dispatch:
14
-
15
- jobs:
16
- test:
17
- name: Test on Python ${{ matrix.python-version }}
18
- runs-on: ubuntu-latest
19
- strategy:
20
- fail-fast: false
21
- matrix:
22
- python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
23
-
24
- steps:
25
- - name: Checkout repository
26
- uses: actions/checkout@v4
27
- with:
28
- submodules: recursive
29
-
30
- - name: Set up Python ${{ matrix.python-version }}
31
- uses: actions/setup-python@v4
32
- with:
33
- python-version: ${{ matrix.python-version }}
34
-
35
- - name: Install dependencies
36
- run: |
37
- sudo apt-get update
38
- python -m pip install --upgrade pip
39
- python -m pip install pytest pytest-cov pytest-mpl
40
- python -m pip install -e .
41
-
42
- - name: Test with pytest
43
- run: |
44
- python -m pytest --cov --mpl
45
-
46
- - name: Upload coverage data to coveralls.io
47
- uses: coverallsapp/github-action@v2
48
- with:
49
- parallel: true
50
-
51
- finish_coveralls:
52
- needs: test
53
- if: ${{ always() }}
54
- runs-on: ubuntu-latest
55
- steps:
56
- - name: Coveralls Finished
57
- uses: coverallsapp/github-action@v2
58
- with:
59
- parallel-finished: true
60
-
61
- pypi-publish:
62
- needs: test
63
- runs-on: ubuntu-latest
64
- environment: release
65
- name: upload release to PyPI
66
-
67
- permissions:
68
- # IMPORTANT: this permission is mandatory for trusted publishing
69
- id-token: write
70
-
71
- steps:
72
- - name: Checkout source
73
- uses: actions/checkout@v4
74
- with:
75
- submodules: recursive
76
-
77
- - name: Build sdist and wheel
78
- run: |
79
- python -m pip install build
80
- python -m build
81
-
82
- - name: Download artifact
83
- uses: actions/download-artifact@v4
84
- with:
85
- path: dist
86
- merge-multiple: true
87
-
88
- - name: Publish package distributions to PyPI
89
- uses: pypa/gh-action-pypi-publish@release/v1
90
- with:
91
- skip-existing: true
@@ -1,58 +0,0 @@
1
- ---
2
- # This workflow will install Python dependencies, run tests and lint with
3
- # a variety of Python versions For more information see:
4
- # https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
5
-
6
- name: Tests
7
-
8
- on: # yamllint disable-line rule:truthy
9
- push:
10
- branches: [develop]
11
- pull_request:
12
- branches: [develop]
13
- workflow_dispatch:
14
-
15
- jobs:
16
- test:
17
- runs-on: ubuntu-latest
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
22
-
23
- steps:
24
- - name: Checkout repository
25
- uses: actions/checkout@v3
26
- with:
27
- submodules: recursive
28
-
29
- - name: Set up Python ${{ matrix.python-version }}
30
- uses: actions/setup-python@v4
31
- with:
32
- python-version: ${{ matrix.python-version }}
33
-
34
- - name: Install dependencies
35
- run: |
36
- sudo apt-get update
37
- python -m pip install --upgrade pip
38
- python -m pip install pytest pytest-cov pytest-mpl
39
- python -m pip install .
40
-
41
- - name: Test with pytest
42
- run: |
43
- python -m pytest --cov --mpl
44
-
45
- - name: Upload coverage data to coveralls.io
46
- uses: coverallsapp/github-action@v2
47
- with:
48
- parallel: true
49
-
50
- finish:
51
- needs: test
52
- if: ${{ always() }}
53
- runs-on: ubuntu-latest
54
- steps:
55
- - name: Coveralls Finished
56
- uses: coverallsapp/github-action@v2
57
- with:
58
- parallel-finished: true
@@ -1 +0,0 @@
1
- 5.1.4
File without changes
File without changes
File without changes
File without changes