semvec/pypi-packages huggingface dataset:
django-rbaca 1.1.1
Role-based access control with attributes for Django
Requires Python: <4.0,>=3.9

<a name="readme-top"></a>

<br />
<div align="center">
  <a href="https://github.com/MickaelCormier/django-rbaca/blob/main/assets/rbaca_logo.jpg">
    <img src="assets/rbaca_logo.jpg" alt="Logo" width="80" height="80">
  </a>

<h3 align="center">django-rbaca</h3>

  <p align="center">
    Role-based Access Control with Attributes for distributed Django projects.
    <br />
  </p>
</div>

## About The Project
Welcome to Role-Based Access Control with Attributes for distributed Django projects!

This project provides a secure and scalable solution for access control in Django applications. It extends the traditional role-based access control (RBAC) model with attributes to offer finer-grained control over resource access. The implementation is designed to allow decentralized nodes to have access to resources controlled by a central endpoint.

The project offers a Django app for easy integration into existing projects. It includes models for defining roles, attributes, access control policies, as well as an authorization backend for enforcing access control rules. The app also features an API for querying the access control system.

### Key Features
- **Role-based access control**: Users are assigned roles that define their access to resources.
- **Attribute-based access control**: Attributes are assigned to resources and users for finer-grained control over access.
- **Access control API for external nodes**: Centralized access control interface for decentralized nodes.
- **Easy integration**: The Django app is designed for seamless integration into existing projects.

## Installation

**Using pip (from PyPI):**

```bash
pip install django-rbaca
```

**Using poetry (local development):**

1. Clone the repository:

```bash
git clone https://github.com/MickaelCormier/django-rbaca
```

2. Navigate to the project directory:

```bash
cd django-rbaca
```

3. Install dependencies:

```bash
poetry install
```

## Documentation
For more detailed information, including prerequisites, configuration, and usage examples, please refer to the [documentation](url).

## Citation
If you find this project useful in your research, please consider cite:

```bash
@misc{django-rbaca,
    title={django-rbaca: Roll-based Access Control with Attributes for distributed Django projects.},
    author={Bruch, Steven and Cormier, Mickael},
    howpublished = {\url{https://github.com/MickaelCormier/django-rbaca/}},
    year={2024}
}
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>
twitchypy_irc 0.1.3
Allows you to connect to Twitch IRC and send and receive messages.
Requires Python: <4.0,>=3.8

## Python Twitch IRC Library

This is a simple Python library for connecting to the Twitch IRC chat and sending/receiving messages.

### Twitch

This is the main class for the Twitch IRC client and has the following methods:

- `__init__(self, user: str = "justinfan12345", token: str = "oauth:1234567890")`: Initializes the client with the given
  username and OAuth token.
- `join(self, channel: str) -> None`: Joins the given channel.
- `leave(self, channel: str) -> None`: Leaves the given channel.
- `connect(self) -> None`: Connects to the Twitch IRC server.
- `disconnect(self) -> None`: Disconnect from the Twitch IRC server.
- `send_message(self, channel: str, message: str) -> None`: Sends a message to the given channel.
- `send_reply(self, message_id: str, channel: str, reply: str) -> None`: Sends a reply to the given message.
- `read(self) -> Generator[TwitchPrivateMessage, None, None]`: Reads messages from the Twitch IRC server.

### TwitchPrivateMessage

This class represents a Twitch private message and has the following attributes:

- `badges` (set): A set of strings representing the badges the user has.
- `color` (str): The color of the user's username in the chat.
- `name` (str): The user's display name.
- `first_message` (bool): Whether this is the user's first message in the chat.
- `message_id` (str): The ID of the message.
- `is_moderator` (bool): Whether the user is a moderator.
- `is_broadcaster` (bool): Whether the user is the broadcaster.
- `is_returning_chatter` (bool): Whether the user has been in the chat before.
- `room_id` (int): The ID of the room.
- `is_subscriber` (bool): Whether the user is a subscriber.
- `is_turbo` (bool): Whether the user has Twitch Turbo.
- `user_id` (int): The ID of the user.
- `name` (str): The user's name.
- `channel` (str): The channel the message was sent to.
- `content` (str): The contents of the message.

### Usage

To use this library, create a `Twitch` instance and call its methods to connect to the Twitch IRC chat and send/receive
messages.

```python
from twitch import Twitch

