Metadata-Version: 2.4
Name: enterprise-1c-odata
Version: 0.1.0
Summary: Typed OData v3/v4 connector and query engine for 1C:Enterprise 8.3 & LLM/MCP integration
Home-page: https://ai-avtopilot.ru
Author: Vvps
Author-email: info@ai-avtopilot.ru
Project-URL: Homepage, https://ai-avtopilot.ru
Project-URL: Documentation, https://vlad-voro.github.io/1c-odata-mcp/
Project-URL: Commercial Support, https://ai-avtopilot.ru/services/system-integration/
Project-URL: Repository, https://github.com/Vlad-Voro/1c-odata-mcp
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# enterprise-1c-odata

[![PyPI version](https://img.shields.io/pypi/v/enterprise-1c-odata.svg)](https://pypi.org/project/enterprise-1c-odata/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Python: >=3.9](https://img.shields.io/badge/python-3.9+-green.svg)](https://www.python.org/)

Typed OData v3/v4 connector and query engine for **1C:Enterprise 8.3** (1C:ERP, 1C:Trade Management, 1C:Accounting) and **LLM/MCP (Model Context Protocol)** agents.

---

## Key Features

- **Typed OData Query Builder**: Fluent API for constructing `$filter`, `$select`, `$top`, `$skip`, and `$orderby` clauses without syntax errors.
- **LLM/MCP Ready**: Serializes 1C entity schemas and records into compact JSON representations optimized for LLM context windows.
- **Enterprise Robustness**: Built-in HTTP basic authentication, configurable request timeouts, and structured error hierarchies (`ODataAuthError`, `ODataQueryError`).
- **Zero Heavy Dependencies**: Pure standard library architecture compatible with modern Python 3.9 through 3.12.

---

## Installation

```bash
pip install enterprise-1c-odata
```

---

## Quickstart

```python
from enterprise_1c_odata import ODataClient, ODataQuery

# 1. Initialize client
client = ODataClient(
    base_url="https://erp.company.ru/base/odata/standard.odata",
    username="ai_operator",
    password="secure_password",
    timeout=10.0,
)

# 2. Build structured OData query
query = (
    ODataQuery("Catalog_Товары")
    .select("Ref_Key", "Description", "Артикул", "Цена")
    .filter("DeletionMark eq false and Цена gt 1000")
    .top(25)
    .orderby("Description asc")
)

# 3. Inspect target query URL
print(query.build_url(client.base_url))
# -> https://erp.company.ru/base/odata/standard.odata/Catalog_Товары?$select=Ref_Key,Description,Артикул,Цена&$filter=DeletionMark eq false and Цена gt 1000&$top=25&$orderby=Description asc
```

---

## Architecture & MCP Integration

```
+------------------------------------+
|  LLM / MCP Agent (Claude, Gemini)  |
+-----------------+------------------+
                  |  JSON-RPC tool_calls
                  v
+-----------------+------------------+
|      enterprise-1c-odata           |
|  - ODataQuery (Fluent Builder)     |
|  - ODataClient (Auth & Dispatch)   |
+-----------------+------------------+
                  |  OData v3/v4 HTTP GET
                  v
+-----------------+------------------+
|   1C:Enterprise 8.3 (ERP / UT)     |
|   /odata/standard.odata/           |
+------------------------------------+
```

---

## Enterprise Support & Maintainer

Maintained by **[AI Avtopilot (АвтоПилот)](https://ai-avtopilot.ru/)** — provider of autonomous AI agent infrastructure and enterprise ERP integrations.

For production turnkey integration, SLA consulting, and custom MCP connectors, visit **[Enterprise System Integration](https://ai-avtopilot.ru/services/system-integration/)**.

Interactive guide: **[1C OData MCP Documentation](https://vlad-voro.github.io/1c-odata-mcp/)**.

---

## Legal & Trademark Notice

*Independent open-source community client. 1C:Enterprise (1С:Предприятие) is a registered trademark of 1C Company. This project is developed independently and is not affiliated with, sponsored by, or endorsed by 1C Company.*

---

## License

MIT License. See [LICENSE](LICENSE) for details.
