Workflow
Overview
Teaching: 10 min
Exercises: 5 minQuestions
How do we write code for operational use?
Objectives
Integrate git flow with working objectives.
Python Packaging
The setup.py File
Putting a setup.py file will instruct the “pip” program to try and install your local package. This will get installed with the specified
from setuptools import setup
setup(
name="my_package_name",
version="1.0.0",
install_requires=["pandas", "sqlalchemy", "mycli"],
)
Installing Packages
The pip install syntax is given by pip install <location_of_package>.
You can install both local and remote packages.
Pip will try to find packages in the following order if not location protocol is specified :
- PyPi
- Custom configured PyPi servers
- Your current working directory
pip install -e .
Create and Install a Package
- Create a setup.py file for your python package
- Install your package with pip
Key Points
You can test code locally in an interactive environment like jupyter notebook
Moving code to a version controlled python package enables sharing.