Python packages
Tomas Beuzen & Tiffany Timbers
Python packages are a core element of the Python programming language and are how you create organized, reusable, and shareable code in Python. Python Packages is an open source book that describes modern and efficient workflows for creating Python packages.
This book is currently under development. Please feel free to provide comments or suggestions in a GitHub issue.
Building the book
Jupyter Book (HTML)
If you'd like develop and build the py-pkgs
book to HTML:
- Clone this repository;
- Run
pip install -r requirements.txt
(it is recommended you do this within a virtual environment); - Make any desired changes to source files;
- Build the book using the
build_jupybook.sh
script:
$ cd py-pkgs
$ sh build_jupybook.sh
A fully-rendered HTML version of the book will be built in py-pkgs/_build/html/
.
Bookdown (PDF)
If you'd like develop and build the py-pkgs
book to PDF:
- Install Docker;
- Pull the
py-pkgs
images:docker pull tbeuzen/pypkgs:latest
; - Make any desired changes to source files;
- Build the book using the
build_bookdown.sh
script:
$ cd py-pkgs
$ sh build_bookdown.sh
A fully-rendered PDF version of the book will be built in py-pkgs/bookdown/_book/
.
Contributing
Contributions are welcome and greatly appreciated! If you're interested in contributing to this project, take a look at the contributor guide.
Colophon
This book was written in JupyterLab and compiled using Jupyter Book. The source is hosted on GitHub and is deployed online at https://py-pkgs.org with Netlify.
Acknowledgements
We'd like to thank everyone that has contributed to the development of Python Packages. This is an open source book that began as supplementary material for the University of British Columbia's Master of Data Science program and was subsequently developed openly on GitHub where it has been read, revised, and supported by many students, educators, practitioners and hobbyists. Without you all, this book wouldn't be nearly as good as it is, and we are deeply grateful. A special thanks to those who have directly contributed to the text via GitHub (in alphabetical order): @Carreau
, @dcslagel
.
The scope and intent of this book was inspired by the fantastic R Packages book written by Hadley Wickham and Jenny Bryan, a book that has been a significant resource for the R community over the years. We hope that Python Packages will eventually play a similar role in the Python community.