client = Twitch(user="your_username", token="your_oauth_token")
client.connect()
client.join("your_channel")
client.send_message("your_channel", "Hello, world!")
for message in client.read():
    print(message.name + ": ", message.content)
client.disconnect()
```

### Contributing

All contributions are welcome! Please open an issue or pull request if you have any suggestions or find any bugs.

### License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
xtrain 0.4.3
A Flax trainer
Requires Python: <4.0,>=3.10

## XTRAIN: a tiny library for training [Flax](https://github.com/google/flax) models.

Design goals:

  - Help avoiding boiler-plate code
  - Minimal functionality and dependency
  - Agnostic to hardware configuration (e.g. GPU->TPU)

### General workflow

#### Step 1: define your model

```
class MyFlaxModule(nn.Module):
  @nn.compact
  def __call__(self, x):
    ...
```

#### Step 2: define loss function

```
def my_loss_func(batch, prediction):
    x, y_true = batch
    loss = ....
    return loss
```

#### Step 3: create an iterator that supplies training data

```
my_data = zip(sequence_of_inputs, sequence_of_labels)
```

#### Step 4: train

```
# create and initialize a Trainer object
trainer = xtrain.Trainer(
  model = MyFlaxModule(),
  losses = my_loss_func,
  optimizer = optax.adam(1e-4),
)

train_iter = trainer.train(my_data) # returns a iterable object

# iterate the train_iter trains the model
for epoch in range(3):
  for model_out in train_iter:
    pass
  print(train_iter.loss_logs)
  train_iter.reset_loss_logs()
```

### Training data format

- tensowflow Dataset
- torch dataloader
- generator function
- other python iterable that produce numpy data

### Checkpointing

train_iter is orbax compatible.

```
import orbax.checkpoint as ocp
ocp.StandardCheckpointer().save(cp_path, args=ocp.args.StandardSave(train_iter))
```

### Freeze submodule
```
train_iter.freeze("submodule/Dense_0/kernel")
```

### Simple batch parallelism on multiple device
```
# Add a new batch dim to you dataset
ds = ds.batch(8)
# create trainer with the Distributed strategy
trainer_iter = xtrain.Trainer(model, losses, optimizer, strategy=xtrain.Distributed).train(ds)
```

### API documentation

https://jiyuuchc.github.io/xtrain/
spotify-mcp 0.1.0
MCP spotify project
Requires Python: >=3.12

# spotify-mcp MCP server

MCP project to connect Claude with Spotify. Built on top of [spotipy-dev's API](https://github.com/spotipy-dev/spotipy/tree/2.24.0).

## Features
- Start, pause, and skip playback
- Search for tracks/albums/artists/playlists
- Get info about a track/album/artist/playlist
- Manage the Spotify queue

## Demo

Make sure to turn on audio

https://github.com/user-attachments/assets/20ee1f92-f3e3-4dfa-b945-ca57bc1e0894


## Configuration

### Getting Spotify API Keys
Create an account on [developer.spotify.com](https://developer.spotify.com/). Navigate to [the dashboard](https://developer.spotify.com/dashboard). 
Create an app with redirect_uri as http://localhost:8888. (You can choose any port you want but you must use http and localhost). 
I set "APIs used" to "Web Playback SDK".

### Run this project locally
This project is not yet set up for ephemeral environments (e.g. `uvx` usage). 
Run this project locally by cloning this repo

```bash
git clone https://github.com/modelcontextprotocol/servers.git
```

Add this tool as a mcp server.

On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`
On Windows: `%APPDATA%/Claude/claude_desktop_config.json`


  ```json
  "spotify": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/spotify_mcp",
        "run",
        "spotify-mcp"
      ],
      "env": {
        "SPOTIFY_CLIENT_ID": YOUR_CLIENT_ID,
        "SPOTIFY_CLIENT_SECRET": YOUR_CLIENT_SECRET,
        "SPOTIFY_REDIRECT_URI": "http://localhost:8888"
      }
    }
  ```

