Skip to main content

Create the file and folder structure for a Python package

Project description

create-python-package

Code style: black

Overview

Initialize a new package using best practices as described by the Python Packaging Authority (PyPA). Perfect for beginners and experts alike. Stop writing boilerplate and start coding.

Generates a project similar to the Python Packaging Authority's sample project, but with various parts autogenerated based on your inputs.

Features

  • Creates a battle-tested directory structure with boilterplate for unit tests, license, setup.py and more
  • Sets you up with popular Python environment managers such as venv and Pipenv
  • Initializes a git repository for you with a .gitignore file

Usage

This package ships with one CLI entrypoint, create-python-package.

To interactively answer questions about your project, such as author, license, etc.

$ create-python-package

You will then be prompted with questions such as

question version (0.0.0.1):
question description ():
question entry point (main.py):
question repository url ():
question author (Your Name):
question email (email@doman.com):
question environment management (venv) (options: venv, pipenv, poetry):
question license (mit) (options: mit, gplv3, apache2, bsd3):

These are used to populate setup.py and other files to give you as painless experience as possible when starting a new project.

To use defaults and skip interactive prompts, use the --yes flag

$ create-python-package --yes

Installation

Python 3.6+ is required

using pip

pip install --user create-python-package

using pipx

pipx allows you to run Python binaries directly, or install packages into isolated virtual environments and add their binaries to your PATH

pipx run create-python-package

or install with

pipx install create-python-package

Generated Directory Structure

>> pipx run create-python-package examplepackage --yes
>> tree -L 2 examplepackage/
examplepackage/
├── examplepackage
│   ├── __init__.py
│   └── main.py
├── LICENSE
├── makefile
├── MANIFEST.in
├── README.md
├── setup.py
├── tests
│   └── test_project.py
└── venv
    ├── bin
    ├── include
    ├── lib
    ├── lib64 -> lib
    ├── pyvenv.cfg
    └── share

Credits

Inspired by create-react-app

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

create-python-package-0.2.2.0.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

create_python_package-0.2.2.0-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file create-python-package-0.2.2.0.tar.gz.

File metadata

  • Download URL: create-python-package-0.2.2.0.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for create-python-package-0.2.2.0.tar.gz
Algorithm Hash digest
SHA256 8b9fe6ebabaef439f17583ce5ccef186a3662c89a4445dcc924ffbe9f3f19ec2
MD5 7e9a274eb967ddfd96f387ef0588a118
BLAKE2b-256 b67d7d54ed6c1fcfe27119ec6e885b8d5ca4f757e606835e06a8548a8f30f824

See more details on using hashes here.

File details

Details for the file create_python_package-0.2.2.0-py3-none-any.whl.

File metadata

  • Download URL: create_python_package-0.2.2.0-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for create_python_package-0.2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f9e5553e14afb120bc0ab8a52e8e1e56604565a81bc3ecb9ad3a01dcd65842f
MD5 82661265550e42582e56bf7ad5991425
BLAKE2b-256 329b930c4d40e887f71b6f94352bdc09665be6c673da74bfe5e4dc5f58f3925f

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