semvec/pypi-packages huggingface dataset:
apirl 0.1.0
A Python package to manage API rate limits by automatically queuing and pacing API requests.
Requires Python: >=3.6

# apirl

`apirl` is a Python package designed to manage API rate limits by automatically queuing and pacing API requests. It supports various APIs and provides customizable rate limiting strategies to help avoid hitting API rate limits.

## Installation

You can install `apirl` using pip:

```bash
pip install apirl
```

## Usage

Here is an example of how to use 'apirl' to manage API rate limits:

#### 1. Set Up Environment Variables

Create a .env file in the root directory of your project and add your API keys and any other necessary environment variables:

```
API_KEY=your_api_key_here
```

#### 2. Example Usage

```
import os
from dotenv import load_dotenv
from apirl.core import RateLimiter
from apirl.queue import RateLimitedQueue
import http.client
import ssl
import certifi

# Load environment variables
load_dotenv()

# Initialize RateLimiter and RateLimitedQueue
rate_limiter = RateLimiter(rate_limit=5, per_seconds=10)
rate_limited_queue = RateLimitedQueue(rate_limiter, "https://your-api-base-url.com")

def make_api_call(method, endpoint, headers, body=None):
    try:
        context = ssl.create_default_context(cafile=certifi.where())
        conn = http.client.HTTPSConnection("your-api-host.com", context=context, timeout=10)
        conn.request(method, endpoint, body=body, headers=headers)
        res = conn.getresponse()
        status = res.status
        data = res.read()
        if status == 200:
            print(f"Response for {endpoint}: {data.decode('utf-8')}")
        else:
            print(f"Error {status} for {endpoint}: {data.decode('utf-8')}")
    except (http.client.HTTPException, ssl.SSLError) as e:
        print(f"Network error for {endpoint}: {e}")

if __name__ == "__main__":
    headers = {
        'Authorization': f'Bearer {os.getenv("API_KEY")}',
        'Content-Type': 'application/json'
    }
    endpoints = [
        ('GET', '/endpoint', headers)
    ]
    for method, endpoint, headers in endpoints:
        rate_limited_queue.put(make_api_call, method, endpoint, headers)
    rate_limited_queue.queue.join()
```
## Features

- Rate Limiter: Manages and enforces API rate limits with configurable limits and intervals.
- Rate-Limited Queue: Queues API requests and ensures they are sent within rate limit constraints.
- Customizable Headers: Supports custom headers for API requests.
- SSL Certificate Handling: Uses certifi to manage SSL certificates.

## Contributing 

Contributions are welcome! Feel free to submit bug reports, feature requests, or pull requests through GitHub issues and pull requests.

## License

This project is licensed under the MIT License - see the LICENSE file for details.
virtulizorAdmin 0.1.0
A brief description of your library
Requires Python: >=3.6

# virtulizorAdmin

A brief description of what your library does.

## Installation

You can install the library using pip:

```
pip install virtulizorAdmin
```

## Usage

An example of how to use your library:

```python
from virtulizorAdmin import admin

# Your code here
```
quickrag 0.2.1
A Quick Retrieval-Augmented Generation (RAG) system using transformers.
Requires Python: >=3.6

# QuickRAG

QuickRAG is a Python library that implements a Retrieval-Augmented Generation (RAG) pipeline for question answering on PDF documents. It combines document processing, embedding generation, and language model inference to provide context-aware answers to user queries.

## Features

- PDF processing and text extraction
- Text chunking and embedding generation
- Efficient similarity search for relevant context retrieval
- Integration with Hugging Face Transformers for language model inference
- Support for quantization to optimize memory usage and inference speed

## Installation

```bash
pip install quickrag
```

## Usage

Here's a basic example of how to use QuickRAG:

```python
from quickrag import QuickRAG

# Initialize QuickRAG
rag = QuickRAG("path/to/your/document.pdf", huggingface_token="YOUR_HUGGINGFACE_TOKEN")

# Process the PDF and create embeddings
rag.process_pdf()
rag.create_embeddings()

# Load the language model
rag.load_llm()

# Ask a question
query = "What are the macronutrients, and what roles do they play in the human body?"
answer = rag.ask(query)

print(f"Query: {query}")
print(f"Answer: {answer}")
```

## Configuration

QuickRAG can be customized with the following parameters:

- `pdf_path`: Path to the PDF document
- `embedding_model_name`: Name of the sentence transformer model for embeddings (default: "all-mpnet-base-v2")
- `llm_model_name`: Name of the language model for answer generation (default: "google/gemma-2b-it")
- `use_quantization`: Whether to use quantization for the language model (default: True)
- `huggingface_token`: Your Hugging Face API token

## Requirements

- Python 3.7+
- PyTorch
- Transformers
- Sentence-Transformers
- PyMuPDF
- spaCy
- NumPy
- Pandas

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## Acknowledgements

- Hugging Face for their Transformers library
- Sentence-Transformers for the embedding models
- PyMuPDF for PDF processing