Lesson 36 of 55
PythonPackaging and Distribution
20 minutes
Course progress65%
What you'll learn
Keep these ideas in mind as you work through the lesson.
Lesson 36 of 55
Python20 minutes
Keep these ideas in mind as you work through the lesson.
If you want to share your code with others, package it so it can be installed with pip. Modern Python projects use pyproject.toml or setup.cfg + setup.py.
# Minimal setup.py for a pure‑Python package
from setuptools import setup, find_packages
setup(
name='myutils',
version='0.1.0',
packages=find_packages(),
description='Utility functions for data processing',
author='John Doe',
python_requires='>=3.7',
)
Build a source distribution with python setup.py sdist and upload to TestPyPI using twine.