semvec/pypi-packages huggingface dataset:
crud-mysql 0.1.9
crud defiend by json
Requires Python: >=3.7

main.py / app.py - example

from flask import Flask
from flask_cors import CORS
from crud_mysql import crud

app = Flask(__name__)

app.register_blueprint(crud)

if __name__ == "__main__":
	app.run(host="0.0.0.0", debug=True)

cred.json - example

{
    "user": {
        "allowd_methods": ["GET", "POST", "DELETE", "PUT"],
        "fetch_all": "true",
        "schema": {
            "name": "VARCHAR(100)",
            "email": "VARCHAR(100)",
            "encrypted_password": "VARCHAR(100)",
            "account_id": "INT",
            "is_active": "INT"
        }
    },
    "account": {
        "allowd_methods": ["GET", "POST", "DELETE"],
        "fetch_all": "false",
        "schema": {
            "name": "VARCHAR(100)",
            "subscription_type": "VARCHAR(100)",
            "root_user": "INT"
        }
    }
}

using tokens:

to protect endpoints by verifying tokens - add protected_methods to that object for example:

{
    "car": {
        "allowd_methods": ["GET", "POST", "DELETE", "PUT"],
        "protected_methods": ["GET"],
        "fetch_all": "true",
        "schema": {
            "owner": "VARCHAR(100)",
            "color": "VARCHAR(100)",
            "licence_plate": "INT"
        }
    }
}

here when using "GET" to get a car we will need to add a token.

important: also add to app.py the line: 
set_jwt_protection(app) 

in order for this to work a few things need to be set:
an environment varriable JWT_ALGORITHM should be set. 
the options are:
- RS256
- HS256
if none are set it will default to HS256.

if the algorithim being used is HS256 then a variable needs to be set for SECRET_KEY.
this has to be the same SECRET_KEY that was used for creating the jwt.

if the algorithim being used is RS256. a variable needs to be set for SECRET_KEYS_PATH.
and at that path there needs to be a public.pem
it has to be the same cert that was used to create the jwt.
rlcmab-sampler 1.0.1
Gaussian reward sampler for Contextual Bandit news recommendation system
Requires Python: >=3.12

# rlcmab-sampler

A reward sampler for Contextual Bandit news recommendation systems.

## Installation

```bash
pip install rlcmab-sampler
```

## Quick Start

```python
from sampler import sampler

# Initialize with your roll number (i)
reward_sampler = sampler(i=42)

# Get a reward from arm j
reward = reward_sampler.sample(j=5)
print(reward)

# Sample a few arms
for j in range(3):
    print(j, reward_sampler.sample(j))
```

## API Reference

### `sampler(i, n_arms=12)`

Initialize a new sampler instance.

**Parameters:**

- `i` (int): Student ID used to seed the random number generator
- `n_arms` (int, optional): Number of arms/articles. Default: 12

**Attributes:**

- `means`: List of mean values for each Gaussian distribution
- `stds`: List of standard deviations for each Gaussian distribution
- `distributions`: List of scipy.stats.norm distribution objects

### `sample(j)`

Sample a reward from the specified arm.

**Parameters:**

- `j` (int): Arm index (must be between 0 and 11)

**Returns:**

- `float`: Reward value sampled from the arm's Gaussian distribution

**Raises:**

- `ValueError`: If `j` is not in the valid range [0, 11]

## Reproducibility

For the same student ID `i`, the generated arm distributions remain the same
across runs. Different student IDs map to different distributions.

## License

[MIT License](LICENSE)