{"id":20313698,"url":"https://github.com/posthog/posthog-python","last_synced_at":"2026-02-19T00:04:35.779Z","repository":{"id":37967021,"uuid":"239432717","full_name":"PostHog/posthog-python","owner":"PostHog","description":"Send usage data from your Python code to PostHog.","archived":false,"fork":false,"pushed_at":"2025-04-29T14:15:23.000Z","size":463,"stargazers_count":39,"open_issues_count":33,"forks_count":31,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-16T06:06:32.293Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://posthog.com/docs/libraries/python","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PostHog.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-02-10T05:11:45.000Z","updated_at":"2025-04-30T15:10:47.000Z","dependencies_parsed_at":"2023-12-26T10:28:16.118Z","dependency_job_id":"2b31d835-4398-444b-9223-adac2d5dfcf4","html_url":"https://github.com/PostHog/posthog-python","commit_stats":{"total_commits":173,"total_committers":31,"mean_commits":5.580645161290323,"dds":0.7514450867052023,"last_synced_commit":"9e1bb8c58afaa229da24c4fb576c08bb88a75752"},"previous_names":[],"tags_count":91,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fposthog-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fposthog-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fposthog-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fposthog-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PostHog","download_url":"https://codeload.github.com/PostHog/posthog-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478190,"owners_count":22077676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T18:12:25.596Z","updated_at":"2026-02-19T00:04:35.773Z","avatar_url":"https://github.com/PostHog.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostHog Python\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"posthoglogo\" src=\"https://user-images.githubusercontent.com/65415371/205059737-c8a4f836-4889-4654-902e-f302b187b6a0.png\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://pypi.org/project/posthog/\"\u003e\u003cimg alt=\"pypi installs\" src=\"https://img.shields.io/pypi/v/posthog\"/\u003e\u003c/a\u003e\n   \u003cimg alt=\"GitHub contributors\" src=\"https://img.shields.io/github/contributors/posthog/posthog-python\"\u003e\n  \u003cimg alt=\"GitHub commit activity\" src=\"https://img.shields.io/github/commit-activity/m/posthog/posthog-python\"/\u003e\n  \u003cimg alt=\"GitHub closed issues\" src=\"https://img.shields.io/github/issues-closed/posthog/posthog-python\"/\u003e\n\u003c/p\u003e\n\nPlease see the [Python integration docs](https://posthog.com/docs/integrations/python-integration) for details.\n\n## Python Version Support\n\n| SDK Version   | Python Versions Supported    | Notes                      |\n| ------------- | ---------------------------- | -------------------------- |\n| 7.3.1+        | 3.10, 3.11, 3.12, 3.13, 3.14 | Added Python 3.14 support  |\n| 7.0.0 - 7.0.1 | 3.10, 3.11, 3.12, 3.13       | Dropped Python 3.9 support |\n| 4.0.1 - 6.x   | 3.9, 3.10, 3.11, 3.12, 3.13  | Python 3.9+ required       |\n\n## Development\n\n### Testing Locally\n\nWe recommend using [uv](https://docs.astral.sh/uv/). It's super fast.\n\n1. Run `uv venv env` (creates virtual environment called \"env\")\n   - or `python3 -m venv env`\n2. Run `source env/bin/activate` (activates the virtual environment)\n3. Run `uv sync --extra dev --extra test` (installs the package in develop mode, along with test dependencies)\n   - or `pip install -e \".[dev,test]\"`\n4. you have to run `pre-commit install` to have auto linting pre commit\n5. Run `make test`\n6. To run a specific test do `pytest -k test_no_api_key`\n\n## PostHog recommends `uv` so...\n\n```bash\nuv python install 3.12\nuv python pin 3.12\nuv venv\nsource env/bin/activate\nuv sync --extra dev --extra test\npre-commit install\nmake test\n```\n\n### Running Locally\n\nAssuming you have a [local version of PostHog](https://posthog.com/docs/developing-locally) running, you can run `python3 example.py` to see the library in action.\n\n### Testing changes locally with the PostHog app\n\nYou 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:\n\n```toml\ndependencies = [\n    ...\n    \"posthoganalytics\" #NOTE: no version number\n    ...\n]\n...\n[tools.uv.sources]\nposthoganalytics = { path = \"../posthog-python-local\" }\n```\n\nThis'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 -\u003e 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.\n\n## Releasing\n\nThis repository uses [Sampo](https://github.com/bruits/sampo) for versioning, changelogs, and publishing to crates.io.\n\n1. When making changes, include a changeset: `sampo add`\n2. Create a PR with your changes and the changeset file\n3. Add the `release` label and merge to `main`\n4. Approve the release in Slack when prompted — this triggers version bump, crates.io publish, git tag, and GitHub Release\n\nYou can also trigger a release manually via the workflow's `workflow_dispatch` trigger (still requires pending changesets).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthog%2Fposthog-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthog%2Fposthog-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthog%2Fposthog-python/lists"}