reko
AI Cost Tracking
- 🤖 LLM usage: $0.7300 (4 commits)
- 👤 Human dev: ~$332 (3.3h @ $100/h, 30min dedup)
Generated on 2026-07-06 using openrouter/qwen/qwen3-coder-next
Narzędzie do wykrywania i refaktoryzacji hardkodowanych wartości, struktur danych i kodu w projektach Python.
Co robi
- scan — wykrywa magic numbers, długie stringi, osadzone słowniki/listy, powtarzające się literały
- extract — wyciąga hardkod do modułu stałych (
constants.pylub wskazany plik) - split — rozbija duże struktury (dict/list) na mniejsze nazwane fragmenty
- move — przenosi stałe między modułami i aktualizuje importy
- remove — usuwa nieużywane stałe modułowe
- apply — stosuje plan refaktoryzacji (YAML/JSON)
Instalacja
cd ~/github/semcod/reko
pip install -e ".[apply,dev]"
Użycie
# skan projektu
reko scan .
# skan z raportem JSON
reko scan src/ --format json -o report.json
# wyciągnij hardkod do constants.py (dry-run)
reko extract src/ --target src/myapp/constants.py --dry-run
# rozbij dużą strukturę w pliku
reko split src/config.py --min-keys 5
# przenieś stałe
reko move src/old.py src/new_constants.py --names TIMEOUT,API_URL
# usuń nieużywane stałe
reko remove src/constants.py --dry-run
# zastosuj plan
reko apply plan.yaml
Konfiguracja
Plik reko.yaml w katalogu projektu:
scan:
extensions: [".py"]
exclude:
- "**/tests/**"
- "**/__pycache__/**"
min_string_length: 8
min_dict_keys: 4
allowed_numbers: [0, 1, -1, 2, 10, 100, 1000]
extract:
target: "constants.py"
naming: "upper_snake"
group_by: "file" # file | kind | none
API
from pathlib import Path
from reko import scan_project, extract_constants, apply_plan
findings = scan_project(Path("src/"))
result = extract_constants(Path("src/app.py"), target=Path("src/constants.py"))
Licencja
Apache-2.0
Metadata
Release files for reku 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| reku-0.1.5.tar.gz | 25.7 kB | Without provenance | Details for reku-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| reku-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for reku-0.1.5-py3-none-any.whl |
Total release size: 54.0 kB
Release files / reku-0.1.5.tar.gz
| Download URL | reku-0.1.5.tar.gz |
|---|---|
| Size | 25.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2ee1c3adaa4cf92bcb479be94d4c4cc7464894c2df56e56cdfd190ca9be3893
|
|
BLAKE2b-256 checksum How to use checksums |
33cba6f61d5ab1a60d31f150453a55484ac096fd1fe720e77cad37f4229978d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Release files / reku-0.1.5-py3-none-any.whl
| Download URL | reku-0.1.5-py3-none-any.whl |
|---|---|
| Size | 28.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b98d27369fc1163c00c62512273331e63a2f87cf5fe184583556ba0e4f93c117
|
|
BLAKE2b-256 checksum How to use checksums |
383fcfdd5c447a2a2e038c859780d5a7150d2569951b5691870e1ff6fea3412e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.7
|
Security for reku 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.