## TODO

Unfortunately, a bunch of cool features have [now been deprecated](https://techcrunch.com/2024/11/27/spotify-cuts-developer-access-to-several-of-its-recommendation-features/) 
from the Spotify API. Most new features will be relatively minor or for the health of the project:
- tests.
- adding API support for managing playlists.
- adding API support for paginated search results/playlists/albums.

## Deployment

(todo)

### Building and Publishing

To prepare the package for distribution:

1. Sync dependencies and update lockfile:
```bash
uv sync
```

2. Build package distributions:
```bash
uv build
```

This will create source and wheel distributions in the `dist/` directory.

3. Publish to PyPI:
```bash
uv publish
```

Note: You'll need to set PyPI credentials via environment variables or command flags:
- Token: `--token` or `UV_PUBLISH_TOKEN`
- Or username/password: `--username`/`UV_PUBLISH_USERNAME` and `--password`/`UV_PUBLISH_PASSWORD`

### Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging
experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).


You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:

```bash
npx @modelcontextprotocol/inspector uv --directory /Users/varun/Documents/Python/spotify_mcp run spotify-mcp
```


Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
intentional-pipecat 0.0.1
Plugin that lets you build transcribed audio voice bots using Pipecat
Requires Python: >=3.10

# Intentional - Pipecat

[![Made for Intentional](https://img.shields.io/badge/made_for-intentional-blue)](https://intentional-ai.github.io/intentional/docs/home/)
[![PyPI - Version](https://img.shields.io/pypi/v/intentional-pipecat.svg)](https://pypi.org/project/intentional-pipecat)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/intentional-pipecat.svg)](https://pypi.org/project/intentional-pipecat)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/intentional-pipecat)](https://pypistats.org/packages/intentional-pipecat)
[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-orange.json)](https://github.com/copier-org/copier)

Plugin that lets you build transcribed audio voice bots using Pipecat.

-----

## Table of Contents

- [Installation](#installation)
- [License](#license)

## Installation

You can install `intentional-pipecat` without extras:

```console
pip install intentional-pipecat[silero,deepgram,openai]
```

However, it will be unusable as-is, because it will come with nearly no dependencies.

In order to have any of the underlying dependencies installed (such as Silero's VAD, Deepgram, OpenAI, etc...) you must specify them as extras, like:

```console
pip install intentional-pipecat[silero,deepgram,openai]
```

For a list of all the available extras, see Pipecat's documentation or [their `pyproject.toml` file](https://github.com/pipecat-ai/pipecat/blob/main/pyproject.toml). We are going to try to keep this list up-to-date on Intentional's end, but in case of issues you can also install those dependencies by hand by doing:

```console
pip install pipecat-ai[<the extras you want>]
```

This guarantees that you get the correct extras for your version of Pipecat. Please open an issue if you find any discrepancies.

## Usage

In order to use Pipecat, you need to specify which components you want to use in the configuration file. For example:

```yaml
bot:
  type: pipecat
  llm:
    client: openai
    name: gpt-4o
  vad:
    module: silero
    client: SileroVADAnalyzer
  stt:
    module: deepgram
    client: DeepgramSTTService
  tts:
    module: azure
    client: AzureTTSService
```

This example would require the extras `silero`, `deepgram` and `azure`:

```console
pip install intentional-pipecat[silero,deepgram,azure]
```

See [Pipecat's documentation](https://docs.pipecat.ai/getting-started/overview) for more information about what modules and classes are available for the various pipeline components.

At this time, the Pipeline structure itself cannot be configured. [Open an issue](https://github.com/intentional-ai/intentional/issues/new) if you'd like to allow some degree of pipeline customization.

## License

`intentional` is distributed under the terms of the [AGPL](LICENSE.txt) license. If that doesn't work for you, [get in touch](mailto:github@zansara.dev).