seecr-stdlib 0.6.4__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 (31) hide show
  1. seecr_stdlib-0.6.4/.github/workflows/publish.yml +39 -0
  2. seecr_stdlib-0.6.4/.github/workflows/test.yml +22 -0
  3. seecr_stdlib-0.6.4/.gitignore +5 -0
  4. seecr_stdlib-0.6.4/CLAUDE.md +30 -0
  5. seecr_stdlib-0.6.4/LICENSE +674 -0
  6. seecr_stdlib-0.6.4/PKG-INFO +132 -0
  7. seecr_stdlib-0.6.4/README.md +106 -0
  8. seecr_stdlib-0.6.4/doc/license.conf +8 -0
  9. seecr_stdlib-0.6.4/pyproject.toml +51 -0
  10. seecr_stdlib-0.6.4/seecr_stdlib/.gitignore +1 -0
  11. seecr_stdlib-0.6.4/seecr_stdlib/__init__.py +25 -0
  12. seecr_stdlib-0.6.4/seecr_stdlib/_version.py +24 -0
  13. seecr_stdlib-0.6.4/seecr_stdlib/config.py +78 -0
  14. seecr_stdlib-0.6.4/seecr_stdlib/config_test.py +120 -0
  15. seecr_stdlib-0.6.4/seecr_stdlib/dict.py +63 -0
  16. seecr_stdlib-0.6.4/seecr_stdlib/dict_test.py +101 -0
  17. seecr_stdlib-0.6.4/seecr_stdlib/first.py +25 -0
  18. seecr_stdlib-0.6.4/seecr_stdlib/first_test.py +29 -0
  19. seecr_stdlib-0.6.4/seecr_stdlib/format/__init__.py +24 -0
  20. seecr_stdlib-0.6.4/seecr_stdlib/format/date.py +155 -0
  21. seecr_stdlib-0.6.4/seecr_stdlib/format/date_test.py +147 -0
  22. seecr_stdlib-0.6.4/seecr_stdlib/time.py +73 -0
  23. seecr_stdlib-0.6.4/seecr_stdlib/time_test.py +84 -0
  24. seecr_stdlib-0.6.4/seecr_stdlib.egg-info/PKG-INFO +132 -0
  25. seecr_stdlib-0.6.4/seecr_stdlib.egg-info/SOURCES.txt +29 -0
  26. seecr_stdlib-0.6.4/seecr_stdlib.egg-info/dependency_links.txt +1 -0
  27. seecr_stdlib-0.6.4/seecr_stdlib.egg-info/requires.txt +2 -0
  28. seecr_stdlib-0.6.4/seecr_stdlib.egg-info/scm_file_list.json +25 -0
  29. seecr_stdlib-0.6.4/seecr_stdlib.egg-info/scm_version.json +8 -0
  30. seecr_stdlib-0.6.4/seecr_stdlib.egg-info/top_level.txt +1 -0
  31. seecr_stdlib-0.6.4/setup.cfg +4 -0
@@ -0,0 +1,39 @@
1
+ name: Publish to PyPI
2
+
3
+ # Publishes when a MAJOR.MINOR.PATCH tag (e.g. 0.6.4) is pushed. The tag
4
+ # becomes the package version via setuptools_scm.
5
+ on:
6
+ push:
7
+ tags: ["[0-9]+.[0-9]+.[0-9]+"]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v5
14
+ with:
15
+ fetch-depth: 0
16
+ - uses: actions/setup-python@v6
17
+ with:
18
+ python-version: "3.13"
19
+ - run: pip install build
20
+ - run: python -m build
21
+ - uses: actions/upload-artifact@v4
22
+ with:
23
+ name: dist
24
+ path: dist/
25
+
26
+ publish:
27
+ needs: build
28
+ runs-on: ubuntu-latest
29
+ environment:
30
+ name: pypi
31
+ url: https://pypi.org/project/seecr-stdlib/
32
+ permissions:
33
+ id-token: write # PyPI trusted publishing, no API token needed
34
+ steps:
35
+ - uses: actions/download-artifact@v4
36
+ with:
37
+ name: dist
38
+ path: dist/
39
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,22 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
14
+ steps:
15
+ - uses: actions/checkout@v5
16
+ with:
17
+ fetch-depth: 0 # setuptools_scm needs the tags
18
+ - uses: actions/setup-python@v6
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+ - run: pip install -e .
22
+ - run: python -m pytest
@@ -0,0 +1,5 @@
1
+ env/
2
+ *.egg-info/
3
+ dist/
4
+ __pycache__/
5
+ .pytest_cache/
@@ -0,0 +1,30 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Overview
6
+
7
+ `seecr-stdlib` is a small Python (>=3.11) utility library shared across Seecr projects: `Dict` (attribute-access dict), `first`, `Config` (dotted-path JSON config access), `time` helpers (UTC/local conversion), and `format.format_date` (date formatting styles, usable as a Jinja filter). Runtime dependencies are only `python-dateutil` and `pytest`.
8
+
9
+ ## Commands
10
+
11
+ A virtualenv lives in `env/`.
12
+
13
+ ```sh
14
+ env/bin/python -m pytest # all tests
15
+ env/bin/python -m pytest seecr_stdlib/config_test.py # one file
16
+ env/bin/python -m pytest seecr_stdlib/dict_test.py::test_dict # one test
17
+ ```
18
+
19
+ Formatting follows black (isort is configured with `profile = "black"`).
20
+
21
+ ## Conventions
22
+
23
+ - Tests sit next to the module they test as `<module>_test.py` (not in a separate `tests/` dir), written as plain pytest functions, often with `@pytest.mark.parametrize`.
24
+ - Every source file starts with the GPLv3 `## begin license ## ... ## end license ##` header (template data in `doc/license.conf`). Copy it into new files and keep the copyright year(s) current.
25
+ - Versions come from git tags via `setuptools_scm` (tags like `0.6.3`); `seecr_stdlib/_version.py` is generated and git-ignored — don't edit it.
26
+ - Pushing a version tag to GitHub publishes that version to PyPI (`.github/workflows/publish.yml`), and PyPI never accepts a version twice. Don't push tags unless asked.
27
+ - Only `Dict` and `first` are re-exported from the package root; other modules are imported by path (`seecr_stdlib.config`, `seecr_stdlib.time`, `seecr_stdlib.format`).
28
+ - `format_date` dispatches through the `styles` dict in `format/date.py`; add new styles (and their short aliases like `nl-t`) there. Unknown styles fall back to ISO date. Dutch styles convert aware datetimes to `Europe/Amsterdam` when showing time.
29
+ - `Config(path)` is deprecated in favour of `Config.read(path, ...)`; `Config.get` resolves dotted keys including list indices (`"a.values.0"`), returning `default` for missing/`None` values.
30
+ - `Dict` deliberately never lets keys shadow dict methods and refuses attribute-assignment of method names; preserve that behaviour.