{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Python Package: Initialization and Structure\n", "\n", "\n", "Building your own Python package is easy. \n", "\n", "You need to:\n", "\n", "- make a folder where you will store your package\n", "- create the relevant configuration files\n", "- write the code you want your package to contain\n", "- `pip` install it\n", "\n", "We go over these steps here, and then you should **practice**.\n", "\n", "\n", "## What is a Python package?\n", "\n", "\n", "A Python package is an ensemble of functions that serve a specific purpose.\n", "\n", "The library of functions is often split into multiple files, containing subset of functions, the split follows common sense. \n", "Each subset/file is often referred to as a *module*. \n", "\n", "An example of a well-maintained package is [getdist](https://github.com/cmbant/getdist).\n", "\n", "
| \n", " | Open | \n", "High | \n", "Low | \n", "Close | \n", "Volume | \n", "Dividends | \n", "Stock Splits | \n", "
|---|---|---|---|---|---|---|---|
| Date | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
| 2025-09-23 00:00:00-04:00 | \n", "181.970001 | \n", "182.419998 | \n", "176.210007 | \n", "178.429993 | \n", "192559600 | \n", "0.0 | \n", "0.0 | \n", "
| 2025-09-24 00:00:00-04:00 | \n", "179.770004 | \n", "179.779999 | \n", "175.399994 | \n", "176.970001 | \n", "143564100 | \n", "0.0 | \n", "0.0 | \n", "
| 2025-09-25 00:00:00-04:00 | \n", "174.479996 | \n", "180.259995 | \n", "173.130005 | \n", "177.690002 | \n", "191586700 | \n", "0.0 | \n", "0.0 | \n", "
| 2025-09-26 00:00:00-04:00 | \n", "178.169998 | \n", "179.770004 | \n", "174.929993 | \n", "178.190002 | \n", "148573700 | \n", "0.0 | \n", "0.0 | \n", "
| 2025-09-29 00:00:00-04:00 | \n", "180.429993 | \n", "184.000000 | \n", "180.320007 | \n", "181.850006 | \n", "193063500 | \n", "0.0 | \n", "0.0 | \n", "