codex-usage-epd 2026.10.1__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 (28) hide show
  1. codex_usage_epd-2026.10.1/.github/workflows/release.yml +46 -0
  2. codex_usage_epd-2026.10.1/.gitignore +14 -0
  3. codex_usage_epd-2026.10.1/.pre-commit-config.yaml +13 -0
  4. codex_usage_epd-2026.10.1/AGENTS.md +54 -0
  5. codex_usage_epd-2026.10.1/LICENSE +661 -0
  6. codex_usage_epd-2026.10.1/PKG-INFO +179 -0
  7. codex_usage_epd-2026.10.1/README.md +153 -0
  8. codex_usage_epd-2026.10.1/assets/demo.jpeg +0 -0
  9. codex_usage_epd-2026.10.1/codex_usage_epd/__init__.py +3 -0
  10. codex_usage_epd-2026.10.1/codex_usage_epd/__main__.py +4 -0
  11. codex_usage_epd-2026.10.1/codex_usage_epd/api.py +258 -0
  12. codex_usage_epd-2026.10.1/codex_usage_epd/ble.py +345 -0
  13. codex_usage_epd-2026.10.1/codex_usage_epd/cli.py +270 -0
  14. codex_usage_epd-2026.10.1/codex_usage_epd/config.py +127 -0
  15. codex_usage_epd-2026.10.1/codex_usage_epd/model.py +73 -0
  16. codex_usage_epd-2026.10.1/codex_usage_epd/render.py +321 -0
  17. codex_usage_epd-2026.10.1/codex_usage_epd/rle.py +91 -0
  18. codex_usage_epd-2026.10.1/codex_usage_epd/token_usage.py +438 -0
  19. codex_usage_epd-2026.10.1/config/codex_usage_epd.yaml.example +30 -0
  20. codex_usage_epd-2026.10.1/deploy/com.codex-usage-epd.plist.in +35 -0
  21. codex_usage_epd-2026.10.1/deploy/install.sh +20 -0
  22. codex_usage_epd-2026.10.1/docs/development.md +78 -0
  23. codex_usage_epd-2026.10.1/pyproject.toml +53 -0
  24. codex_usage_epd-2026.10.1/tests/check-history.yaml +3 -0
  25. codex_usage_epd-2026.10.1/tests/check-today.yaml +3 -0
  26. codex_usage_epd-2026.10.1/tests/test_cli.py +42 -0
  27. codex_usage_epd-2026.10.1/tests/test_token_usage.py +209 -0
  28. codex_usage_epd-2026.10.1/uv.lock +1074 -0
@@ -0,0 +1,46 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ jobs:
11
+ build:
12
+ name: Build distributions
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v7
16
+ - uses: astral-sh/setup-uv@v10.3.2
17
+ - name: Check release tag matches package version
18
+ run: |
19
+ version="$(python -c 'from codex_usage_epd import __version__; print(__version__)')"
20
+ tag_version="${GITHUB_REF_NAME#v}"
21
+ if [ "$tag_version" != "$version" ]; then
22
+ echo "Release tag v$tag_version does not match package version $version" >&2
23
+ exit 1
24
+ fi
25
+ - name: Build distributions
26
+ run: uv build
27
+ - uses: actions/upload-artifact@v7
28
+ with:
29
+ name: python-package-distributions
30
+ path: dist/
31
+
32
+ publish:
33
+ name: Publish distributions to PyPI
34
+ needs: build
35
+ runs-on: ubuntu-latest
36
+ environment:
37
+ name: pypi
38
+ url: https://pypi.org/p/codex-usage-epd
39
+ permissions:
40
+ id-token: write
41
+ steps:
42
+ - uses: actions/download-artifact@v8
43
+ with:
44
+ name: python-package-distributions
45
+ path: dist/
46
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,14 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .pytest_cache/
8
+ preview.png
9
+ usage_dump.json
10
+ tmp/
11
+ logs/
12
+ config/codex_usage_epd.yaml
13
+ .DS_Store
14
+ uv.toml
@@ -0,0 +1,13 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: ruff
5
+ name: Ruff
6
+ entry: uv run ruff check . --no-cache
7
+ language: system
8
+ pass_filenames: false
9
+ - id: pyright
10
+ name: Pyright
11
+ entry: uv run pyright
12
+ language: system
13
+ pass_filenames: false
@@ -0,0 +1,54 @@
1
+ # Repository Guidelines
2
+
3
+ ## Project Structure & Module Organization
4
+
5
+ This is a Python 3.10+ macOS utility managed with `uv`. Application code is in
6
+ `codex_usage_epd/`: `cli.py` and `__main__.py` provide the command-line entry
7
+ point, `api.py` and `token_usage.py` collect usage data, `model.py` defines data
8
+ structures, `render.py` produces the 400×300 B/W/R dashboard, and `ble.py` and
9
+ `rle.py` implement display transport and encoding. Tests are in `tests/`.
10
+ `config/` contains the example YAML configuration, `deploy/` contains the
11
+ launchd installer and plist template, and `assets/` holds documentation media.
12
+ Generated configuration, logs, previews, and debug dumps are local artifacts
13
+ and should not be committed.
14
+
15
+ ## Build, Test, and Development Commands
16
+
17
+ Use the locked environment for reproducible work:
18
+
19
+ ```sh
20
+ uv sync --locked # install runtime and development dependencies
21
+ uv run pytest # run the test suite
22
+ uv run ruff check . # lint Python sources
23
+ uv run pyright # run static type checking
24
+ uv run pre-commit run --all-files # run configured checks together
25
+ uv run codex-usage-epd --selftest # exercise rendering/encoding without hardware
26
+ uv build # build sdist and wheel in dist/
27
+ ```
28
+
29
+ For a local integration check, `uv run codex-usage-epd --dry-run` fetches and
30
+ renders without sending BLE data. Do not expose authentication tokens in logs,
31
+ fixtures, or pull requests.
32
+
33
+ ## Coding Style & Naming Conventions
34
+
35
+ Follow Ruff’s defaults and the existing four-space Python indentation. Use
36
+ `snake_case` for functions, variables, and modules; `PascalCase` for classes;
37
+ and uppercase names for constants. Keep hardware/protocol details isolated in
38
+ `ble.py` and `rle.py`, and prefer typed, small functions that are easy to test.
39
+
40
+ ## Testing Guidelines
41
+
42
+ Pytest is the test framework. Name files `test_*.py` and test functions
43
+ `test_*`. Add regression coverage for changes to parsing, token aggregation,
44
+ rendering, or encoding; keep tests hardware- and network-independent by using
45
+ fixtures or synthetic sample data. Run `uv run pytest` before submitting.
46
+
47
+ ## Commit & Pull Request Guidelines
48
+
49
+ Use Conventional Commits, as in the existing history: `feat:`, `fix:`,
50
+ `docs:`, `refactor:`, `test:`, or `chore:` with a concise imperative subject
51
+ (for example, `fix: handle missing usage window`). Pull requests should explain
52
+ the user-visible behavior and implementation, link related issues, list tests
53
+ and checks run, and include a preview image when changing dashboard layout.
54
+ Call out any configuration, BLE, macOS, or launchd steps reviewers must perform.