Skip to main content

pyproject:

PyPI version PyPI - Downloads License: MIT pre-commit Checked with mypy Code style: black Imports: isort Tests Coverage

What is it?

pyproject is a command line utility to setup and distribute Python packages.

Usage:

Dependencies

  • platformdirs - Install configuration files in the correct location
  • rich - Beautiful terminal output

Installing

The easiest way is to install pyproject is from PyPI using pip:

pip install pyproject-generator

Afterwards, a pyproject command will be exposed on your system.

Initializing a Project

Simply run

pyproject init {project_name}

to create your project folder. It will automatically setup a package structure, virtual environment, and install packages.

The final project structure looks like

├── .git
├── .github
│   └── workflows
│       └── tests.yml
├── .gitignore
├── .pre-commit-config.yaml
├── LICENSE
├── README.md
├── benchmarks
│   └── benchmark.py
├── pyproject.toml
├── requirements_dev.txt
├── setup.cfg
├── src
│   └── myproject
│       ├── __init__.py
│       ├── __version__.py
│       └── py.typed
├── tests
│   └── test_myproject.py
└── tox.ini

Configuring pyproject-generator

pyproject also allows you to configure your author name, email, Github URL, PyPI username and password, and a list of default dependencies that you want to install. Please note that your credentials are simply stored locally as plaintext. If you do not wish to store them, you can simply pass them in manually via the --pypi_username and --pypi_password flags, or run without any flags and type them in as required. To configure, run

pyproject config --author="" --email="" --github_url="" --pypi_username="" --pypi_password=""

You may set dependencies one of three ways. In all cases, pass in a comma-delimited string (for multiple dependencies) or a string (for one dependency). You can set the dependencies, which overrides the default settings.

pyproject config --set_dependencies="white,ruff,mypy"

You may add dependencies:

pyproject config --add_dependencies="django"

And you may remove dependencies:

pyproject config --remove_dependencies="pre-commit"

Note that these flags also work with the init action. config merely does the work of saving them locally to be re-used later.

Uploading a Project

pyproject also supplies an upload function. Run

pyproject upload

to build and upload your package to PyPI.

Metadata

Release files for pyproject-generator 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyproject-generator 0.3.0
File Size Uploaded Provenance
pyproject-generator-0.3.0.tar.gz 52.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyproject-generator 0.3.0
File Interpreter ABI Platform
pyproject_generator-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 114.6 kB

Release files / pyproject-generator-0.3.0.tar.gz

Download URL pyproject-generator-0.3.0.tar.gz
Size 52.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b230cccaf665c3fb104aad91b292a655376dc40d2d8c165fb932e64975686bd7
BLAKE2b-256 checksum
How to use checksums
14f88106442b3d7aa9556cff61017b7a6ca6ae2e3706f229ce44c903d77cb1ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / pyproject_generator-0.3.0-py3-none-any.whl

Download URL pyproject_generator-0.3.0-py3-none-any.whl
Size 61.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a61a161f8031ee60cda14db3c928ee25d28121f7ad246e64701d96c06f153c7
BLAKE2b-256 checksum
How to use checksums
5dabb1f6aa9e5e8bcd3bdd61f63813c7d374b7c6ae2734c3bb1aca2e7c438b74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for pyproject-generator 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page