semvec/pypi-packages huggingface dataset:
rest-api-auth-manager 1.0.4
Simple manager for REST API authentication and authorization (token based)
Requires Python: >=3.7

# rest-api-simple-auth-manager

Simple REST API authentication and authorization manager, designed to operate with token-based security. This package is intended to act as a middleware, providing a secure method for verifying user credentials before granting access to the requested resource.

The current implementation relies on a Redis instance to store and manage credentials. However, we are working on integrating other database options to offer more flexibility and customization.

### Install

```bash
pip install rest_api_auth_manager
```

### Initializing the auth manager

```python
from rest_api_auth_manager import AuthManager, Config

class CustomConfig(Config):
    credentials_database_host = "127.0.0.1"
    environment = "dev"
    token_length = 16

auth_manager = AuthManager(CustomConfig)
```

### Add new user

```python
user = {
    "alias": "ASH_KETCHUM",
    "name": "Ash Ketchum",
    "email": "ash@test.com",
    "roles": ["pokemons:get"],
}

token = auth_manager.add_user(user)
```

### Granting usage on a specific resource

```python
auth_manager.add_role_to_user("ASH_KETCHUM", "pokemons:post")
```

### Verifying requests authentication and authorization

```python
token = "SUPER_SECRET"
auth_manager.verify_auth(token, "api/pokemon", "GET")
```
SentenceMatcher 0.0.1
A simple yet useful module that allows you to match a sentence against a list of sentences and return the closest match.
Keywords: python,ai,sentencematch,sentence,match,difflib,closestmatch,language,naturallanguage


# SentenceMatcher
### A simple yet useful module that allows you to match a sentence against a list of sentences and return the closest match

<br>

Sample Code:
```python
from SentenceMatcher import SentenceMatch
list_of_sentences = ["Hey there!", "How're you?", "How's your day going?", "So tell me about yourself please!"]
sentence = "Please tell me about you."

output, accr = SentenceMatch(sentence, list_of_sentences)
print("Closest Match:", sentence)
print("Accuracy:", accr)
```

Output:
```
Closest Match: So tell me about yourself please!
Accuracy: 80.0
```

<br>

## Explanation
The module contains only one function: SentenceMatch(to_be_matched, list_to_match_against)
The first parameter is for the sentence that you want to match against a list of sentences, and the second parameter is for that list of sentences. The function returns 2 values, the output followed by the accuracy of the output.
Behind the scenes, the function matches the sentence against every sentence in the list of sentences and calculates a percentage (accuracy) value for each. It then returns the sentence with the highest accuracy and returns both the sentence and that accuracy.

HOWEVER:
Common symbols aren't taken into account, and the case of the letters isn't taken into account as well. It's better to avoid symbols anyways.

<br>
<h2 style="text-align:center">Mahdi Tajwar, 2023</h2>
<br><br>


# License
Copyright 2023 Mahdi Tajwar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
botik-vkbottle 0.0.1
Extension for Botik to support VKBottle
Requires Python: >=3.7
Keywords: api,framework,bot,vk,messenger,async,botik

# Расширение Botik для работы с VK

[Ядро фреймворка](https://github.com/dasstyx/botik)

[Техническая документация](https://botik.readthedocs.io)
samclipdiffusion 0.0.3b0
A package for clip-guided diffusion

# SAM + CLIP + DIFFUSION

Stuff about this pipeline was a bit harder to run and follow, I wanted to write a simple package to allow people to use it with a higher level of abstraction. Based on the repos on the citation part.

<div style="display:flex;justify-content:center;">
  <img src="static/segmented.png" style="margin-right:10px;width:30%;" />
  <img src="static/masks.png" style="margin-right:10px;width:30%;" />
  <img src="static/diffused.png" style="width:30%;" />
</div>

## Installation

```bash
pip install samclipdiffusion
```

## Usage

```bash
!wget https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth
```

```python
from samclipdiffusion import ImageSegmenter
segmenter_inp = ImageSegmenter()

image_path = 'image_path'
search_text = "target object"
prompt = "how to modify"

inpainted_image = segmenter_inp.inpaint_image(image_path, search_text, prompt)
```

## Examples

[Examples](/examples/) with and w/o installing the package.

## Citation

This repository is based on the following repos, I just merged them together and made some changes to make it work.

https://github.com/IDEA-Research/Grounded-Segment-Anything/blob/main/grounded_sam.ipynb
https://github.com/maxi-w/CLIP-SAM/blob/main/main.ipynb

## TODO

- [ ] Add more examples
- [ ] Optimize, make it memory efficient, it's awful right now
- [ ] Add better images to the examples :D