Skip to main content

Rehome your Python scripts into nice interconnected modules

Project description

rehome

Documentation CI Status Coverage Checked with mypy Code style: black

Rehome your Python scripts into nice interconnected modules

Read The Docs

Requires

  • Python 3.10+

Installation

pip install rehome

Usage

The CLI allows you to instantiate the Rehome class central to this package directly.

usage: rehome [-h] [-p [PROTECT ...]] [-g [GROUP ...]] [-d] target

Rehome(target: pathlib.Path, protect: list[str] = <factory>, group: list[str] = <factory>, debug:
bool = False)

positional arguments:
  target

options:
  -h, --help            show this help message and exit
  -p [PROTECT ...], --protect [PROTECT ...]
                        (default: <factory>)
  -g [GROUP ...], --group [GROUP ...]
                        (default: <factory>)
  -d, --debug           (default: False)

Protected names

-p specifies names to protect, i.e. to keep in the source file

rehome foo.py -p main

...protects the name main, and ensures it will stay in the source file

Groups

-g specifies groups (each argument is a group, separated by spaces)

rehome foo.py -g "hand glove" "foot sock"

...creates two groups of names: ["hand", "glove"] and ["foot", "sock"]

rehome is available from PyPI, and the code is on GitHub

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

rehome-0.0.1.tar.gz (13.3 kB view hashes)

Uploaded Source

Built Distribution

rehome-0.0.1-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

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