Skip to main content

Remove all pests from your project! frenchmaid is a lightweight all platform cli package that will delete all pycache and other folders (contents included) in your project directory. Are you tired of doing it manually each time? Fear not, the frenchmaid will do it for you!

Project description

frenchmaid logo

frenchmaid v0.2.2

Are you a python developer who also/only uses windows and are sick and tired of constantly deteting those pesky __pycache__ directories? Fear not, frenchmaid is here to help! frenchmaid is a CLI app written in pure python that will search your entire project directory and delete any __pycache__ or other folders (and the files within) in your root directory. Now it can also add these folders to your ignore files!

Supported Folders

  • __pycache__
  • .mypy_cache

Supported Ignores

  • git
  • docker

Installation

pip install frenchmaid

or

pip3 install frenchmaid
Windows 10 PATH Error
If you encounter a path error on your CMD after running one of the commands above (e.g one about not finding a frenchmaid.exe or the frenchmaid.exe not being on PATH), carry out the following steps:
  1. Uninstall frenchmaid

    pip uninstall frenchmaid
    
  2. Open a new terminal as admin

    1. Open the start menu (press the windows button)
    2. Search for CMD
    3. Right click and select run as administrator
  3. Install frenchmaid globally

    pip install frenchmaid
    

Remember not to use the --user flag unless you have set this option on path as well.


Linux PATH Error
If you encounter a "not on path" error after running `pip3 install frenchmaid` akin to:
frenchmaid is installed in /home/<username>/.local/bin which is not on PATH...

Copy the relative path to frenchmaid from $HOME and add it to PATH. For this current example it would be:

user@machine:~$ echo $HOME
/home/<username>

user@machine:~$ export PATH="$HOME/.local/bin:$PATH"

Update

pip install --upgrade frenchmaid

or

pip3 install --upgrade frenchmaid

Example Usage

In any terminal window:

Linux based machines:

user@machine:~/Documents/example-app$ frenchmaid clean

Windows based machines:

C:\Users\<user>\Documents\example-app> frenchmaid clean

It's really that simple, just ensure that you are in your project's root directory! For clarity, the above example assumes that your project structure is something like this for example:

example-app
├── main.py
├── requirements.txt
└── src
     └── __init__.py
     └── app.py

If the root is example-app then you can see that the terminal should be in that folder.

Commands

clean

Run frenchmaid clean in your project's root directory without any arguments to remove all instances of supported folders. If you want to delete all instances of one type of folder and not any others, run the command with an option; For example, frenchmaid clean mypy.

For more information on which arguments are supported, run frenchmaid clean --help. If a folder you would like support for is not there, you can open a request here.

The currently supported arguments are:

  • pycache which will only delete __pycache__ folders
  • mypy which will only delete .mypy_cache folders

ignore

The ignore command (unlike the clean one) requires an argument to work. So to ignore all supported folders in your .dockerignore file, run frenchmaid ignore docker for example.

Usage Notes

  • Ensure you run the command in the correct directory
  • It will currently only add pycache and mypy cache folders toy our ignore file
  • You do not have to create the ignore file before running the command. If one doesn't exist, it will create one
  • If you already have an ignore file, it will append the folders to the file if they aren't already in the file

The currently supported arguments are:

  • git which will add or append a .gitignore file
  • docker which will add or append a .dockerignore file

For more information on which arguments are supported, run frenchmaid ignore --help. If a folder you would like support for is not there, you can open a request here.

Options

Version

In any terminal in any directory:

frenchmaid -v

or

frenchmaid --version

will return (for example):

frenchmaid v0.2.2

Help

In any terminal in any directory:

frenchmaid --help

will return:

Usage: frenchmaid [OPTIONS] COMMAND [ARGS]...

A handy tool to delete all junk!

Options:
-v, --version               View the CLI app version
--install-completion        Install completion for the current shell.
--show-completion           Show completion for the current shell, to copy it or customize the installation.
--help                      Show this message and exit.

Commands:
clean       Delete all instances of junk folders
ignore      Add junk folders to ignore files

Note that this option can also be used in tandem with any command.

Support and Reporting

You can report any bugs or improvements here, I will try to address them as soon as possible. Feel free to suggest any other files or folders you think it should delete (e.g .pytest_cache) with all context on how they appear. I will happily make it a possibility without breaking the current format! To the best of my abilities of course, and the github page will be updated on any changes.

Version History

v0.2.2

Minor Patch 2

  • Updated README version history to include v0.2.1 updates

v0.2.1

Minor Patch 1

  • Fixed ignore format for __pycache__ in git

v0.2.0

Major Patch

  • Added a logo to the README
  • Added instructions for a Linux PATH error
  • Added ignore command and arguments
  • Added support for mypy cache folders
  • Added arguments to the clean command
  • Added --help context to all commands
  • Moved all functions to a modules folder
  • Added a class switch
  • Typed modules

v0.1.2

Minor patch 2

  • License has been updated to Apache from MIT effective from the date of this release
  • Notes on potential path problems that can arise from installation on Windows have been added to the README

v0.1.1

Minor patch

  • Issue on linux machines fixed with directory name post pycache delete
    • The package no longer displays the root directory's full absolute path (e.g Documents/example-app), but rather just the root directory's name (e.g example-app) on linux machines.

v0.1.0

Initial Release; Stable version for use on all platforms.

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

frenchmaid-0.2.2.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

frenchmaid-0.2.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file frenchmaid-0.2.2.tar.gz.

File metadata

  • Download URL: frenchmaid-0.2.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.1

File hashes

Hashes for frenchmaid-0.2.2.tar.gz
Algorithm Hash digest
SHA256 787292d8595f34367c377774d666c667432376106695f30e9025955062025958
MD5 dbcdb8deb8e4838bfef163c314b4a279
BLAKE2b-256 0f630123713bbd8e883bf446706cc723bef0cad2fb0d99ff07a54594cd808573

See more details on using hashes here.

File details

Details for the file frenchmaid-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: frenchmaid-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.1

File hashes

Hashes for frenchmaid-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e823f0a6d353b06b0fd3aa82db01e9e4f656ffa3d2e7a02c07bae5d0924d64f7
MD5 1803c56bc999bb46ad7a4034b69b9199
BLAKE2b-256 96fa7a635298982916252a793c1b2b50be49e4beed4b618c6b849815bfd1b38e

See more details on using hashes here.

Supported by

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