Python Package and Flask

Reading Time: 2.29 minutes

legoes
legoes

Imagine you're building something with Legos. You wouldn't dump all the pieces in one giant pile, right? You'd have little boxes for wheels, bricks, and special bits. That's what packages are like.

A Python package is a collection of Python files, like those little Lego boxes. These files contain functions, which are like pre-built mini-programs you can use in your own code. They can do all sorts of things, from making fancy calculations (like the math package) to wrangling data (like the Pandas package).

PIP

To help us manage, download and install packages in python, PIP comes into the picture. PIP is a package manager designed for python. It helps us easily add packages either to our system-wide computer or just specific to our environment (virtul environment in our case).

Python Package Index

To centralize the python packages, making it organized and simple for PIP to install for us, a community-driven organization, PyPA (Python Package Authority) created a repository of python packages.

It resides in pypi.orgopen in new window.

It helps developers download or share packages. Yes that's right! People, either group or individuals shares their codes. Most of them open source, to PyPI.

An example of a package I created a long time ago was channelflowlib. It can be accessed in that website.

channelflowlib
channelflowlib

Flask

In our project, we may be installing more than one package to help us build it.

First we're going to install is flask.

flask package
flask package

It is a package for building web server and application and it will help us in many ways.

There are many libraries or packages in python in building web applications, the probably most famous one is Django. It's a full-packed package, they call batteries included that offers many features out of the box. But since we're just learning programming, I think it was a good idea to start simple.

Unlike Django, Flask doesn't give us any boilerplate before using. Giving us the chance to understand our code more clearly.

Summary

So maybe that's it for the introduction of python package and flask. Next up, we are going to be writing our first web application in flask! See you on the next one!

Last Updated:
Contributors: alexiusacademia