What Is a Python Package?

A Python package is simply a directory, usually containing Python modules (source files with the .py extension). It frequently will include a special marker file, __init__.py. Packages can easily be created and used locally, and published packages can be installed using pip. Learning to install public packages and create packages locally is not difficult, though … Read more

How To Profile Python Code

Python is a programming language that has gained massive popularity — but this popularity stems from its readability and ease of use rather than raw performance. Because of this, it can sometimes be even more critical to optimize for performance in Python than in other languages. Profiling is a tool that can help developers accomplish … Read more

Python JSON: Easily Work With Dictionaries, Files, and Custom Objects

JSON (JavaScript Object Notation) is perhaps the most popular data-interchange format. Python has a built-in JSON package that lets you conveniently and quickly encode and decode JSON to and from Python dictionaries, which share a similar key/value structure but are much easier to manipulate in Python. This tutorial will show you how to work with … Read more