Skip to main content

Pure Python cross-platform pyclean. Clean up your Python bytecode.

Project description

pyclean Latest version on PyPI

Build status Code health Python versions Software license

Worried about .pyc files and __pycache__ directories? Fear not! Pyclean is here to help. Finally the single-command clean up for Python bytecode files in your favorite directories. On any platform.

Wait! What is bytecode?

Bytecode is opcodes for the Python Virtual Machine. – Confused?

If you want to deep-dive into the topic watch the 2013 EuroPython talk “All Singing All Dancing Python Bytecode” by Larry Hastings. Otherwise James Bennett’s “Introduction to Python bytecode” should provide you with just the sound understanding of what it is all about.

Why not simply use rm **/*.pyc or find -name '*.py?' -delete?

If you’re happy with rm or find, go for it! When I was looking for a simple, concise solution for everybody I figured people are struggling, and simple things are more complicated than they appear at first sight.

Also, there is a pyclean command (and its siblings) on Debian. And, well, only on Debian as it turns out. Not that I’m a big fan of Mircosoft Windos, but why ignore the biggest Python population on this planet? (As if they weren’t punished enough already using this unfree piece of software!)

Debian

The Python scripts Debian ships with its python-minimal and python3-minimal packages can be found at:

Installation

$ pip install pyclean

Use pyclean with Tox

If you want to avoid installing pyclean you can add it to your tox.ini file as follows:

[testenv:clean]
deps = pyclean
commands = pyclean {toxinidir}

You’ll then be able to run it with Tox like this:

tox -e clean

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

pyclean-1.0.0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

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

pyclean-1.0.0-py2-none-any.whl (22.7 kB view details)

Uploaded Python 2

File details

Details for the file pyclean-1.0.0.tar.gz.

File metadata

  • Download URL: pyclean-1.0.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for pyclean-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3a46276297f6971a3e1c67333df2b59f251761dec36dba7c0bda6bc9e6cad8c5
MD5 f9a1cbf7ec7fb68f98a7bdfbd3f76777
BLAKE2b-256 2468eddc55023d75d14a8022f8519d7990551ff4b7e74b367c519baf041c89c8

See more details on using hashes here.

File details

Details for the file pyclean-1.0.0-py2-none-any.whl.

File metadata

  • Download URL: pyclean-1.0.0-py2-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.15

File hashes

Hashes for pyclean-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 2f20aeaa1713d26d73032f45328dd077bbdb0e00bd12ee8aa1b8cfb123c56c6b
MD5 dee81cc02e40845a71f20ce2c659b222
BLAKE2b-256 dacfac6e62b9a5e743f843326256348d8ba48161b36b3d9807c991213a5e1543

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