semvec/pypi-packages huggingface dataset:
pac-hunter 0.1.2
Search donations from specific PACs to candidates of interest, using OpenFEC and fivethirtyeight data
License: MIT
Requires Python: >=3.7,<4.0

# pac_hunter :wolf:
A simple project inspired by frustration over employers attempting to raise money from their ~~employees~~ captive audiences for the purpose of fueling their purchase of loyalty from politicians via Political Action Committees (PACs) in the United States.

`pac_hunter` provides a wrapper around the fantastic API provided by the Federal Elections Committee called [OpenFEC](https://api.open.fec.gov/developers/). This tool is designed to match a PAC of interest with donations made to specific federal election candidates. The use case that inspired this tool was checking historical donations of a PAC to federal candidates or elected officials that denied the legitimacy of the 2020 election.

# Getting started
Check the jupyter notebook provided with this repository `demo.ipynb`. You will have to either request your own self-service API key from the OpenFEC project, or use their `"DEMO_KEY"` which has a stricter rate limit.

If you are not familiar with running jupyter notebooks from a local environment, look forward to a google colab notebook once I've published the package. In the meantime, you can run the demo yourself as long as you have python and git installed on your system.

```bash
git clone https://github.com/jlwhelan28/pac-hunter.git
cd pac-hunter
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install jupyter
jupyter notebook
```

##  Example: Raytheon Technologies' PAC donations to 2020 election deniers

![](heatmap_example.png)

# Future release
I'm hopeful to provide a small service that runs a `streamlit` app providing a simple interface to use this tool for non-developers. Beyond that, future plans will depend on interest.
atalert 0.1.10
Atalert slack alerting service helper module
License: MIT
Requires Python: >=3.7,<4.0
Keywords: alert,slack webhook,data pipeline,data engineering,data pipeline monitoring

# Atalert Python Package

**[Atalert.dev](atalert.dev)**

Too many different data notifications or alert packages got you down?

Start by using the Atalert Slack App to generate alert webhooks.

Customize the template, delivery channel, and notify your team.

Then, take note of the webhook URL slug for the code examples below!

It's a best practice to make as many different webhooks as you need for other functional areas, such as code deployments, new user registrations, and results of a long-running data pipeline. If there's information somewhere that's difficult to get to, use Atalert to send it to your Slack workspace.


## Installation

`pip install atalert` or `poetry add atalert`


## Basic Usage

```
import atalert


# add these to wherever you need to send a slack atalert, customize with your own data payload

# send an 'ok' atalert
atalert.ok('alert_slug_here', data)

# send a 'warning' atalert
atalert.warn('alert_slug_here', data)

# send an 'error' atalert
atalert.err('alert_slug_here', data)

```

You'll immediately get a custom alert notification in slack according to your webhook configuration. 

Then all your data or platform alerts are in the one place you are every day, Slack!


## Sending Files to Slack

First, configure your alert within the Atalert Slack App to use the 'attachment' template type.

Then, use any of the following methods:

```
from atalert import ok_file, warn_file, err_file

# send 'data.json' in the current working directory as a file attachment with OK status
ok_file('alert_slug_here', './data.json')

# send 'error.log' in as a file with ERROR status
err_file('alert_slug_here', './error.log')

# send 'datacat.jpg' as a picture with WARNING status
warn_file('alert_slug_here', './datacat.jpg')

```

Enjoy fine file-based data in your Slack workspace!


## Decorator Usage

Want to simplify error notifications? Need to automatically send a method's return object somewhere? Use the decorators!

```
from atalert import atalert_on_error
from atalert import atalert_ok_result

# decorator configured with a webhook url slug, will forward any exceptions
@atalert_on_error('alert_slug_here')
def main_processing_method(*args, **kwargs):

	# do some things here that may go wrong and throw exceptions
	numbers = business / 0

	return numbers

@atalert_ok_result('alert_slug_here')
def alternate_processing_method(*args, **kwargs):
	# do some math here that you want to send to slack
	numbers = statistics.stdev(args)
	# whatever you return will automagically go to your predefined slack channel
	return numbers 

```

You'll get your code exception or method results sent directly to slack!