Metadata-Version: 2.4
Name: siva_toolkit
Version: 0.6.2
Summary: Simple tools for easy use, made by siva
Home-page: https://github.com/technbrick/Siva-s-amazing-toolkit
Author: Sivamukilan
Author-email: sivamukilan.suren@gmail.com
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENCE.TXT
Requires-Dist: requests
Requires-Dist: ddgs
Requires-Dist: opencv-python
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Siva-amazing-toolkit

# Siva Toolkit

**A Python utility package for web search, weather information, calculations, and QR code scanning.**

Siva Toolkit is a Python package that brings together practical utilities behind a simple, easy-to-use API. It is designed for developers building Python applications, automation scripts, and AI assistants.

## ✨ Features

- 🌐 **Internet Search** — Search the web using DuckDuckGo.
- 🌦️ **Weather Information** — Retrieve current weather conditions for a location.
- 🧮 **Calculator** — Evaluate mathematical expressions with AST-based parsing.
- 📷 **QR Code Scanner** — Scan and decode QR codes using a webcam.

## 📦 Installation

Install Siva Toolkit using pip:

```bash
pip install siva-toolkit
```



## 🚀 Quick Start

```python
from siva_toolkit import (
    internet_search,
    scan_qr_code,
    get_weather,
    calculate
)

# Search the internet
print(internet_search("minecraft"))

# Scan a QR code using your webcam
scan_qr_code()

# Get current weather in Rawang
print(get_weather("Rawang"))

# Perform a calculation
print(calculate("1+1"))
```

## 📚 Usage

### 🌐 Internet Search

Search for information on the web.

```python
from siva_toolkit import internet_search

results = internet_search("Python programming")

print(results)
```

Specify the maximum number of results:

```python
results = internet_search(
    "Minecraft updates",
    max_results=3
)

print(results)
```

**Parameters**

| Parameter | Description | Default |
|---|---|---|
| `query` | Search query | Required |
| `max_results` | Maximum number of results | `5` |

### 🌦️ Weather

Retrieve current weather information for a location.

```python
from siva_toolkit import get_weather

print(get_weather("Rawang"))
print(get_weather("Kuala Lumpur"))
```

The function returns a text summary from the wttr.in weather service.

### 🧮 Calculator

Evaluate arithmetic expressions.

```python
from siva_toolkit import calculate

print(calculate("1+1"))
print(calculate("25 * 4"))
print(calculate("(100 - 20) / 4"))
print(calculate("2 ** 8"))
```

Supported operators include:

| Operator | Operation |
|---|---|
| `+` | Addition |
| `-` | Subtraction |
| `*` | Multiplication |
| `/` | Division |
| `//` | Floor division |
| `%` | Modulo |
| `**` | Exponentiation |

The calculator uses Python's AST parser and an allowlist of arithmetic operators rather than `eval()`.

### 📷 QR Code Scanner

Scan QR codes using your webcam.

```python
from siva_toolkit import scan_qr_code

result = scan_qr_code()

print("QR Code:", result)
```

Select a different camera if needed:

```python
scan_qr_code(camera_index=1)
```

**How it works:**
1. Opens the selected camera.
2. Detects QR codes in the video feed.
3. Highlights detected QR codes.
4. Returns the decoded content.

Press **Q** to close the scanner.

## 🤖 Built for Python Projects

Siva Toolkit can be integrated into a variety of projects, including:

- AI assistants and tool-calling systems
- Automation scripts
- Developer utilities
- Computer vision experiments
- Personal Python applications

For example, an AI assistant can use the package's functions as tools:

```python
from siva_toolkit import (
    internet_search,
    get_weather,
    calculate
)

weather = get_weather("Rawang")
search_results = internet_search("Minecraft")
answer = calculate("25 * 4")

print(weather)
print(search_results)
print(answer)
```

## ⚙️ Dependencies

The package uses libraries and services for its functionality, including:

- `requests` for HTTP requests
- `ddgs` for DuckDuckGo searches
- `opencv-python` for QR code detection

Dependencies should be installed automatically by pip if they are correctly declared in the package metadata.

**Requirements:** A supported Python version, internet access for online services, and a webcam for QR code scanning.

## 📝 Notes

- Weather and internet search depend on external services and network availability.
- QR scanning requires a working camera and the necessary camera permissions.
- QR codes are returned as decoded text; their contents are not automatically executed.
- Calculator errors are returned as descriptive messages.

## 👨‍💻 Author

**Siva**

*Siva Toolkit — Simple tools. Flexible integration.*
