semvec/pypi-packages huggingface dataset:
ayto 1.0.1
A Python library for calculating couple probabilites for the TV show *Are You the One?*
Requires Python: >=3.7

# AYTO

[![PyPI version](https://badge.fury.io/py/ayto.svg)](https://badge.fury.io/py/ayto) ![Python version](https://img.shields.io/pypi/pyversions/ayto) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

A Python library for calculating couple probabilities for the TV show [Are You the One?](https://en.wikipedia.org/wiki/Are_You_the_One%3F).

## Installation

```
pip install ayto
```

## Usage

For a walkthrough of all of `ayto`'s functionality, see the [demo notebook](https://github.com/daturkel/ayto/blob/main/demo.ipynb).

```python
from ayto import AYTO

guys = ["Albert", "Bill", "Carl"]
girls = ["Daisy", "Emily", "Faith"]

season = AYTO(guys, girls)

# "there are 6 possible scenarios"
print(f"there are {season.num_scenarios} possible scenarios")

# Al and Daisy go to the Truth Booth and get "NO MATCH"
scenarios_left = season.apply_truth_booth("Albert", "Daisy", False)

# "4 scenarios remain"
print(f"{scenarios_left} scenarios remain")

# A matchup ceremony with 1 beam
scenarios_left = season.apply_matchup_ceremony(
    [("Albert", "Emily"), ("Bill", "Daisy"), ("Carl", "Faith")], beams=1
)

# "2 scenarios remain"
print(f"{scenarios_left} scenarios remain")

print(season.probabilities)
#         Albert  Billy  Carl
# Daisy      0.0    0.5   0.5
# Emily      0.5    0.0   0.5
# Faith      0.5    0.5   0.0

season.save("my_season")

# ...later, to restore everything:
loaded_season = AYTO.load("my_season")
print(loaded_season.probabilities)
#         Albert  Billy  Carl
# Daisy      0.0    0.5   0.5
# Emily      0.5    0.0   0.5
# Faith      0.5    0.5   0.0
```
brie-commit 1.1.0
A collection of cheesy pre-commit hooks.
Requires Python: >=3.8.1,<4.0.0

# brie-commit
A collection of cheesy [pre-commit](https://pre-commit.com/) hooks

## Using brie-commit with pre-commit
Add this to your `.pre-commit-config.yaml`

```yaml
repos:
-   repo: https://github.com/sco1/brie-commit
    rev: v1.1.0
    hooks:
    -   id: brie-commit
```

## Hooks
### `brie-commit`
This hook doesn't do anything except add cheese to your pre-commit invocation.

```bash
$ pre-commit run
🧀🧀🧀...................................................................Passed
```

### `up-to-no-gouda`
This hook replaces all instances of `good` with `gouda` in your text files.
bobtail-upload 0.0.1
Logging middleware for Bobtail

# Bobtail File Upload
Middleware to upload files for [Bobtail](https://github.com/joegasewicz/bobtail)

### Install
```bash
pip install bobtail-upload
```

### Usage
```python
from bobtail_upload import BobtailUpload

app = Bobtail(routes=routes)

app.use(BobtailUpload(options={}))
```

### Saving files
Bobtail Upload will attach the an Upload API to the request object
There are 2 methods now available:

- `add(self, *, file_name: str, data: bytes, mimetype: str) -> None`
- `save(self, *, table_name: str = None, pk: Union[int, str] = None) -> None`

```python
def post(self, req: Request, res: Response):
    data = req.get_multipart_data()
    req.upload.add(
        file_name=data["logo"]["value"]["filename"],
        data=data["logo"]["value"]["file_data"],
        mimetype=data["logo"]["value"]["mimetype"],
    )
    
    req.upload.save()
```

### Mapping file saves to your database tables
To save files based on a table name & primary key. 

The default upload directory path is `/uploads`
```
- uploads
  - images
    - 2
```
For example
```python
def post(self, req: Request, res: Response):
    data = req.get_multipart_data()
    req.upload.add(
        file_name=data["logo"]["value"]["filename"],
        data=data["logo"]["value"]["file_data"],
        mimetype=data["logo"]["value"]["mimetype"],
    )
    
    # Use your ORM to save the file to your db & obtain the returned primary key (pk)
    req.upload.save(table_name="images", pk=pk)
```

### Options
- UPLOAD_DIR - the directory path where files will be saved (defaults to `uploads`).
```python
options = {
    "UPLOAD_DIR": "uploads",
}
```