---
title: "flit | pypx"
description: "A simple packaging tool for simple packages."
canonical_url: "https://pypx.app/packages/flit"
meta:
  "og:description": "A simple packaging tool for simple packages."
  "og:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_flit%2Cversion_4.2.0%2Csummary_A%2Bsimple%2Bpackaging%2Btool%2Bfor%2Bsimple%2Bpackages.%2Clicense_BSD-3-Clause%2Cp_Ii9wYWNrYWdlcy9mbGl0Ig%2Cs_EmY14c75B-wW5cmN.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "flit 4.2.0"
  "twitter:image": "https://pypx.app/_og/d/h_630%2Cc_PackageCard%2Cname_flit%2Cversion_4.2.0%2Csummary_A%2Bsimple%2Bpackaging%2Btool%2Bfor%2Bsimple%2Bpackages.%2Clicense_BSD-3-Clause%2Cp_Ii9wYWNrYWdlcy9mbGl0Ig%2Cs_EmY14c75B-wW5cmN.png"
---

> Index of every page on this site: [llms.txt](https://pypx.app/llms.txt)

# **flit**

v4.2.0

A simple packaging tool for simple packages.

52 KB Python 3.8+ py3-none-anyBSD-3-Clause5 deps

[** Diff **](https://pypx.app/packages/flit/diff)

`$ uv add flit`

**Flit** is a simple way to put Python packages and modules on PyPI. It tries to require less thought about packaging and help you avoid common mistakes. See [Why use Flit?](https://flit.readthedocs.io/en/latest/rationale.html) for more about how it compares to other Python packaging tools.

## Install

```
$ python3 -m pip install flit
```

Flit requires Python 3 and therefore needs to be installed using the Python 3 version of pip.

Python 2 modules can be distributed using Flit, but need to be importable on Python 3 without errors.

## Usage

Say you're writing a module foobar — either as a single file foobar.py, or as a directory — and you want to distribute it.

1\. Make sure that foobar's docstring starts with a one-line summary of what the module is, and that it has a \_\_version\_\_:

```python
"""An amazing sample package!"""

__version__ = "0.1"
```

2\. Install flit if you don't already have it:

```
python3 -m pip install flit
```

3\. Run flit init in the directory containing the module to create a pyproject.toml file. It will look something like this:

```ini
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "foobar"
authors = [{name = "Sir Robin", email = "robin@camelot.uk"}]
dynamic = ["version", "description"]

[project.urls]
Home = "https://github.com/sirrobin/foobar"
```

You can edit this file to add other metadata, for example to set up command line scripts. See the [pyproject.toml page](https://flit.readthedocs.io/en/latest/pyproject_toml.html#scripts-section) of the documentation.

If you have already got a flit.ini file to use with older versions of Flit, convert it to pyproject.toml by running python3 -m flit.tomlify.

4\. Run this command to upload your code to PyPI:

```
flit publish
```

Once your package is published, people can install it using pip just like any other package. In most cases, pip will download a 'wheel' package, a standard format it knows how to install. If you specifically ask pip to install an 'sdist' package, it will install and use Flit in a temporary environment.

To install a package locally for development, run:

```
flit install [--symlink] [--python path/to/python]
```

Flit packages a single importable module or package at a time, using the import name as the name on PyPI. All subpackages and data files within a package are included automatically.

## Contributing

To work on Flit, see [Developing Flit](https://flit.pypa.io/en/latest/development.html) in the documentation. The [issue tracker](https://github.com/pypa/flit/issues) is on GitHub.

Please do not use AI/LLMs to work on Flit; see the development page for more details.

## **Details **

<dl>

<dt>Version</dt>
<dd>4.2.0</dd>

<dt>License</dt>
<dd>BSD-3-Clause</dd>

<dt>Python</dt>
<dd>&gt;=3.8</dd>

<dt>Maintainer</dt>
<dd>Thomas Kluyver &lt;thomas@kluyver.me.uk&gt;</dd></dl>

## **Links**

- [Changelog](https://flit.pypa.io/en/stable/history.html)
- [Documentation](https://flit.pypa.io)
- [Source](https://github.com/pypa/flit)
- [View on PyPI](https://pypi.org/project/flit/)

## **Release Cadence **

**4**

releases in the past year

avg 76 days between releases

## **Maintainers **

- Thomas Kluyver · [thomas@kluyver.me.uk](mailto:thomas@kluyver.me.uk)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://pypx.app/#website","@type":"WebSite","description":"The Python Package Index, reimagined. Fast search, dependency insights, download trends, and changelogs — all in one place.","name":"pypx","url":"https://pypx.app/"},{"@id":"https://pypx.app/packages/flit#webpage","@type":"WebPage","description":"A simple packaging tool for simple packages.","name":"flit","url":"https://pypx.app/packages/flit","isPartOf":{"@id":"https://pypx.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://pypx.app/packages/flit"]}]},{"@id":"https://pypx.app/packages/flit#/schema/software-application/1","@type":"SoftwareApplication","applicationCategory":"DeveloperApplication","description":"A simple packaging tool for simple packages.","license":"BSD-3-Clause","name":"flit","softwareVersion":"4.2.0"}]}
```

## Sitemap

See the full [sitemap](https://pypx.app/sitemap.md) for all pages.
