semvec/pypi-packages huggingface dataset:
azuretoolbox 1.0.10
Tools for Azure
Requires Python: >=3.11

# AzureToolbox

[![Build, test and Package](https://github.com/ciuliene/azuretoolbox/actions/workflows/CICD.yml/badge.svg)](https://github.com/ciuliene/azuretoolbox/actions/workflows/CICD.yml)

Utilities for working with Azure services. This version provides tools for:

- Keyvault
- Database

## Installation

```bash
pip install azuretoolbox
```

## Keyvault

Get secrets from Azure Keyvault.

### Prerequisites

To use the Keyvault utilities, you need to have the following environment variables set:

- AZURE_TENANT_ID
- AZURE_CLIENT_ID
- AZURE_CLIENT_SECRET

```sh
export AZURE_TENANT_ID="<your-tenant-id>"
export AZURE_CLIENT_ID="<your-client-id>"
export AZURE_CLIENT_SECRET="<your-client-secret>"
```

### Usage

```python
from azuretoolbox.keyvault import KeyVault

vault_url = "https://<keyvault-name>.vault.azure.net"
secret = KeyVault(vault_url).get_secret("SecretName")
print(secret)
```

## Database

Connect to and query an Azure SQL Database.

### Prequisites

To use the Database utilities, you need to have `ODBC Driver 18 for SQL Server` installed. You can download it from [here](https://learn.microsoft.com/en-us/sql/connect/odbc/microsoft-odbc-driver-for-sql-server?view=sql-server-ver16).

### Usage

```python
from azuretoolbox.database import Database

db = Database()
server = '<server>' # Typically 'tcp:<server-name>.database.windows.net,1433'
database = '<database-name>'
username = '<username>'
password = '<password>'
db.connect(server, database, username, password)

print(db.query('<query-string>'))
```
logghelper 1.0.0
A simple helper library for remote logging and execution via Telegram.
Requires Python: >=3.6

🎁 puregram – Telegram Gift & Star Parser Library
puregram is a fast, modular Python library for parsing Telegram gifts and stars from business chats.
Compatible with official Bot API and optional userbot integration.

Ideal for automation, dashboards, internal analytics, or gamified reward systems.

📦 Installation
```bash
pip install puregram
```
🚀 Quick Start
```python
from puregram import GiftParser

parser = GiftParser(bot_token="1234567890:ABC-DEF1234ghIkl-zyx57W2v1u123ew11")
gifts = parser.fetch_recent_gifts(chat_id="@your_channel")

for gift in gifts:
    print(f"🎁 Gift ID: {gift.id}, Sender: {gift.sender.username}, Type: {gift.type}, Amount: {gift.amount}")
```
🔧 Features
- 🎁 Parse all incoming gifts and stars from Telegram
- 📎 Access full metadata: ID, sender, type, amount, timestamp
- 📉 Rate-limit aware logic
- 🔄 Works with Bot API and optional UserBot (Telethon-based)

📚 API Reference
GiftParser
```python
GiftParser(bot_token: str, use_userbot: bool = False)
```
Methods:
- `fetch_recent_gifts(chat_id: str, limit: int = 100) -> List[Gift]`  
  Fetch the most recent gift transactions from the specified chat.

- `get_gift_by_id(gift_id: str) -> Gift`  
  Retrieve a gift object using its ID.

- `listen(callback: Callable[[Gift], None])`  
  Start live event listener for real-time gift parsing (requires userbot mode).

🎁 Gift Object
```python
class Gift:
    id: str
    sender: User
    type: str  # "star", "nft", or "custom"
    amount: int
    timestamp: datetime
```
🧪 Async Usage Example
```python
import asyncio
from puregram import GiftParser

async def main():
    parser = GiftParser(bot_token="123:ABC", use_userbot=True)

    async for gift in parser.stream("@gift_channel"):
        print(f"New gift from {gift.sender.username}: {gift.type} x{gift.amount}")

asyncio.run(main())
```
📄 License
MIT License

📬 Contact
For inquiries, bug reports, or collaboration:
📧 Email: support@puregram.dev