
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Learn to create, package, test, and publish Python modules and packages to PyPI, including setup files, metadata, versioning, and documentation, with practical examples like the Udemy calculator package.
Packaging Python code structures modules, libraries, and distributions for easy installation and reuse, highlighting visibility, collaboration, and maintainability through dependencies, version control, and modular standards.
Explore the Python ecosystem, including the core Python standard library, third-party packages, Python implementations, development environments, and package managers like pip and conda, plus the pipe repository.
Install Python from python.org, install Python 3.12, add it to your path and environment variables, and verify the setup from the command line on Windows, Linux, or Mac.
Create and activate a Python virtual environment (venv), install packages with pip, and verify modules in site-packages for Python packaging basics.
Learn to define and call Python functions with default and multiple parameters, return values, and basic iterations over names and dictionaries, plus a square function example.
Learn to organize Python code using modules and packages, import modules, import specific attributes, use aliases, create custom modules, work with built in modules, and handle import errors with try/except.
Learn python classes by building an animal class with name and sound, then a bird subclass with fly, and explore rectangle with class and static methods including is_square and area.
Learn how to create python modules as .py files, import them, and call their functions with dot notation; understand __name__ behavior and when to run code with __main__ in packaging.
Explore how to import modules in Python using import statements and from...import statements. Learn to import multiple modules, alias modules, and import specific attributes to use functions directly.
Explore importing modules in Python with the import statement, the from ... import statement, wildcard imports, and aliasing, and access square root and pi from math in practical code examples.
Learn how the if __name__ == '__main__' construct distinguishes direct script execution from module import, enabling function separation, testing, and cleaner code for Python packages.
Learn how to import Python modules with import, from import, wildcard import, and aliasing, and see how the if __name__ == '__main__' guard prevents code from running on import.
Transition from Python modules to packages by organizing related modules into a directory tree, using an __init__.py to initialize the package and avoid name collisions in large code bases.
Learn how a python package organizes related modules into a directory with an init file, enabling imports of modules, objects, or entire packages, as shown with animals, mammals, and birds.
Create a Python package named animals, add __init__, mammals, and birds, define a dog class with an init and hello method, and run a main script with imports.
Discover the structure of a Python package, including root directories, __init__.py, modules, and subpackages, and learn how to import modules and organize tests and static files.
Build a Python package named animals with an __init__ file and mammals and birds modules, create a dog class, and run an example showing bark and the name.
Plan your Python package by defining its purpose and audience, outlining structure and naming, and establishing a consistent API, documentation, and tests for a weather data package.
Set up a well-organized Python package by structuring a root directory named after the package, including __init__.py and subpackages for data fetching, process data, and visualize data, tests and docs.
Explore the setup.py file in depth to learn how to define package metadata with setuptools, declare dependencies with install_requires, include data files with package_data, and create console scripts via entry_points.
Understand how the manifest.in file guides setup tools to include or exclude files in a Python package, using recursive, global, and regex patterns with examples like docs and license files.
Explore why good documentation matters for Python packaging, boosting usability and contributions. Highlight types like code comments, docstrings, user guides, and API references.
Learn to create an effective readme for your Python package, detailing project description, installation steps, usage examples, contribution guidelines, licensing, and contact information.
Master markdown fundamentals for README files, including headers, emphasis, lists, links, images, code blocks, tables, and block quotes. Build a solid foundation for README content.
Explore how software licenses—permissive, copyleft, and proprietary—govern the use, modification, and distribution of your Python package, and learn to choose and apply a license that matches your goals.
Create isolated Python environments with the built-in venv module to manage dependencies, activate the environment, install packages with pip (such as numpy), and deactivate to return to the global setup.
Create a Python virtual environment with python -m venv and activate it; deactivate when needed. Install packages with pip, and verify the packages appear in lib/site-packages after installation.
Discover why testing matters for Python packaging, verify code behavior, and identify bugs to ensure reliability and robustness. Emphasize unit testing as the foundation for broader integration and functional tests.
Install your package locally with pip install ., in an activated virtual environment, to test installation and functionality before publishing to PyPI.
Install the package locally by activating a venv and running pip install dot from the setup directory, then import and run Webalizer to verify the local installation.
Write and run unit tests for your Python package using the unittest module, organize tests in a tests directory, and verify functions like get_temperature return a float.
Explore practical steps to publish Python packages on PyPI, including creating releases, uploading tar files, and connecting GitHub, while inspecting package documentation, installation commands, and release history.
Explore PyPI, the official Python package index, to discover, install, and publish packages, view version histories and licenses, and manage your own modules.
Learn to upload your Python package to PyPI by building sdist and bdist distributions with setup.py, then uploading with twine after creating a PyPI account and entering credentials.
Learn semantic versioning for Python packaging, using major.minor.patch to signal breaking changes, backward compatible feature additions, and bug fixes, with setup.py versioning examples like 1.0.0 and 1.3.2.
Unleash the full potential of your Python skills and ascend to new heights as a proficient package creator with our comprehensive course on Python packaging. This course is specifically designed for developers across all levels, offering an in-depth exploration of Python packaging. We guide you through the fundamental principles to the intricacies involved in creating, packaging, and distributing your own Python modules.
By enrolling in this course, you can anticipate numerous benefits:
In-Depth Understanding: Grasp the nuances of Python's modules, scripts, packages, namespaces, and scope, setting a firm foundation for your Python packaging journey.
Practical Skills: Gain hands-on experience in writing and structuring your own Python packages, and learn to package them efficiently for distribution.
Publication Expertise: Understand the process of publishing your Python packages on PyPI, making them available to the global Python community.
Tools Mastery: Get acquainted with critical tools in the Python packaging ecosystem such as pip, setuptools, wheel, and twine, essential for effective package creation and distribution.
Project Documentation: Learn how to effectively manage your project documentation, create compelling README files, and comprehend the significance of software licenses.
Troubleshooting Techniques: Equip yourself with essential strategies to address common challenges that arise during the packaging and distribution process.
Best Practices: Immerse yourself in industry-standard best practices for Python packaging, preparing you for real-world application and efficient package management.
Supplementary Resources: Benefit from our additional resources designed to reinforce your learning and keep you abreast with the dynamic world of Python packaging.
Whether you're just starting your journey as a Python developer or you've got extensive experience, this course provides a holistic, practical understanding of Python packaging. Empower your Python programming capabilities, enhance code reusability, and share your work with the global developer community by learning to publish your own Python packages. Enroll now and accelerate your Python development career to new horizons!