sentry-sdk


Namesentry-sdk JSON
Version 2.34.0 PyPI version JSON
download
home_pagehttps://github.com/getsentry/sentry-python
SummaryPython client for Sentry (https://sentry.io)
upload_time2025-07-29 12:47:26
maintainerNone
docs_urlNone
authorSentry Team and Contributors
requires_python>=3.6
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
  <img src="https://sentry-brand.storage.googleapis.com/github-banners/github-sdk-python.png" alt="Sentry for Python">
</a>
<div align="center">

_Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us
[<kbd>**Check out our open positions**</kbd>](https://sentry.io/careers/)_.

[![Discord](https://img.shields.io/discord/621778831602221064?logo=discord&labelColor=%20%235462eb&logoColor=%20%23f5f5f5&color=%20%235462eb)](https://discord.com/invite/Ww9hbqr)
[![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=@getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry)
[![PyPi page link -- version](https://img.shields.io/pypi/v/sentry-sdk.svg)](https://pypi.python.org/pypi/sentry-sdk)
<img src="https://img.shields.io/badge/python-3.7 | 3.8 | 3.9 | 3.10 | 3.11 | 3.12 | 3.13-blue.svg" alt="python">
[![Build Status](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml/badge.svg)](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml)

<br/>

</div>


# Official Sentry SDK for Python

Welcome to the official Python SDK for **[Sentry](http://sentry.io/)**.


## 📦 Getting Started

### Prerequisites

You need a Sentry [account](https://sentry.io/signup/) and [project](https://docs.sentry.io/product/projects/).

### Installation

Getting Sentry into your project is straightforward. Just run this command in your terminal:

```bash
pip install --upgrade sentry-sdk
```

### Basic Configuration

Here's a quick configuration example to get Sentry up and running:

```python
import sentry_sdk

sentry_sdk.init(
    "https://12927b5f211046b575ee51fd8b1ac34f@o1.ingest.sentry.io/1",  # Your DSN here

    # Set traces_sample_rate to 1.0 to capture 100%
    # of traces for performance monitoring.
    traces_sample_rate=1.0,
)
```

With this configuration, Sentry will monitor for exceptions and performance issues.

### Quick Usage Example

To generate some events that will show up in Sentry, you can log messages or capture errors:

```python
import sentry_sdk
sentry_sdk.init(...)  # same as above

sentry_sdk.capture_message("Hello Sentry!")  # You'll see this in your Sentry dashboard.

raise ValueError("Oops, something went wrong!")  # This will create an error event in Sentry.
```


## 📚 Documentation

For more details on advanced usage, integrations, and customization, check out the full documentation on [https://docs.sentry.io](https://docs.sentry.io/).


## 🧩 Integrations

Sentry integrates with a ton of popular Python libraries and frameworks, including [FastAPI](https://docs.sentry.io/platforms/python/integrations/fastapi/), [Django](https://docs.sentry.io/platforms/python/integrations/django/), [Celery](https://docs.sentry.io/platforms/python/integrations/celery/), [OpenAI](https://docs.sentry.io/platforms/python/integrations/openai/) and many, many more.  Check out the [full list of integrations](https://docs.sentry.io/platforms/python/integrations/) to get the full picture.


## 🚧 Migrating Between Versions?

### From `1.x` to `2.x`

If you're using the older `1.x` version of the SDK, now's the time to upgrade to `2.x`. It includes significant upgrades and new features. Check our [migration guide](https://docs.sentry.io/platforms/python/migration/1.x-to-2.x) for assistance.

### From `raven-python`

Using the legacy `raven-python` client? It's now in maintenance mode, and we recommend migrating to the new SDK for an improved experience. Get all the details in our [migration guide](https://docs.sentry.io/platforms/python/migration/raven-to-sentry-sdk/).


## 🙌 Want to Contribute?

We'd love your help in improving the Sentry SDK! Whether it's fixing bugs, adding features, writing new integrations, or enhancing documentation, every contribution is valuable.

For details on how to contribute, please read our [contribution guide](CONTRIBUTING.md) and explore the [open issues](https://github.com/getsentry/sentry-python/issues).


## 🛟 Need Help?

If you encounter issues or need help setting up or configuring the SDK, don't hesitate to reach out to the [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr). There is a ton of great people there ready to help!


## 🔗 Resources

Here are all resources to help you make the most of Sentry:

- [Documentation](https://docs.sentry.io/platforms/python/) - Official documentation to get started.
- [Discord](https://discord.com/invite/Ww9hbqr) - Join our Discord community.
- [X/Twitter](https://twitter.com/intent/follow?screen_name=getsentry) -  Follow us on X (Twitter) for updates.
- [Stack Overflow](https://stackoverflow.com/questions/tagged/sentry) - Questions and answers related to Sentry.

<a name="license"></a>
## 📃 License

The SDK is open-source and available under the MIT license. Check out the [LICENSE](LICENSE) file for more information.


## 😘 Contributors

Thanks to everyone who has helped improve the SDK!

<a href="https://github.com/getsentry/sentry-python/graphs/contributors">
  <img src="https://contributors-img.web.app/image?repo=getsentry/sentry-python" />
</a>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/getsentry/sentry-python",
    "name": "sentry-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sentry Team and Contributors",
    "author_email": "hello@sentry.io",
    "download_url": "https://files.pythonhosted.org/packages/b3/05/546f8b9baa303b9e9b38feab79222935d0a279f0ed4d2e2cb6e5a0963055/sentry_sdk-2.34.0.tar.gz",
    "platform": null,
    "description": "<a href=\"https://sentry.io/?utm_source=github&utm_medium=logo\" target=\"_blank\">\n  <img src=\"https://sentry-brand.storage.googleapis.com/github-banners/github-sdk-python.png\" alt=\"Sentry for Python\">\n</a>\n<div align=\"center\">\n\n_Bad software is everywhere, and we're tired of it. Sentry is on a mission to help developers write better software faster, so we can get back to enjoying technology. If you want to join us\n[<kbd>**Check out our open positions**</kbd>](https://sentry.io/careers/)_.\n\n[![Discord](https://img.shields.io/discord/621778831602221064?logo=discord&labelColor=%20%235462eb&logoColor=%20%23f5f5f5&color=%20%235462eb)](https://discord.com/invite/Ww9hbqr)\n[![Twitter Follow](https://img.shields.io/twitter/follow/getsentry?label=@getsentry&style=social)](https://twitter.com/intent/follow?screen_name=getsentry)\n[![PyPi page link -- version](https://img.shields.io/pypi/v/sentry-sdk.svg)](https://pypi.python.org/pypi/sentry-sdk)\n<img src=\"https://img.shields.io/badge/python-3.7 | 3.8 | 3.9 | 3.10 | 3.11 | 3.12 | 3.13-blue.svg\" alt=\"python\">\n[![Build Status](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml/badge.svg)](https://github.com/getsentry/sentry-python/actions/workflows/ci.yml)\n\n<br/>\n\n</div>\n\n\n# Official Sentry SDK for Python\n\nWelcome to the official Python SDK for **[Sentry](http://sentry.io/)**.\n\n\n## \ud83d\udce6 Getting Started\n\n### Prerequisites\n\nYou need a Sentry [account](https://sentry.io/signup/) and [project](https://docs.sentry.io/product/projects/).\n\n### Installation\n\nGetting Sentry into your project is straightforward. Just run this command in your terminal:\n\n```bash\npip install --upgrade sentry-sdk\n```\n\n### Basic Configuration\n\nHere's a quick configuration example to get Sentry up and running:\n\n```python\nimport sentry_sdk\n\nsentry_sdk.init(\n    \"https://12927b5f211046b575ee51fd8b1ac34f@o1.ingest.sentry.io/1\",  # Your DSN here\n\n    # Set traces_sample_rate to 1.0 to capture 100%\n    # of traces for performance monitoring.\n    traces_sample_rate=1.0,\n)\n```\n\nWith this configuration, Sentry will monitor for exceptions and performance issues.\n\n### Quick Usage Example\n\nTo generate some events that will show up in Sentry, you can log messages or capture errors:\n\n```python\nimport sentry_sdk\nsentry_sdk.init(...)  # same as above\n\nsentry_sdk.capture_message(\"Hello Sentry!\")  # You'll see this in your Sentry dashboard.\n\nraise ValueError(\"Oops, something went wrong!\")  # This will create an error event in Sentry.\n```\n\n\n## \ud83d\udcda Documentation\n\nFor more details on advanced usage, integrations, and customization, check out the full documentation on [https://docs.sentry.io](https://docs.sentry.io/).\n\n\n## \ud83e\udde9 Integrations\n\nSentry integrates with a ton of popular Python libraries and frameworks, including [FastAPI](https://docs.sentry.io/platforms/python/integrations/fastapi/), [Django](https://docs.sentry.io/platforms/python/integrations/django/), [Celery](https://docs.sentry.io/platforms/python/integrations/celery/), [OpenAI](https://docs.sentry.io/platforms/python/integrations/openai/) and many, many more.  Check out the [full list of integrations](https://docs.sentry.io/platforms/python/integrations/) to get the full picture.\n\n\n## \ud83d\udea7 Migrating Between Versions?\n\n### From `1.x` to `2.x`\n\nIf you're using the older `1.x` version of the SDK, now's the time to upgrade to `2.x`. It includes significant upgrades and new features. Check our [migration guide](https://docs.sentry.io/platforms/python/migration/1.x-to-2.x) for assistance.\n\n### From `raven-python`\n\nUsing the legacy `raven-python` client? It's now in maintenance mode, and we recommend migrating to the new SDK for an improved experience. Get all the details in our [migration guide](https://docs.sentry.io/platforms/python/migration/raven-to-sentry-sdk/).\n\n\n## \ud83d\ude4c Want to Contribute?\n\nWe'd love your help in improving the Sentry SDK! Whether it's fixing bugs, adding features, writing new integrations, or enhancing documentation, every contribution is valuable.\n\nFor details on how to contribute, please read our [contribution guide](CONTRIBUTING.md) and explore the [open issues](https://github.com/getsentry/sentry-python/issues).\n\n\n## \ud83d\udedf Need Help?\n\nIf you encounter issues or need help setting up or configuring the SDK, don't hesitate to reach out to the [Sentry Community on Discord](https://discord.com/invite/Ww9hbqr). There is a ton of great people there ready to help!\n\n\n## \ud83d\udd17 Resources\n\nHere are all resources to help you make the most of Sentry:\n\n- [Documentation](https://docs.sentry.io/platforms/python/) - Official documentation to get started.\n- [Discord](https://discord.com/invite/Ww9hbqr) - Join our Discord community.\n- [X/Twitter](https://twitter.com/intent/follow?screen_name=getsentry) -  Follow us on X (Twitter) for updates.\n- [Stack Overflow](https://stackoverflow.com/questions/tagged/sentry) - Questions and answers related to Sentry.\n\n<a name=\"license\"></a>\n## \ud83d\udcc3 License\n\nThe SDK is open-source and available under the MIT license. Check out the [LICENSE](LICENSE) file for more information.\n\n\n## \ud83d\ude18 Contributors\n\nThanks to everyone who has helped improve the SDK!\n\n<a href=\"https://github.com/getsentry/sentry-python/graphs/contributors\">\n  <img src=\"https://contributors-img.web.app/image?repo=getsentry/sentry-python\" />\n</a>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python client for Sentry (https://sentry.io)",
    "version": "2.34.0",
    "project_urls": {
        "Changelog": "https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md",
        "Documentation": "https://docs.sentry.io/platforms/python/",
        "Homepage": "https://github.com/getsentry/sentry-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "24d4999d63debd1e53f18c95861ae425dcd4fca1e8ec1934c5906ca8da44e867",
                "md5": "a2bc515d5eee8248965f29ea07386eef",
                "sha256": "1c9856d0666c112f3a7a749aba09821e79871b3e7d322833840e9358b8c71a60"
            },
            "downloads": -1,
            "filename": "sentry_sdk-2.34.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a2bc515d5eee8248965f29ea07386eef",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 357707,
            "upload_time": "2025-07-29T12:47:24",
            "upload_time_iso_8601": "2025-07-29T12:47:24.599467Z",
            "url": "https://files.pythonhosted.org/packages/24/d4/999d63debd1e53f18c95861ae425dcd4fca1e8ec1934c5906ca8da44e867/sentry_sdk-2.34.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b305546f8b9baa303b9e9b38feab79222935d0a279f0ed4d2e2cb6e5a0963055",
                "md5": "ca58b9a6c4bb95112b4885ebbad9f9fe",
                "sha256": "a024baf3bb229d4b482cb58e9755c212a157813a655f186060533e75a72240ea"
            },
            "downloads": -1,
            "filename": "sentry_sdk-2.34.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ca58b9a6c4bb95112b4885ebbad9f9fe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 336952,
            "upload_time": "2025-07-29T12:47:26",
            "upload_time_iso_8601": "2025-07-29T12:47:26.590659Z",
            "url": "https://files.pythonhosted.org/packages/b3/05/546f8b9baa303b9e9b38feab79222935d0a279f0ed4d2e2cb6e5a0963055/sentry_sdk-2.34.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-29 12:47:26",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "getsentry",
    "github_project": "sentry-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "sentry-sdk"
}
        
Elapsed time: 0.89264s