Skip to main content

Create the file and folder structure for a Python package

Project description

create-python-package

Initialize a new package using best practices as described by the Python Packaging Authority (PyPA).

Perfect for beginners and experts alike!

> create-python-package mypackage

No more guesswork!

The file structure you're left with looks like this

mypackage/
├── LICENSE
├── README.md
├── activate-venv -> /private/tmp/mypackage/venv/bin/activate
├── mypackage
│   ├── __init__.py
│   └── main.py
└── setup.py

To publish, run

> publish-python-package packagepath

Virtualenv ready to go!

Inside the directory you can run

source activate-venv

to activate an isolated Python environment that was created specifically for that package. To deactivate it, type

deactivate

To learn more about virtual environments, see Creating Virtual Environments.

Install

My recommendation is to run the latest version of create-python-package with pipx rather than installing it and freezing the version on your system. This is because create-python-package will be updated to reflect current best practices, and you will automatically be using the latest by running with pipx.

Install pipx.

> pipx create-python-package mypackage  # runs latest version

and to publish

> pipx --package create-python-package publish-python-package mypackage  # runs latest version

If you really want to install it you can.

> pipx install create-python-package

Requires Python 3.6+.

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.0.0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

create_python_package-0.0.0.2-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: create-python-package-0.0.0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.2+

File hashes

Hashes for create-python-package-0.0.0.2.tar.gz
Algorithm Hash digest
SHA256 b80836c0097af6917f0c68e2cca89e6fd0a5a51ce68ff89656acbba585686613
MD5 7b94e73334e050831db2a22697b724c5
BLAKE2b-256 5d7289fcee39b0c977ade6e68bd9227a9b3d7f7a73c9c5610076b652a021e57b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: create_python_package-0.0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.2+

File hashes

Hashes for create_python_package-0.0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1df4fbb0090923c433755a44214566fc995a91cff126c67c250693eda14a984b
MD5 c458661607b0e41a82b0ad0eb2675ca9
BLAKE2b-256 7ed30663c6a632b67d41ac8400c42ac0600530875e690e40fc3f79bc027facbf

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