Metadata-Version: 2.4
Name: maticlib
Version: 0.2.2
Summary: A Python Automation Library for Creating Agents
Author-email: Arvoh Software <arvohsoft@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/arvohsoft/maticlib.git
Project-URL: Repository, https://github.com/arvohsoft/maticlib.git
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.24.0
Requires-Dist: pydantic
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-httpx>=0.28.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: python-dotenv>=1.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.5.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
Requires-Dist: mkdocstrings[python]>=0.22.0; extra == "docs"
Requires-Dist: black>=23.0.0; extra == "docs"
Provides-Extra: rag
Requires-Dist: pypdf>=3.0.0; extra == "rag"
Requires-Dist: python-docx>=0.8.11; extra == "rag"
Requires-Dist: beautifulsoup4>=4.12.0; extra == "rag"
Requires-Dist: rank-bm25>=0.2.2; extra == "rag"
Requires-Dist: numpy>=1.24.0; extra == "rag"
Provides-Extra: chunking
Requires-Dist: tiktoken>=0.5.0; extra == "chunking"
Requires-Dist: numpy>=1.24.0; extra == "chunking"
Provides-Extra: chroma
Requires-Dist: chromadb>=0.4.0; extra == "chroma"
Provides-Extra: milvus
Requires-Dist: pymilvus[milvus_lite]>=2.3.0; extra == "milvus"
Provides-Extra: pinecone
Requires-Dist: pinecone-client>=3.0.0; extra == "pinecone"
Provides-Extra: qdrant
Requires-Dist: qdrant-client>=1.7.0; extra == "qdrant"
Provides-Extra: sqlite
Provides-Extra: mysql
Requires-Dist: pymysql>=1.1.0; extra == "mysql"
Requires-Dist: sqlalchemy>=2.0.0; extra == "mysql"
Requires-Dist: sqlglot>=20.0.0; extra == "mysql"
Provides-Extra: postgresql
Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgresql"
Requires-Dist: sqlalchemy>=2.0.0; extra == "postgresql"
Requires-Dist: sqlglot>=20.0.0; extra == "postgresql"
Provides-Extra: text2sql
Requires-Dist: sqlalchemy>=2.0.0; extra == "text2sql"
Requires-Dist: sqlglot>=20.0.0; extra == "text2sql"
Provides-Extra: tabular
Requires-Dist: pandas>=2.0.0; extra == "tabular"
Requires-Dist: openpyxl>=3.1.0; extra == "tabular"
Requires-Dist: pyarrow>=14.0.0; extra == "tabular"
Requires-Dist: sqlalchemy>=2.0.0; extra == "tabular"
Provides-Extra: reranking
Requires-Dist: sentence-transformers>=2.2.0; extra == "reranking"
Provides-Extra: observability
Requires-Dist: tiktoken>=0.5.0; extra == "observability"
Provides-Extra: all-rag
Requires-Dist: pypdf>=3.0.0; extra == "all-rag"
Requires-Dist: python-docx>=0.8.11; extra == "all-rag"
Requires-Dist: beautifulsoup4>=4.12.0; extra == "all-rag"
Requires-Dist: rank-bm25>=0.2.2; extra == "all-rag"
Requires-Dist: numpy>=1.24.0; extra == "all-rag"
Requires-Dist: tiktoken>=0.5.0; extra == "all-rag"
Requires-Dist: chromadb>=0.4.0; extra == "all-rag"
Requires-Dist: sqlalchemy>=2.0.0; extra == "all-rag"
Requires-Dist: sqlglot>=20.0.0; extra == "all-rag"
Requires-Dist: pandas>=2.0.0; extra == "all-rag"
Requires-Dist: openpyxl>=3.1.0; extra == "all-rag"
Requires-Dist: pyarrow>=14.0.0; extra == "all-rag"
Requires-Dist: sentence-transformers>=2.2.0; extra == "all-rag"
Provides-Extra: all
Requires-Dist: maticlib[dev]; extra == "all"
Requires-Dist: maticlib[docs]; extra == "all"
Requires-Dist: maticlib[all-rag]; extra == "all"
Dynamic: license-file

<p align="center">
  <img src="https://raw.githubusercontent.com/arvohsoft/maticlib/main/docs/assets/logo.svg" alt="Maticlib Logo" width="220">
</p>

**A high-performance Python Automation Library for Creating Agents.**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://static.pepy.tech/badge/maticlib)](https://pepy.tech/project/maticlib)
[![PyPI version](https://badge.fury.io/py/maticlib.svg)](https://badge.fury.io/py/maticlib)

Maticlib is a developer-centric library designed to build complex, stateful AI workflows with ease. Whether you need a simple chat completion or a multi-node parallel execution graph, Maticlib provides the primitives to build it with a focus on type safety and performance.

---

## Documentation

For complete documentation, visit: **[https://arvohsoft.github.io/maticlib/](https://arvohsoft.github.io/maticlib/)**

- [Getting Started](https://arvohsoft.github.io/maticlib/getting_started/)
- [API Reference](https://arvohsoft.github.io/maticlib/api/index.html)
- [Example Gallery](https://arvohsoft.github.io/maticlib/examples/)

---

### Installation

#### From PyPI
```bash
pip install maticlib
```

#### From Source (Local Development)
```bash
# Clone the repository
git clone https://github.com/arvohsoft/maticlib.git
cd maticlib

# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install in editable mode with dev dependencies
pip install -e ".[dev]"
```

---

## Quick Start

```python
from maticlib.llm.openai import OpenAIClient

# Initialize client (uses OPENAI_API_KEY from environment)
client = OpenAIClient()

# Make a request
response = client.complete("Explain quantum computing in one sentence.")
print(client.get_text_response(response))
```

#### Quick Start: Embeddings

```python
from maticlib import OpenAIEmbeddings

# Initialize the client
embed_client = OpenAIEmbeddings()

# Embed single query
res = embed_client.embed_query("Core features of Maticlib")
print(res.vector[:5])      # List[float]
print(res.prompt_tokens)   # Total prompt tokens used
```

#### Quick Start: Context Engineering (RAG)

```python
from maticlib.io.file import TextLoader
from maticlib.core.text.chunkers import HierarchicalChunker

chunker = HierarchicalChunker(target_size=500)
loader = TextLoader(chunker=chunker)

segments = list(loader.load("data.txt"))
print(f"Loaded {len(segments)} segments!")
```

#### Quick Start: Text2SQL

```python
from maticlib.core.text2sql.guards import SQLInjectionGuard
from maticlib.core.text2sql.executors import SQLAlchemyExecutor

guard = SQLInjectionGuard(allowed_dialect="sqlite")
executor = SQLAlchemyExecutor("sqlite:///my_db.db", read_only=True)

query = guard.validate_and_format("SELECT * FROM users LIMIT 10")
cols, rows = executor.execute(query)
```

---

## Project Leadership

**Maticlib** is developed and maintained by **Arvoh Software**.

- **Lead Maintainer**: [Anubroto Ghose](https://github.com/anubrotoGhose)
- **Organization**: [Arvoh Software](https://arvohsoft.github.io/arvohsoft/)
- **Contact**: [arvohsoft@gmail.com](mailto:arvohsoft@gmail.com)

---

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/arvohsoft/maticlib/blob/main/LICENSE) file for details.
