posthog 7.9.12


pip install posthog

  Latest version

Released: Mar 12, 2026


Meta
Author: Posthog
Maintainer: PostHog
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

Operating System
  • OS Independent

License
  • OSI Approved :: MIT License

Programming Language
  • Python
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14

PostHog Python

posthoglogo

pypi installs GitHub contributors GitHub commit activity GitHub closed issues

Please see the Python integration docs for details.

Python Version Support

SDK Version Python Versions Supported Notes
7.3.1+ 3.10, 3.11, 3.12, 3.13, 3.14 Added Python 3.14 support
7.0.0 - 7.0.1 3.10, 3.11, 3.12, 3.13 Dropped Python 3.9 support
4.0.1 - 6.x 3.9, 3.10, 3.11, 3.12, 3.13 Python 3.9+ required

Development

This repo requires all commits to be signed. To configure commit signing, see the PostHog handbook.

Testing Locally

We recommend using uv. It's super fast.

  1. Run uv venv env (creates virtual environment called "env")
    • or python3 -m venv env
  2. Run source env/bin/activate (activates the virtual environment)
  3. Run uv sync --extra dev --extra test (installs the package in develop mode, along with test dependencies)
    • or pip install -e ".[dev,test]"
  4. you have to run pre-commit install to have auto linting pre commit
  5. Run make test
  6. To run a specific test do pytest -k test_no_api_key

PostHog recommends uv so...

uv python install 3.12
uv python pin 3.12
uv venv
source env/bin/activate
uv sync --extra dev --extra test
pre-commit install
make test

Running Locally

Assuming you have a local version of PostHog running, you can run python3 example.py to see the library in action.

Testing changes locally with the PostHog app

You can run make prep_local, and it'll create a new folder alongside the SDK repo one called posthog-python-local, which you can then import into the posthog project by changing pyproject.toml to look like this:

dependencies = [
    ...
    "posthoganalytics" #NOTE: no version number
    ...
]
...
[tools.uv.sources]
posthoganalytics = { path = "../posthog-python-local" }

This'll let you build and test SDK changes fully locally, incorporating them into your local posthog app stack. It mainly takes care of the posthog -> posthoganalytics module renaming. You'll need to re-run make prep_local each time you make a change, and re-run uv sync --active in the posthog app project.

Releasing

This repository uses Sampo for versioning, changelogs, and publishing to crates.io.

  1. When making changes, include a changeset: sampo add
  2. Create a PR with your changes and the changeset file
  3. Add the release label and merge to main
  4. Approve the release in Slack when prompted — this triggers version bump, crates.io publish, git tag, and GitHub Release

You can also trigger a release manually via the workflow's workflow_dispatch trigger (still requires pending changesets).

