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, revise=True)
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.bakbackup before overwrite--verbose→ Print debug messages--log FILE→ Log to specified log file
🧪 Run tests
python -m unittest discover capov/tests
🗂 Project structure
capov/— main packagefixers.py— bug fixing logic__main__.py— CLI entry pointexample.py— example usagetests/test_fixers.py— function teststest_cli_params.py— CLI testsfaulty_scripts/— broken Python samples (excluded from PyPI)
📦 Get full package (with tests/examples)
Option 1: GitHub clone
git clone https://github.com/HansPeterRadtke/capov.git
cd capov
Option 2: PyPI + extract manually
pip download capov
mkdir capov_extracted && tar -xzf capov-*.tar.gz -C capov_extracted --strip-components=1
cd capov_extracted
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.2.tar.gz.
File metadata
- Download URL: capov-0.1.2.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3b30d6735e3d3b2a1f78f0c0874136cda96b8b8df26a654c7fd16e3a6379132
|
|
| MD5 |
92c44579cb84cc9133304d1131027027
|
|
| BLAKE2b-256 |
256a17459e02a281e2a5a48b1bb6af3f1ff3d8cc791ce764510ea360291a092f
|
File details
Details for the file capov-0.1.2-py3-none-any.whl.
File metadata
- Download URL: capov-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.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 |
29a0c1594ff05ed964a6fa991550346aafdc7c66802756065c803a2a8d0393bd
|
|
| MD5 |
019370db0348a80049f546205173e836
|
|
| BLAKE2b-256 |
398c96d5d257dcc8fac233d3bfff999143040847638b182aebeaec864245c31c
|