Captain Obvious: Corrects all the obvious errors in a Python-script.
Project description
CapOv — Captain Obvious
Fixes the dumbest, most obvious Python code errors automatically.
CapOv corrects only the 100% safe stuff: missing imports, duplicate imports, unclosed brackets, and more — with zero assumptions.
🔧 Installation
pip install capov
🚀 Example usage
from capov.fixers import process
code = '''
import os
import os
x = [1, 2, 3,
print(json.dumps(x)
'''
fixed = process(code)
print(fixed)
Command-line:
python -m capov your_script.py [options]
Options:
- --in-place → Overwrite the input file
- --output FILENAME → Write fixed code to a separate file
- --backup → Create a .bak backup before overwrite
- --verbose → Print debug messages
- --log FILE → Log to specified log file
🧪 Run tests
To verify installation and test functionality:
python3 -m capov.tests
🗂 Project structure
- capov/ — main package
- fixers.py — bug fixing logic
- main.py — CLI entry point
- example.py — example usage
- tests/
- test_cli_full.py — full run tests
- test_cli_params.py — CLI parameter tests
- test_module_usage.py — module usage tests
- faulty_scripts/ — broken Python samples
CapOv is your cleanup butler. Let him sweep the dumb bugs so you don't have to.
Submit bugs or contribute: https://github.com/HansPeterRadtke/capov
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file capov-0.1.5.tar.gz.
File metadata
- Download URL: capov-0.1.5.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd93b18ab68666e88318b9585b0feeddfff9bc817d2dd85570d4933eb53941d0
|
|
| MD5 |
bd9badfbc5d0c5597173f1994ed16291
|
|
| BLAKE2b-256 |
9e1f33b92ebe2459cf913aad83d15bed34f17e50c569be951fb4d8cc01deb6d7
|
File details
Details for the file capov-0.1.5-py3-none-any.whl.
File metadata
- Download URL: capov-0.1.5-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c6b917f469710f2a91062d863986b03a14dbbbf42a7436e2655cad149d3154e
|
|
| MD5 |
565d5211c439dcce2a36c5e2e22e45c9
|
|
| BLAKE2b-256 |
e9812889b08f4767dd595b7e72a467d3d739b86170880d1b09a1e96899b304cc
|