7.9.12 Mar 12, 2026
7.9.11 Mar 11, 2026
7.9.10 Mar 10, 2026
7.9.9 Mar 10, 2026
7.9.8 Mar 09, 2026
7.9.7 Mar 05, 2026
7.9.6 Mar 02, 2026
7.9.5 Mar 02, 2026
7.9.4 Feb 25, 2026
7.9.3 Feb 18, 2026
7.9.2 Feb 18, 2026
7.9.1 Feb 17, 2026
7.9.0 Feb 17, 2026
7.8.6 Feb 11, 2026
7.8.5 Feb 09, 2026
7.8.4 Feb 09, 2026
7.8.3 Feb 06, 2026
7.8.2 Feb 04, 2026
7.8.1 Feb 04, 2026
7.8.0 Jan 30, 2026
7.7.0 Jan 27, 2026
7.6.0 Jan 19, 2026
7.5.1 Jan 08, 2026
7.5.0 Jan 07, 2026
7.4.3 Jan 05, 2026
7.4.2 Dec 22, 2025
7.4.1 Dec 21, 2025
7.4.0 Dec 16, 2025
7.3.1 Dec 16, 2025
7.0.1 Nov 15, 2025
7.0.0 Nov 11, 2025
6.9.3 Nov 11, 2025
6.9.2 Nov 11, 2025
6.9.1 Nov 07, 2025
6.9.0 Nov 06, 2025
6.8.0 Nov 04, 2025
6.7.14 Nov 03, 2025
6.7.13 Nov 02, 2025
6.7.12 Nov 02, 2025
6.7.11 Oct 28, 2025
6.7.10 Oct 24, 2025
6.7.9 Oct 22, 2025
6.7.8 Oct 16, 2025
6.7.7 Oct 14, 2025
6.7.6 Sep 22, 2025
6.7.5 Sep 16, 2025
6.7.4 Sep 05, 2025
6.7.3 Sep 04, 2025
6.7.2 Sep 03, 2025
6.7.1 Sep 01, 2025
6.7.0 Aug 26, 2025
6.6.1 Aug 21, 2025
6.6.0 Aug 18, 2025
6.5.0 Aug 08, 2025
6.4.1 Aug 06, 2025
6.4.0 Aug 05, 2025
6.3.4 Aug 05, 2025
6.3.3 Aug 02, 2025
6.3.2 Jul 31, 2025
6.3.1 Jul 23, 2025
6.3.0 Jul 22, 2025
6.2.1 Jul 22, 2025
6.1.1 Jul 16, 2025
6.1.0 Jul 10, 2025
6.0.4 Jul 09, 2025
6.0.3 Jul 07, 2025
6.0.2 Jul 02, 2025
6.0.1 Jul 01, 2025
6.0.0 Jun 27, 2025
5.4.0 Jun 20, 2025
5.3.0 Jun 19, 2025
5.2.0 Jun 19, 2025
5.1.0 Jun 18, 2025
5.0.0 Jun 16, 2025
4.10.0 Jun 13, 2025
4.9.0 Jun 13, 2025
4.8.0 Jun 12, 2025
4.7.0 Jun 11, 2025
4.6.2 Jun 10, 2025
4.6.1 Jun 09, 2025
4.6.0 Jun 09, 2025
4.5.0 Jun 09, 2025
4.4.2 Jun 09, 2025
4.4.1 Jun 09, 2025
4.4.0 Jun 06, 2025
4.3.2 Jun 06, 2025
4.2.0 May 23, 2025
4.1.0 May 23, 2025
4.0.1 Apr 29, 2025
4.0.0 Apr 24, 2025
3.25.0 Apr 15, 2025
3.24.3 Apr 15, 2025
3.24.2 Apr 15, 2025
3.24.1 Apr 11, 2025
3.24.0 Apr 10, 2025
3.23.0 Mar 26, 2025
3.22.0 Mar 26, 2025
3.21.0 Mar 17, 2025
3.20.0 Mar 14, 2025
3.19.1 Mar 10, 2025
3.19.0 Mar 06, 2025
3.18.1 Mar 03, 2025
3.18.0 Feb 28, 2025
3.17.0 Feb 27, 2025
3.16.0 Feb 26, 2025
3.15.1 Feb 23, 2025
3.15.0 Feb 21, 2025
3.14.2 Feb 20, 2025
3.14.1 Feb 18, 2025
3.13.0 Feb 12, 2025
3.12.1 Feb 11, 2025
3.12.0 Feb 11, 2025
3.11.0 Jan 28, 2025
3.10.0 Jan 24, 2025
3.9.3 Jan 23, 2025
3.9.2 Jan 22, 2025
3.9.1 Jan 22, 2025
3.9.0 Jan 21, 2025
3.8.4 Jan 20, 2025
3.8.3 Jan 14, 2025
3.8.2 Jan 14, 2025
3.8.1 Jan 14, 2025
3.8.0 Jan 14, 2025
3.7.5 Jan 03, 2025
3.7.4 Nov 27, 2024
3.7.3 Nov 25, 2024
3.7.2 Nov 19, 2024
3.7.0 Oct 03, 2024
3.6.6 Sep 16, 2024
3.6.5 Sep 10, 2024
3.6.4 Sep 09, 2024
3.6.3 Sep 03, 2024
3.6.2 Sep 03, 2024
3.6.1 Sep 03, 2024
3.6.0 Aug 28, 2024
3.5.2 Aug 21, 2024
3.5.0 Mar 04, 2024
3.4.2 Feb 20, 2024
3.4.1 Feb 13, 2024
3.4.0 Feb 05, 2024
3.3.4 Jan 30, 2024
3.3.3 Jan 26, 2024
3.3.2 Jan 19, 2024
3.3.1 Jan 10, 2024
3.3.0 Jan 09, 2024
3.2.0 Jan 09, 2024
3.1.0 Dec 04, 2023
3.0.2 Aug 17, 2023
3.0.1 Apr 21, 2023
3.0.0 Apr 17, 2023
2.5.0 Apr 10, 2023
2.4.2 Mar 30, 2023
2.4.0 Mar 16, 2023
2.3.1 Feb 07, 2023
2.3.0 Jan 31, 2023
2.2.0 Nov 14, 2022
2.1.2 Sep 15, 2022
2.1.1 Sep 14, 2022
2.1.0 Aug 12, 2022
2.0.1 Aug 04, 2022
2.0.0 Aug 02, 2022
1.4.9 Jun 13, 2022
1.4.8 May 12, 2022
1.4.7 Apr 25, 2022
1.4.6 Mar 30, 2022
1.4.5 Jan 05, 2022
1.4.4 Nov 25, 2021
1.4.3 Oct 28, 2021
1.4.2 Jun 22, 2021
1.4.1 May 28, 2021
1.4.0 May 18, 2021
1.3.1 May 07, 2021
1.2.1 Feb 05, 2021
1.2.0 Jan 11, 2021
1.1.3 Nov 23, 2020
1.1.1 Sep 29, 2020
1.0.11 Apr 30, 2020
1.0.10 Apr 01, 2020
1.0.9 Feb 22, 2020
1.0.8 Feb 18, 2020
1.0.7 Feb 18, 2020
1.0.6 Feb 10, 2020
1.0.0 Feb 10, 2020

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
requests (<3.0,>=2.7)
six (>=1.5)
python-dateutil (>=2.2)
backoff (>=1.10.0)
distro (>=1.5.0)
typing-extensions (>=4.2.0)