Skip to main content

PYPROJECT_INIT, the python project initializer

This is a simple python project initializer. It creates any file and directory structure needed for a python project, depending on the options you provide.

ROADMAP

  • add function for creating the chosen license file
  • add function for creating the chosen gitignore file
  • add function for creating the chosen README file
  • modify each os.system() call to use the subprocess module
  • wrap the whole thing in a class
  • simplify entry point
  • add tests
  • add documentation
  • add pyproject.toml file
  • wrap the whole thing in a package
  • publish the package on pypi
  • add a command line interface
  • test it vanilla
  • Change options setuppy and setupcfg to setup
  • Change options pyproject to make setup a flag. If setup is true, then create setup.py and setup.cfg. If setup is false, then create pyproject.toml
  • Cut the code into smaller functions if possible

DESCRIPTION

This package is a simple python project initializer. It creates a directory structure and files for a python project, depending on the options you provide. It can create a directory structure for a simple python project, a python package, or a python package with a CLI. It embeds:

  • a license file, default containing the MIT license but can be changed to any other license that is available on the choosealicense.com website
  • a gitignore file, default containing the standard python gitignore fields
  • a README file, default containing a simple template that you can modify
  • a pyproject.toml file, default containing the standard fields for a python package. This file is only created if you choose to create a python package or a python app.
  • a setup.cfg file, default containing the standard fields for a python package. This file is only created if you choose to create a python package or a python app.
  • a setup.py file, default containing the standard fields for a python package. This file is only created if you choose to create a python package or a python app.
  • a directory structure, default containing a simple python package with a simple module and a simple test module. This directory structure is only created if you choose to create a python package or a python app. The directory structure is composed of a package directory, a test directory, every __init__.py file needed, and a simple module and a simple test module.
  • If needed, this package can also create a simple Dockerfile that you can use to containerize your python app.

INSTALLATION

You can either clone the repository and install the package from the source code, or you can install it from pypi.

pip install pyproject-init

USAGE

The package provide a command line interface with 2 main commands: lib and app. The lib command is used to create a simple python package, and the app command is used to create a python package with a CLI. Each of the commands has same options and arguments. Please refer to the help message or the documentation for more information.

pyproject-init lib --help
pyproject-init app --help

EXAMPLES

Here are some examples of how to use the package.

Create a simple python package

pyproject-init lib my_package

This will create a directory structure and files for a simple python package. The directory structure will look like this:

my_package/
    my_package/
        __init__.py
    tests/
        __init__.py
        test_my_package.py
    LICENSE
    .gitignore
    README.md
    pyproject.toml
    setup.cfg
    setup.py

Create a python package with git initialized

This command line will create a simple python package and initialize a git repository in the directory.

pyproject-init lib my_package --git

Create a python package with a Dockerfile

This command line will create a simple python package and a Dockerfile in the directory.

pyproject-init lib my_package --docker

Create a python package with a different license

This command line will create a simple python package with a different license. The license must be available on the choosealicense.com website.

pyproject-init lib my_package --license gpl-3.0

Create a python package with pyproject.toml

This command line will create a simple python package with a pyproject.toml file instead of the setup.cfg and setup.py files.

pyproject-init lib my_package --pyproject

Create a python package with

CONTRIBUTING

If you want to contribute to this project, you can either open an issue or a pull request. Please refer to the CONTRIBUTING.md file for more information.

LICENSE

This project is licensed under the MIT license. Please refer to the LICENSE file for more information.

AUTHOR

This project was created by Quentin Haenn. You can contact me at quentin.haenn.pro@gmail.com.

Metadata

Release files for pyproject-init 1.1.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-init 1.1.0
File Size Uploaded Provenance
pyproject_init-1.1.0.tar.gz 9.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyproject-init 1.1.0
File Interpreter ABI Platform
pyproject_init-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 18.4 kB

Release files / pyproject_init-1.1.0.tar.gz

Download URL pyproject_init-1.1.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5ac0506c862fd1649c1f64b482c77428473a7df9ef77a1295f899685f0d261a0
BLAKE2b-256 checksum
How to use checksums
0e8d64694fb9465e76a4a4a385c12452dc9e2a424cb8e4570a423e4c3b0404e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Release files / pyproject_init-1.1.0-py3-none-any.whl

Download URL pyproject_init-1.1.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
502a609913987241990ee13835cd94c0947d0d87c7243d53ba8aff0f271bc915
BLAKE2b-256 checksum
How to use checksums
3f7ddf30362ae103c9aa1b83c4e23702c8d2a76221ede71756484143304ad198
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.2

Security for pyproject-init 1.1.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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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