Automate Python project setup and development tasks that are otherwise performed manually.
Inspired by an R package of the same name, this package brings a similar experience to the Python ecosystem as a CLI tool.
- First-class support for state-of-the-practice tooling:
uv
,ruff
,pytest
, andpre-commit
. - Automatically add and remove tools: declare, install, and configure in one step.
- Powerful knowledge of how different tools interact and sensible defaults.
- Get started on a new Python project or a new workflow in seconds.
First, it is strongly recommended you install the uv
package manager: this is a simple, documented process.
If you are starting a new project, it is recommended to call uv init --lib
to
initialize the project directory.
Then, you can install usethis for the project:
# With uv
$ uv add --dev usethis
# With pip
$ pip install usethis
Alternatively, run in isolation, using uvx
or pipx
.
Add a new tool to a Python project, including:
- declared & installed dependencies with
uv add
, - relevant
pyproject.toml
configuration, - any other relevant directories or tool-bespoke configuration files, and
.pre-commit-config.yaml
configuration if usingpre-commit
.
Currently supported tools:
- ruff
- pytest
- deptry
- pre-commit
Example:
usethis tool ruff
Supported arguments:
--remove
to remove the tool instead of adding it--offline
to disable network access and rely on caches
Add Continuous Integration pipelines to the project.
Currently supported platforms:
- Bitbucket
Example:
usethis ci bitbucket
.
Dispaly or open the PyPI landing page associated with another project.
Example:
usethis browse pypi numpy
Supported arguments:
--browser
to open the link in the browser automatically.
This project is at the early stages of development. If you are interested in contributing, please ensure you have a corresponsing GitHub Issue open.
usethis is licensed under the MIT license (LICENSE or https://opensource.org/licenses/MIT)
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in usethis by you, as defined in the Apache License, Version 2.0, (https://www.apache.org/licenses/LICENSE-2.0), shall be licensed under the MIT license, without any additional terms or conditions.