If you open any well-maintained Python project on GitHub, you’ll notice that .py files are almost outnumbered by everything else: configuration files, dotfiles, a Dockerfile (and sometimes a Makefile), which you may or may not ever use.

You know the source code matters, but what is all of this other stuff, and do you actually need it, and if you do, what do you need to include especially with the advancement of AI?

Here, I’m going to provide a few GitHub templates as well as a breakdown of some of the major files that you’d find in a repository.

GitHub Templates

GitHub has a “Use this template” button that lets you clone a repo’s structure into a new project without forking it. There are some well established Python templates worth knowing about:

  • cookiecutter-pypackage - the most well-known, which uses Cookiecutter to prompt you for project details.

  • cookiecutter-uv - the more modern take that uses uv instead of pip or Poetry.

  • pyscaffold - a CLI tool to generate the files that are needed.

These are great “out of the box” tools, as they’ll save you time. But they all have a single blind spot: none of them account for AI-assisted development.

If you’re using Claude Code (or planning to), I created a repository with a pre-built CLAUDE.md file that uses modern practices (such as uv for package management with pre-loaded packages Claude uses) called python-project-template-with-claude.

» Note: it’s an open source project in the early stages - I’d love for you to contribute!

The CLAUDE.md file contains guardrails of do’s and dont’s as well as best practices for the model to follow.

The template feels lean, which is allowing for versatility - it’s impossible to anticipate project types. It’s giving you a clean starting point where both you and your AI tooling are on the same page from commit zero.

Individual Components

Let’s break down what belongs in a project repository; you’ll see the majority of these components in the python-project-template-with-claude repository (at the time of writing).

Project Configuration

This is a file defining your project’s name, version, dependencies, and build system. Older projects may use setup.py and setup.cfg, but the new standard for 2026 is using pyproject.toml.

Virtual environment

Virtual environments are a core to all Python projects, as they manage dependencies you may use. Modern practices use uv, but many projects still use pip or Poetry.

uv uses the pyproject.toml file to manage it’s dependencies, but you may run into a requirements.txt file if the project uses pip, or an environment.yaml file if the project uses Conda.

» To be clear, uv and pip is the tool to manage your dependencies - the dependencies are written in either pyproject.toml or requirements.txt.

Ignoring files

If you’re using git, you’re going to want to ignore files - this can be accomplished by adding a .gitignore file to the project repository.

Environment variables

This is a file that contains secrets like API keys, login information, etc. It’s very important to note that this does NOT get checked into source control (i.e. git) and is added to the .gitignore file.

Documentation

Sometimes, you need more than a README.md file. You may see a docs directory, which will house all the documentation for the project. Oftentimes, you’ll see projects use tools like MkDocs or Sphinx to manage the documentation.

Testing

Depending upon how the project is structured, you may see a tests folder with a test configuration file, such as pytest.ini. Modern practices add a [tool.pytest.ini_options] in the pyproject.toml file.

Docker

When you breach into containerization, you may see a Dockerfile (or a docker-compose.yaml file if there’s multiple services). I wrote about deploying your Python project using Docker here with a minimal file.

CI/CD pipelines

A lot of projects also include a .github/workflows directory for GitHub actions (or .gitlab-ci.yaml for GitLab projects). These files include testing, linting, and deployment on every push or pull request to automate actions.

AI Files Landscape

This field is moving very quickly, but here’s a listing of a few files that you may see in a repository:

  • CLAUDE.md - used by Claude Code and is one of the most popular markdown files for AI tooling (as of writing).

  • AGENTS.md - A relatively newer cross-tool standard, governed by the Agentic AI Foundation under the Linux Foundation.

  • GEMINI.md - used by Gemini CLI, but can be configured to read CLAUDE.md instead.

Given how quick the landscape is evolving, I highly encourage you to use the python-project-template-with-claude repository and make contributions to make the project more solid!

Happy coding!

📧 Join the Python Snacks Newsletter! 🐍

Want even more Python-related content that’s useful? Here’s 3 reasons why you should subscribe the Python Snacks newsletter:

  1. Get Ahead in Python with bite-sized Python tips and tricks delivered straight to your inbox, like the one above.

  2. Exclusive Subscriber Perks: Receive a curated selection of up to 6 high-impact Python resources, tips, and exclusive insights with each email.

  3. Get Smarter with Python in under 5 minutes. Your next Python breakthrough could just an email away.

You can unsubscribe at any time.

Interested in starting a newsletter or a blog?

Do you have a wealth of knowledge and insights to share with the world? Starting your own newsletter or blog is an excellent way to establish yourself as an authority in your field, connect with a like-minded community, and open up new opportunities.

If TikTok, Twitter, Facebook, or other social media platforms were to get banned, you’d lose all your followers. This is why you should start a newsletter: you own your audience.

This article may contain affiliate links. Affiliate links come at no cost to you and support the costs of this blog. Should you purchase a product/service from an affiliate link, it will come at no additional cost to you.

Reply

Avatar

or to participate

Keep Reading