An open API service indexing awesome lists of open source software.

https://github.com/bugsplat-git/bugsplat-py

🐛🐍💥 BugSplat error reporting integration for Python
https://github.com/bugsplat-git/bugsplat-py

bugsplat error-reporting exception-reporting python

Last synced: 3 months ago
JSON representation

🐛🐍💥 BugSplat error reporting integration for Python

Awesome Lists containing this project

README

        

[![bugsplat-github-banner-basic-outline](https://user-images.githubusercontent.com/20464226/149019306-3186103c-5315-4dad-a499-4fd1df408475.png)](https://bugsplat.com)


#

BugSplat

### **
Crash and error reporting built for busy developers.
**


Follow @bugsplatco on Twitter


Join BugSplat on Discord

## 👋 Introduction

This repo contains the source code for [bugsplat-py](https://github.com/BugSplat-Git/bugsplat-py), a BugSplat integration for reporting Unhandled Exceptions in Python.

## 🏗 Installation

BugSplat recommends you use [bugsplat-py](https://github.com/BugSplat-Git/bugsplat-py) with a Python [virtual environment](https://docs.python.org/3/library/venv.html). To create a virtual environment for your project please run the following command at your project's root directory:

```shell
python -m venv venv
```

Activate your virtual environment by running the following command:

```shell
# unix/macos
source venv/bin/activate

# windows
.\env\Scripts\activate
```

Install the [bugsplat](https://pypi.org/project/bugsplat) package using pip:

```bash
pip install bugsplat
```

## ⚙️ Configuration

1. Import the BugSplat class
```python
from bugsplat import BugSplat
```

2. Create a new BugSplat instance passing it the name of your BugSplat database, application and version

```python
bugsplat = BugSplat(database, application, version)
```

3. Optionally, you set default values for appKey, description, email, user and additionaFilePaths

```python
bugsplat.set_default_app_key('key!')
bugsplat.set_default_description('description!')
bugsplat.set_default_email('[email protected]')
bugsplat.set_default_user('Fred')
bugsplat.set_default_additional_file_paths([
'./path/to/additional-file.txt',
'./path/to/additional-file-2.txt'
])
```

4. Wrap your application code in a try except block. In the except block call post. You can override any of the default properties that were set in step 3

```python
try:
crash()
except Exception as e:
bugsplat.post(
e,
additional_file_paths=[],
app_key='other key!',
description='other description!',
email='[email protected]',
user='Barney'
)
```

5. Once you've posted a crash, navigate to the Crashes page and click the link in the ID column to be see the crash's details

BugSplat Crash Page

## 🧑‍💻 Development

To configure a development environment:

1. Clone the repository

```shell
git clone https://github.com/BugSplat-Git/bugsplat-py.git
```

2. Create a virtual environment

```shell
python -m venv .venv
```

3. Activate the virtual environment

```shell
# unix/macos
source .venv/bin/activate

# windows
.\.venv\Scripts\activate
```

4. Install the project's dependencies

```shell
pip install .
```

Thanks for using BugSplat ❤️