Skip to main content

Captain Obvious: A fixer for only the most trivial Python code issues.

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 .bak backup 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 package
    • fixers.py — bug fixing logic
    • __main__.py — CLI entry point
    • example.py — example usage
    • tests/
      • test_fixers.py — function tests
      • test_cli_params.py — CLI tests
      • faulty_scripts/ — broken Python samples (excluded from PyPI)

📦 Get full package (with tests/examples)

Option 1: GitHub clone

git clone https://github.com/YOURUSERNAME/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/YOURUSERNAME/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.0.tar.gz (3.5 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.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: capov-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 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.0.tar.gz
Algorithm Hash digest
SHA256 f7dd3284165927b63207047795f86289ed9bdeb90c8c166064f75eb3cd83ca9e
MD5 bd24d21aa6bfe9e8b592e785a42e654f
BLAKE2b-256 371705f1f843777d1f26234c5dadc9e1e6d6b081f5302a9b90a39e5b54546c58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: capov-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 08b2480764e9c5ca8226ec1c77c20df3356e2f830aeb53aac25b0d50fd7ce9de
MD5 69c125007acf5c048d92a06933532393
BLAKE2b-256 863314dc80191e13ceec2280e27d922ce01bb0d4d8c74d17dfc65b4af7027dd2

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