Skip to main content

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

capov-0.1.4.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

capov-0.1.4-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file capov-0.1.4.tar.gz.

File metadata

  • Download URL: capov-0.1.4.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

Hashes for capov-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b55e0c359a35383d0fe24e00e16d67763e8352fb53d722a2fad8020f6f13b927
MD5 5e9cdece81a55d3253a24622b50fe579
BLAKE2b-256 75b280cf8d45df9cf7425bb9a13bc3202f046f4d11db9f1bd8f4d6e09a389c1e

See more details on using hashes here.

File details

Details for the file capov-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: capov-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for capov-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e73103ef34beb6b430db7bb1f1efa406c086f37cfb25b5248a8ebc70d22b1aae
MD5 9f91b2565098c7d9bc2409a421bf41d0
BLAKE2b-256 1baafb6c6e848c9ebcfdad11ffe952b7ac074fd9d01cf51234c558b7e625eda8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page