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.
- toolbox_utils-5.2.0/.github/dependabot.yml +7 -0
- toolbox_utils-5.2.0/.github/workflows/pypi-package.yml +49 -0
- toolbox_utils-5.2.0/.github/workflows/tests.yml +95 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.pre-commit-config.yaml +7 -7
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/BADGES.rst +0 -5
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/CHANGELOG.md +6 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/PKG-INFO +4 -7
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/README.rst +0 -5
- toolbox_utils-5.2.0/VERSION +1 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/pyproject.toml +2 -1
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/tsutils.py +49 -52
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/PKG-INFO +4 -7
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/requires.txt +1 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_date_slice.py +6 -3
- toolbox_utils-5.1.4/.github/dependabot.yml +0 -11
- toolbox_utils-5.1.4/.github/workflows/pypi-package.yml +0 -91
- toolbox_utils-5.1.4/.github/workflows/tests.yml +0 -58
- toolbox_utils-5.1.4/VERSION +0 -1
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.deepsource.toml +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.github/workflows/clean-workflow-runs.yml +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.gitignore +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/.sourcery.yaml +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/AUTHORS.rst +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/CONTRIBUTING.rst +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/LICENSE.txt +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/Makefile +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/authors.rst +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/conf.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/contributing.rst +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/index.rst +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/license.rst +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/make.bat +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/docs/readme.rst +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/setup.cfg +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/__init__.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/readers/__init__.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/readers/hbn.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/readers/plotgen.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils/readers/wdm.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/SOURCES.txt +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/dependency_links.txt +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/src/toolbox_utils.egg-info/top_level.txt +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data.wdm +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_bi_daily.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_bivl.hbn +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_end.bivl.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_end.daily.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_end.monthly.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_end.yearly.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_flow_stage.xlsx +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_period.bivl.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_period.daily.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_period.monthly.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_period.yearly.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_plotgen.plt +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_simple.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_start.bivl.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_start.daily.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_start.monthly.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_start.yearly.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_wdm_1.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_wdm_2.csv +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/data_yearly.hbn +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_asbestfreq.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_dateparse.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_extract.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_hbn.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_make_list.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_period_timestamp.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_plotgen.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_range_to_numlist.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_read.py +0 -0
- {toolbox_utils-5.1.4 → toolbox_utils-5.2.0}/tests/test_wdm.py +0 -0
|
@@ -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:
|
|
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.
|
|
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:
|
|
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.
|
|
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.
|
|
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.
|
|
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:
|
|
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,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: toolbox_utils
|
|
3
|
-
Version: 5.
|
|
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.
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: toolbox_utils
|
|
3
|
-
Version: 5.
|
|
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,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,
|
|
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,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
|
toolbox_utils-5.1.4/VERSION
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5.1.4
|
|
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
|
|
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
|