Photo by Roman Synkevych on Unsplash

Advance Python Development

Charles Patel
3 min readMay 11, 2024

--

I’ll be very brief in this article assuming you already know the basics. This article only points out things needed to advance your skills in writing Python applications and repositories and assumes you are smart enough to google.

Setting up python projects

Learn how to configure your project using setup.py or pyproject.toml or using other open-source tools. Explore the popular Python package repo for reference.

Over the last few years, there have been many changes in setting up Python projects. To setup Python projects, you need to know about setup.py which is soon to be deprecated as per my best knowledge and will be replaced by pyprojects.toml file. Poetry is also an awesome tool for dependency management and maintaining Python packages.

Python tooling

There are tons of open-source Python code tooling available out there, these are some of the most popular among the Python community,

  • mypy
  • ruff
  • black
  • flake8
  • isort
  • bandit

Understand each for what it does and how to configure in your repository. These are very important for clean and mature code writing and avoiding inconsistency across your repo.

Typehints

It's a controversial topic whether to use type hints in Python. I strongly believe in type-hinting. It is good to have in your Python code as it will reduce testing code lines to a large extent if you use it in combination with static analysis tools like mypy or Pyre (Meta).

The basic type hints, list[str], set[Enum], dict[str, int], tuple[str]. The next step is to understand advanced typing i.e type inference and forwarding,

  • Learn to use Sequence, Iterable, Generator, Mapping, MutableMapping, etc.
  • Learn Protocol
  • Learn generic types, Generic, TypeVar, ClassVar, Type. See this useful video about generics

Understand PEP

PEP means “Python Enhancements Proposal”, The advanced python developer aka Pythonista writes PEP to advance the Python language. It includes new features and their usage.

Read the latest PEPs to be aware of the language changes, and understand how it is written, developed, reviewed, and deployed.

See most popular PEP8

Pypi server

It’s a simple server that stores Python packages and makes them available to download for your use. Learn how to build and upload packages to pypi server.

Configuration files

  • MANIFEST.in : To include static files or extra files besides common Python package files in the package source distribution. e.g. images, non-python files (.js, .config, etc.) See Controlling files in the distribution
  • requirements.txt: For defining the libraries needed to run the projects
  • setup.py / setup.cfg / pyproject.toml : To set up the project and add other libraries configs

CICD

Learn how we can leverage CICD to run the test, build, and upload packages to either the package registry or pypi server.

There are many other things, However, I think the above are needed to understand Python development from writing a single line to release. Moreover, I feel there should be an in-depth article on the above all points which I’ll try to cover soon.

In the next article, I’ll post best practices whilst code review in day-to-day work.

--

--