Getting Started with Python in GitLab
Onboarding Guide
This guide helps non-Python developers get started with Python quickly and efficiently.
Set up Python:
Install Python from the official Python website.
Python can also be installed with Mise:
mise use python@3.14
Please note that while macOS comes with Python pre-installed, it’s strongly advised to install and use a separate version of Python
Install Poetry for package management:
Poetry is a modern, Python-specific dependency manager that simplifies packaging and dependency handling. To install it, run:
curl --silent --show-error --location "https://install.python-poetry.org" | python3 -
Make sure to ready the Poetry installation guide for full installation details
Once installed, create a new Python project with Poetry:
poetry new my_project cd my_project poetry install
Run and Debug Existing Code
Learning resources
If you are new to Python or looking to refresh your knowledge, this section provides various materials for learning the language.
Zen of Python Zen of Python - PEP 20 - is an essential read, it shapes how you think about Python and write “Pythonic” code.
Python Cheatsheet A comprehensive reference covering essential Python syntax, built-in functions, and useful libraries. This is ideal for both beginners and experienced users who want a quick, organized summary of Python’s key features.
100-page Python Intro Brief guide provides a straightforward introduction to Python, covering all the essentials needed to start programming effectively. It’s a beginner-friendly option that covers everything from syntax to debugging and testing.
Learn X in Y Minutes: Python A very brief, high-level introduction cuts directly to the core syntax and features of Python, making it a valuable quick start for developers transitioning to Python.
Exercism Python Track Use Exercism’s Python track as a foundation for learning Python concepts and best practices. Exercism provides hands-on practice with mentoring support, making it an excellent resource for mastering Python through coding exercises and feedback.
When building Python APIs, we use FastAPI and Pydantic. To get started with building and reviewing these technologies, refer to the following resources:
FastAPI Documentation FastAPI is a modern web framework for building APIs with Python. This resource will help you learn how to create fast and efficient web applications and APIs. FastAPI is especially useful for building Python applications with high performance and scalability.
Pydantic Documentation Pydantic is a Python library for data validation and settings management using Python type annotations. Learn how to integrate Pydantic into your Python projects for easier data validation and management, particularly when working with FastAPI.
We use pytest for testing Python code. To learn more about writing and running tests with pytest, refer to the following resources:
pytest Documentation pytest is a popular testing framework for Python that makes it easy to write simple and scalable tests. This resource provides comprehensive documentation on how to write and run tests using pytest, including fixtures, plugins, and test discovery.
Python Testing with pytest (Book) This book is a comprehensive guide to testing Python code with pytest. It covers everything from the basics of writing tests to advanced topics like fixtures, plugins, and test organization.
Python Function to flowchart) This project takes any Python function and automatically creates a visual flowchart showing how the code works.
Learning Group
A collaborative space for developers to study Python, FastAPI, and Pydantic, focusing on building real-world apps.
Refer to Track and Propose Sessions for Python Learning Group issue for ongoing updates and discussions.
Core Topics for Group Learning:
Basic Python Syntax:
- Learn Python concepts such as variables, functions, loops, and conditionals.
- Practice at Exercism Python Track.
FastAPI and Pydantic:
- Learn how to build APIs using FastAPI and validate data with Pydantic.
- Key resources:
Communication
- Stay updated by following the learning group issue
- Join the discussion on Slack: #python_getting_started
Python Review Office Hours
- Bi-weekly sessions for code review and discussion, led by experienced Python developers.
- These sessions are designed to help you improve your Python skills through practical feedback.
- Please feel free to add the office hours to your calendar.
Encourage Recorded Group Meetings
All review and study group meetings will be recorded and shared, covering key concepts in Python, FastAPI, and Pydantic. These recordings are great for revisiting topics or catching up if you miss a session.
Add any uploaded videos to the Python Resources playlist.
Mentorship Process
1:1 mentorship for Python is possible and encouraged. For more information on how to get started with a mentor, please refer to the GitLab Mentoring Handbook.
More learning resources
In addition to the resources already mentioned, this section provides various materials for learning the language and it’s ecosystem. In no particular order.
A Whirlwind Tour of Python (Jupyter Notebook) A fast-paced introduction to Python fundamentals, tailored especially for data science practitioners but works well for everyone who wants to get just the basic understanding of the language. This is a Jupiter Notebook which makes this guide an interactive resource as well as a good introduction to Jupiter Notebook itself.
Python imports Even for Pythonistas with a couple of projects under their belt, imports can be confusing! You’re probably reading this because you’d like to gain a deeper understanding of imports in Python, particularly absolute and relative imports.
Python -m flag Learning the -m flag helps you run Python tools correctly by ensuring they use the right Python environment, avoiding common setup headaches.
Poetry vs pip
virtualenv
andpip
are built-in tool to handle project dependencies and environments. Why and when should you use Poetry?Python roadmap Step by step guide to becoming a Python developer in 2025. Use this for inspiration and finding additional resources.
Programiz Python basics Step into the world of programming with this beginner-friendly Python course and build a strong programming foundation.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support