semvec/pypi-packages huggingface dataset:
mailpush 0.1.0
Official Mailpush SDK for Python
License: MIT
Requires Python: >=3.8
Keywords: email, api, mailpush, sdk, transactional

# Mailpush Python SDK

Official Python SDK for the [Mailpush](https://mailpush.app) email API.

## Installation

```bash
pip install mailpush
```

## Quick Start

```python
from mailpush import Mailpush, SendEmailRequest

client = Mailpush("mp_live_xxx")

response = client.emails.send(SendEmailRequest(
    from_address="hello@yourdomain.com",
    to="user@example.com",
    subject="Hello from Mailpush",
    html="<h1>Welcome!</h1>"
))

print(f"Email sent: {response.id}")
```

## Features

- Simple, intuitive API
- Full type hints support
- Automatic retries on rate limits
- Support for attachments
- Template support with variables

## Sending Emails

### Basic Email

```python
from mailpush import Mailpush, SendEmailRequest

client = Mailpush("mp_live_xxx")

response = client.emails.send(SendEmailRequest(
    from_address="hello@yourdomain.com",
    to="user@example.com",
    subject="Welcome!",
    html="<h1>Hello World</h1>",
    text="Hello World"
))
```

### With Multiple Recipients

```python
response = client.emails.send(SendEmailRequest(
    from_address="hello@yourdomain.com",
    to=["user1@example.com", "user2@example.com"],
    cc="manager@example.com",
    bcc=["admin@example.com"],
    subject="Team Update",
    html="<p>Important update...</p>"
))
```

### With Attachments

```python
import base64
from mailpush import Mailpush, SendEmailRequest, Attachment

client = Mailpush("mp_live_xxx")

with open("report.pdf", "rb") as f:
    content = base64.b64encode(f.read()).decode()

response = client.emails.send(SendEmailRequest(
    from_address="hello@yourdomain.com",
    to="user@example.com",
    subject="Your Report",
    html="<p>Please find attached your report.</p>",
    attachments=[
        Attachment(
            filename="report.pdf",
            content=content,
            content_type="application/pdf"
        )
    ]
))
```

### Using Templates

```python
response = client.emails.send(SendEmailRequest(
    from_address="hello@yourdomain.com",
    to="user@example.com",
    template_id="welcome-template-id",
    variables={
        "name": "John",
        "company": "Acme Inc"
    }
))
```

## Error Handling

```python
from mailpush import (
    Mailpush,
    SendEmailRequest,
    AuthenticationError,
    ValidationError,
    RateLimitError,
    MailpushError
)

client = Mailpush("mp_live_xxx")

try:
    response = client.emails.send(SendEmailRequest(
        from_address="hello@yourdomain.com",
        to="user@example.com",
        subject="Test",
        html="<p>Hello</p>"
    ))
except AuthenticationError:
    print("Invalid API key")
except ValidationError as e:
    print(f"Validation failed: {e.details}")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after} seconds")
except MailpushError as e:
    print(f"Error: {e.code} - {e}")
```

## Configuration

### Custom Base URL

```python
client = Mailpush("mp_live_xxx", base_url="https://api.custom.com")
```

## License

MIT
fastgoertzel 1.0.2
High-performance Goertzel algorithm implementation
License: MIT
Requires Python: >=3.10

![fastgoertzel Logo](https://raw.githubusercontent.com/0zean/fastgoertzel/master/docs/_static/dark%20logo.png#gh-light-mode-only)
![fastgoertzel Logo](https://raw.githubusercontent.com/0zean/fastgoertzel/master/docs/_static/light%20logo.png#gh-dark-mode-only)

<!-- start here -->

fastgoertzel ![GitHub Actions](https://github.com/0zean/fastgoertzel/actions/workflows/ci.yml/badge.svg)
============

A Python implementation of the Goertzel algorithm built using `C++` for improved run time and efficiency on large datasets and loops.


## To-Do:

- [x] ~~Improved speed.~~ (Significantly increased speed by using numpy arrays).
- [x] Implement benchmarking for speed comparison. (fastgoertzel is ~75 times faster than native python)
- [x] Implement batch processing for multiple frequencies.
- [ ] Add IIR and k-th FTT implementation of Goertzel.
- [ ] Add support for sampling rate.

## Installation

You can install using two methods:

Using `pip install`:
```bash
$ pip install fastgoertzel
```

Using `setup.py` after cloning repository:
```bash
$ git clone git://github.com/0zean/fastgoertzel.git
$ cd fastgoertzel
$ python -m build
```

## Usage
```python
import numpy as np
import pandas as pd

import fastgoertzel as fg


def wave(amp, freq, phase, x):
    return amp * np.sin(2*np.pi * freq * x + phase)


x = np.arange(0, 512)
y = wave(1, 1/128, 0, x)

amp, phase = fg.goertzel(y, 1/128)
print(f'Goertzel Amp: {amp:.4f}, phase: {phase:.4f}')

# Compared to max amplitude FFT output 
ft = np.fft.fft(y)
FFT = pd.DataFrame()
FFT['amp'] = np.sqrt(ft.real**2 + ft.imag**2) / (len(y) / 2)
FFT['freq'] = np.fft.fftfreq(ft.size, d=1)
FFT['phase'] = np.arctan2(ft.imag, ft.real)

max_ = FFT.iloc[FFT['amp'].idxmax()]
print(f'FFT amp: {max_["amp"]:.4f}, '
        f'phase: {max_["phase"]:.4f}, '
        f'freq: {max_["freq"]:.4f}')

```