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.
-
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 -
-
Once installed, create a new Python project with Poetry:
poetry new my_project cd my_project poetry install
-
-
Run and Debug Existing Code
- Familiarize yourself with the project’s structure by following the
README.md
. -
Use tools like
pdb
or IDE debugging features to debug code. Example:poetry shell python -m pdb <file_name>.py
- Familiarize yourself with the project’s structure by following the
Learning resources
If you are new to Python or looking to refresh your knowledge, this section provides various materials for learning the language.
-
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.
-
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.
- 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:
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
If you are new to Python or looking to refresh your knowledge, this section provides variours materials for learning the language.
-
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.
-
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.
-
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.