core-sentry 1.0.2
This project provides common components related to the integration with Sentry...
Requires Python: >=3.9

core-sentry
===============================================================================

This project provides a set of common components related to the 
integration with Sentry designed to facilitate tracking errors and 
logs monitoring...

===============================================================================

.. image:: https://img.shields.io/pypi/pyversions/core-sentry.svg
    :target: https://pypi.org/project/core-sentry/
    :alt: Python Versions

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
    :target: https://gitlab.com/bytecode-solutions/core/core-sentry/-/blob/main/LICENSE
    :alt: License

.. image:: https://gitlab.com/bytecode-solutions/core/core-sentry/badges/release/pipeline.svg
    :target: https://gitlab.com/bytecode-solutions/core/core-sentry/-/pipelines
    :alt: Pipeline Status

.. image:: https://readthedocs.org/projects/core-sentry/badge/?version=latest
    :target: https://readthedocs.org/projects/core-sentry/
    :alt: Docs Status

.. image:: https://img.shields.io/badge/security-bandit-yellow.svg
    :target: https://github.com/PyCQA/bandit
    :alt: Security

|


Installation
===============================================================================

Install from PyPI using pip:

.. code-block:: bash

    pip install core-sentry
    uv pip install core-sentry  # Or using UV...


Features
===============================================================================

**Sentry SDK Initialization Decorator**

* **Automatic SDK Initialization**: Easily initialize Sentry SDK with a decorator-based approach
* **Tag Management**: Add custom tags for enhanced error tracking and filtering in Sentry dashboard
* **Smart Initialization**: Automatically prevents duplicate initialization when Sentry is already configured
* **Graceful Error Handling**: Logs warnings on initialization failures without breaking your application
* **Flexible Configuration**: Supports all standard Sentry SDK configuration options:

  * ``dsn``: Sentry Data Source Name for routing events
  * ``env``: Environment tagging (production, staging, development, etc.)
  * ``traces_sample_rate``: Configurable transaction tracing (defaults to 0.1)
  * ``send_default_pii``: Control personally identifiable information transmission
  * And all other Sentry SDK options

* **Multiple Decorator Syntax**: Use with or without parentheses for flexibility
* **Type-Safe**: Fully typed with Python type hints for better IDE support


Quick Start
===============================================================================

Installation
-------------------------------------------------------------------------------

Install the package:

.. code-block:: bash

    pip install core-sentry
    uv pip install core-sentry  # Or using UV...
    pip install -e ".[dev]"    # For development...

Setting Up Environment
-------------------------------------------------------------------------------

1. Install required libraries:

.. code-block:: bash

    pip install --upgrade pip
    pip install virtualenv

2. Create Python virtual environment:

.. code-block:: bash

    virtualenv --python=python3.12 .venv

3. Activate the virtual environment:

.. code-block:: bash

    source .venv/bin/activate

Install packages
-------------------------------------------------------------------------------

.. code-block:: bash

    pip install .
    pip install -e ".[dev]"

Check tests and coverage
-------------------------------------------------------------------------------

.. code-block:: shell

    python manager.py run-tests
    python manager.py run-coverage


Contributing
===============================================================================

Contributions are welcome! Please:

1. Fork the repository
2. Create a feature branch
3. Write tests for new functionality
4. Ensure all tests pass: ``pytest -n auto``
5. Run linting: ``pylint core_sentry``
6. Run security checks: ``bandit -r core_sentry``
7. Submit a pull request


License
===============================================================================

This project is licensed under the MIT License. See the LICENSE file for details.


Links
===============================================================================

* **Documentation:** https://core-sentry.readthedocs.io/en/latest/
* **Repository:** https://gitlab.com/bytecode-solutions/core/core-sentry
* **Issues:** https://gitlab.com/bytecode-solutions/core/core-sentry/-/issues
* **Changelog:** https://gitlab.com/bytecode-solutions/core/core-sentry/-/blob/master/CHANGELOG.md
* **PyPI:** https://pypi.org/project/core-sentry/


Support
===============================================================================

For questions or support, please open an issue on GitLab or contact the maintainers.


Authors
===============================================================================

* **Alejandro Cora González** - *Initial work* - alek.cora.glez@gmail.com