agentparse


Nameagentparse JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/The-Swarm-Corporation/AgentParse
SummaryAgent Parse - TGSC
upload_time2024-10-15 20:57:57
maintainerNone
docs_urlNone
authorKye Gomez
requires_python<4.0,>=3.10
licenseMIT
keywords artificial intelligence deep learning optimizers prompt engineering
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# AgentParse


[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)



**AgentParse** is a high-performance parsing library designed to map various structured data formats (such as Pydantic models, JSON, YAML, and CSV) into agent-understandable blocks. By leveraging **AgentParse**, engineers can ensure seamless data ingestion for LLM agents, enabling fast and accurate processing of real-world data.

With a focus on enterprise-grade scalability and flexibility, **AgentParse** provides the tools necessary to build robust systems that support a wide array of business applications. From financial reports to IoT sensor data, **AgentParse** can handle it all with ease.

## Why AgentParse?

In an era where multi-agent systems are increasingly driving enterprise operations, parsing diverse and complex data formats quickly and accurately is critical. Traditional parsing methods can be rigid, error-prone, and often incompatible with large-scale LLM agents.

**AgentParse** is built with agent engineers and enterprise users in mind, providing a solution that:
- **Adapts** to various input formats with minimal configuration
- **Transforms** structured data into formats optimized for LLM agents
- **Scales** across thousands of agents and high-throughput applications
- **Ensures** compliance and data integrity across pipelines

Whether you're building swarms of agents for financial modeling, customer support automation, or real-time decision-making systems, **AgentParse** helps ensure your agents always have access to clean, reliable, and well-structured data.

## Key Features

### πŸ”„ Multi-Format Parsing

**AgentParse** supports multiple data formats out of the box, allowing agent systems to ingest data from various sources:

- **JSON**: A widely-used format for APIs and web applications.
- **YAML**: A human-readable data format often used in configuration files.
- **CSV**: Structured tabular data, common in financial and operational datasets.
- **Pydantic Models**: Direct parsing of Python's Pydantic models, ensuring type validation and data structure conformity.

### πŸš€ Seamless Agent Integration

Easily transform incoming data into **agent-ready blocks**. Agents can immediately interpret and act on parsed data without needing additional transformations or manual configuration.

### πŸ“Š Enterprise-Grade Scalability

Built with high-performance enterprises in mind, **AgentParse** is capable of handling:
- **High-throughput environments** where data ingestion and parsing must occur in real time.
- **Distributed architectures**, where agents deployed across multiple servers can leverage the same data parsing pipeline.

### πŸ›‘οΈ Data Validation & Error Handling

**AgentParse** provides built-in mechanisms for **data validation** and **error handling**, ensuring that your data is consistent and error-free before it reaches your agents. For example, it automatically validates data against Pydantic models and ensures that no invalid data is passed to agents.

### πŸ› οΈ Customizable Pipelines

Integrate **AgentParse** into your existing pipelines, customize transformations, and add post-processing steps. Easily adapt the library to fit the specific requirements of your use case.

---

## Installation

To install **AgentParse**, simply run:

```bash
pip install -U agentparse
```

Make sure you are using Python 3.7 or above.

---

## Getting Started

### 1. Parse a JSON Object

Here’s how to parse a simple JSON object into an agent-understandable block:

```python
from agentparse import AgentParser

data = """
{
    "name": "John Doe",
    "age": 30,
    "role": "Engineer"
}
"""

parser = AgentParser()
agent_block = parser.parse_json(data)
print(agent_block)
```

Output:

```
AgentBlock(data={'name': 'John Doe', 'age': 30, 'role': 'Engineer'})
```

### 2. Parse a YAML Configuration

```python
from agentparse import AgentParser

yaml_data = """
name: John Doe
age: 30
role: Engineer
"""

parser = AgentParser()
agent_block = parser.parse_yaml(yaml_data)
print(agent_block)
```

Output:

```
AgentBlock(data={'name': 'John Doe', 'age': 30, 'role': 'Engineer'})
```

### 3. Parse a CSV File

```python
from agentparse import AgentParser

csv_data = """
name,age,role
John Doe,30,Engineer
Jane Doe,25,Analyst
"""

parser = AgentParser()
agent_block = parser.parse_csv(csv_data)
print(agent_block)
```

Output:

```
AgentBlock(data=[{'name': 'John Doe', 'age': 30, 'role': 'Engineer'}, {'name': 'Jane Doe', 'age': 25, 'role': 'Analyst'}])
```

### 4. Parse a Pydantic Model

AgentParse allows you to parse Pydantic models directly into agent-understandable blocks:

```python
from pydantic import BaseModel
from agentparse import AgentParser

class User(BaseModel):
    name: str
    age: int
    role: str

user = User(name="John Doe", age=30, role="Engineer")

parser = AgentParser()
agent_block = parser.parse_pydantic(user)
print(agent_block)
```

Output:

```
AgentBlock(data={'name': 'John Doe', 'age': 30, 'role': 'Engineer'})
```

---

## Advanced Usage

### Custom Data Processing

If your agent requires custom data transformations, **AgentParse** allows you to extend its capabilities by adding custom processing steps.

```python
from agentparse import AgentParser, AgentBlock

def custom_transform(data):
    # Custom logic to modify the parsed data
    data['role'] = data['role'].upper()
    return AgentBlock(data)

parser = AgentParser()
parser.add_custom_step(custom_transform)

# Parsing a JSON object
data = '{"name": "John Doe", "age": 30, "role": "Engineer"}'
agent_block = parser.parse_json(data)
print(agent_block)
```

This flexibility allows enterprise engineers to tailor the parsing process to their specific needs.

### Batch Processing for High-Throughput Systems

**AgentParse** supports batch processing, enabling efficient parsing of large datasets across distributed systems:

```python
from agentparse import AgentParser

data_batch = [
    '{"name": "John Doe", "age": 30, "role": "Engineer"}',
    '{"name": "Jane Doe", "age": 25, "role": "Analyst"}'
]

parser = AgentParser()
agent_blocks = parser.batch_parse_json(data_batch)
print(agent_blocks)
```

This is ideal for applications where real-time agent systems need to process thousands or millions of data entries simultaneously.

---

## Integration with Multi-Agent Systems

**AgentParse** integrates seamlessly with agent orchestration frameworks such as [Swarms](https://github.com/kyegomez/swarms), enabling multi-agent systems to process parsed data collaboratively. The parsed agent blocks can be distributed across multiple agents to handle complex workflows, such as financial analysis, marketing automation, or IoT data processing.

### Example: Using with Swarms Framework

```python
from agentparse import AgentParser
from swarms import Swarm

# Initialize parser and swarm
parser = AgentParser()
swarm = Swarm()

# Parse a CSV file and distribute data to agents
csv_data = "name,age,role\nJohn Doe,30,Engineer\nJane Doe,25,Analyst"
agent_block = parser.parse_csv(csv_data)
swarm.distribute(agent_block.data)
```

This example shows how easily **AgentParse** can be combined with multi-agent frameworks to create scalable, real-time systems that understand and act on data from multiple formats.

---

## Enterprise Use-Cases

### 1. **Financial Data Parsing**

Agents can use **AgentParse** to ingest CSV reports from accounting systems and transform them into actionable insights. For example, CSV data containing revenue projections can be parsed and passed to forecasting agents, enabling more accurate financial predictions.

### 2. **Customer Support Automation**

Integrate **AgentParse** with customer support LLM agents to process JSON or YAML configurations from CRM systems. Parsed data can be used to dynamically generate customer responses or action workflows.

### 3. **IoT Data Processing**

**AgentParse** can help process large volumes of sensor data from industrial IoT devices, transforming CSV or JSON telemetry data into blocks that agents can analyze for predictive maintenance or operational efficiency improvements.

---

## Roadmap

### Upcoming Features:
- **Streaming Data Parsing**: Real-time parsing from streaming sources like Kafka or WebSockets.
- **Enhanced Data Validation**: More extensive validation mechanisms for large-scale enterprise applications.
- **New Formats**: Support for additional data formats like Avro, Parquet, and XML.

---

## Contributing

We welcome contributions to improve **AgentParse**! To contribute:
1. Fork the repository.
2. Create a new branch (`git checkout -b feature/your-feature-name`).
3. Make your changes and add tests.
4. Commit your changes (`git commit -m "Add new feature"`)
5. Push your branch (`git push origin feature/your-feature-name`)
6. Create a pull request on GitHub.

For detailed contribution guidelines, please refer to [CONTRIBUTING.md](./CONTRIBUTING.md).

---

## License

**AgentParse** is licensed under the [MIT License](./LICENSE).
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/The-Swarm-Corporation/AgentParse",
    "name": "agentparse",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "artificial intelligence, deep learning, optimizers, Prompt Engineering",
    "author": "Kye Gomez",
    "author_email": "kye@apac.ai",
    "download_url": "https://files.pythonhosted.org/packages/35/25/9c40357cab39f989bbfeaabdf06798396e99192f40c8b0c39969b4e2c0a4/agentparse-0.0.3.tar.gz",
    "platform": null,
    "description": "\n# AgentParse\n\n\n[![Join our Discord](https://img.shields.io/badge/Discord-Join%20our%20server-5865F2?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/agora-999382051935506503) [![Subscribe on YouTube](https://img.shields.io/badge/YouTube-Subscribe-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@kyegomez3242) [![Connect on LinkedIn](https://img.shields.io/badge/LinkedIn-Connect-blue?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/kye-g-38759a207/) [![Follow on X.com](https://img.shields.io/badge/X.com-Follow-1DA1F2?style=for-the-badge&logo=x&logoColor=white)](https://x.com/kyegomezb)\n\n\n\n**AgentParse** is a high-performance parsing library designed to map various structured data formats (such as Pydantic models, JSON, YAML, and CSV) into agent-understandable blocks. By leveraging **AgentParse**, engineers can ensure seamless data ingestion for LLM agents, enabling fast and accurate processing of real-world data.\n\nWith a focus on enterprise-grade scalability and flexibility, **AgentParse** provides the tools necessary to build robust systems that support a wide array of business applications. From financial reports to IoT sensor data, **AgentParse** can handle it all with ease.\n\n## Why AgentParse?\n\nIn an era where multi-agent systems are increasingly driving enterprise operations, parsing diverse and complex data formats quickly and accurately is critical. Traditional parsing methods can be rigid, error-prone, and often incompatible with large-scale LLM agents.\n\n**AgentParse** is built with agent engineers and enterprise users in mind, providing a solution that:\n- **Adapts** to various input formats with minimal configuration\n- **Transforms** structured data into formats optimized for LLM agents\n- **Scales** across thousands of agents and high-throughput applications\n- **Ensures** compliance and data integrity across pipelines\n\nWhether you're building swarms of agents for financial modeling, customer support automation, or real-time decision-making systems, **AgentParse** helps ensure your agents always have access to clean, reliable, and well-structured data.\n\n## Key Features\n\n### \ud83d\udd04 Multi-Format Parsing\n\n**AgentParse** supports multiple data formats out of the box, allowing agent systems to ingest data from various sources:\n\n- **JSON**: A widely-used format for APIs and web applications.\n- **YAML**: A human-readable data format often used in configuration files.\n- **CSV**: Structured tabular data, common in financial and operational datasets.\n- **Pydantic Models**: Direct parsing of Python's Pydantic models, ensuring type validation and data structure conformity.\n\n### \ud83d\ude80 Seamless Agent Integration\n\nEasily transform incoming data into **agent-ready blocks**. Agents can immediately interpret and act on parsed data without needing additional transformations or manual configuration.\n\n### \ud83d\udcca Enterprise-Grade Scalability\n\nBuilt with high-performance enterprises in mind, **AgentParse** is capable of handling:\n- **High-throughput environments** where data ingestion and parsing must occur in real time.\n- **Distributed architectures**, where agents deployed across multiple servers can leverage the same data parsing pipeline.\n\n### \ud83d\udee1\ufe0f Data Validation & Error Handling\n\n**AgentParse** provides built-in mechanisms for **data validation** and **error handling**, ensuring that your data is consistent and error-free before it reaches your agents. For example, it automatically validates data against Pydantic models and ensures that no invalid data is passed to agents.\n\n### \ud83d\udee0\ufe0f Customizable Pipelines\n\nIntegrate **AgentParse** into your existing pipelines, customize transformations, and add post-processing steps. Easily adapt the library to fit the specific requirements of your use case.\n\n---\n\n## Installation\n\nTo install **AgentParse**, simply run:\n\n```bash\npip install -U agentparse\n```\n\nMake sure you are using Python 3.7 or above.\n\n---\n\n## Getting Started\n\n### 1. Parse a JSON Object\n\nHere\u2019s how to parse a simple JSON object into an agent-understandable block:\n\n```python\nfrom agentparse import AgentParser\n\ndata = \"\"\"\n{\n    \"name\": \"John Doe\",\n    \"age\": 30,\n    \"role\": \"Engineer\"\n}\n\"\"\"\n\nparser = AgentParser()\nagent_block = parser.parse_json(data)\nprint(agent_block)\n```\n\nOutput:\n\n```\nAgentBlock(data={'name': 'John Doe', 'age': 30, 'role': 'Engineer'})\n```\n\n### 2. Parse a YAML Configuration\n\n```python\nfrom agentparse import AgentParser\n\nyaml_data = \"\"\"\nname: John Doe\nage: 30\nrole: Engineer\n\"\"\"\n\nparser = AgentParser()\nagent_block = parser.parse_yaml(yaml_data)\nprint(agent_block)\n```\n\nOutput:\n\n```\nAgentBlock(data={'name': 'John Doe', 'age': 30, 'role': 'Engineer'})\n```\n\n### 3. Parse a CSV File\n\n```python\nfrom agentparse import AgentParser\n\ncsv_data = \"\"\"\nname,age,role\nJohn Doe,30,Engineer\nJane Doe,25,Analyst\n\"\"\"\n\nparser = AgentParser()\nagent_block = parser.parse_csv(csv_data)\nprint(agent_block)\n```\n\nOutput:\n\n```\nAgentBlock(data=[{'name': 'John Doe', 'age': 30, 'role': 'Engineer'}, {'name': 'Jane Doe', 'age': 25, 'role': 'Analyst'}])\n```\n\n### 4. Parse a Pydantic Model\n\nAgentParse allows you to parse Pydantic models directly into agent-understandable blocks:\n\n```python\nfrom pydantic import BaseModel\nfrom agentparse import AgentParser\n\nclass User(BaseModel):\n    name: str\n    age: int\n    role: str\n\nuser = User(name=\"John Doe\", age=30, role=\"Engineer\")\n\nparser = AgentParser()\nagent_block = parser.parse_pydantic(user)\nprint(agent_block)\n```\n\nOutput:\n\n```\nAgentBlock(data={'name': 'John Doe', 'age': 30, 'role': 'Engineer'})\n```\n\n---\n\n## Advanced Usage\n\n### Custom Data Processing\n\nIf your agent requires custom data transformations, **AgentParse** allows you to extend its capabilities by adding custom processing steps.\n\n```python\nfrom agentparse import AgentParser, AgentBlock\n\ndef custom_transform(data):\n    # Custom logic to modify the parsed data\n    data['role'] = data['role'].upper()\n    return AgentBlock(data)\n\nparser = AgentParser()\nparser.add_custom_step(custom_transform)\n\n# Parsing a JSON object\ndata = '{\"name\": \"John Doe\", \"age\": 30, \"role\": \"Engineer\"}'\nagent_block = parser.parse_json(data)\nprint(agent_block)\n```\n\nThis flexibility allows enterprise engineers to tailor the parsing process to their specific needs.\n\n### Batch Processing for High-Throughput Systems\n\n**AgentParse** supports batch processing, enabling efficient parsing of large datasets across distributed systems:\n\n```python\nfrom agentparse import AgentParser\n\ndata_batch = [\n    '{\"name\": \"John Doe\", \"age\": 30, \"role\": \"Engineer\"}',\n    '{\"name\": \"Jane Doe\", \"age\": 25, \"role\": \"Analyst\"}'\n]\n\nparser = AgentParser()\nagent_blocks = parser.batch_parse_json(data_batch)\nprint(agent_blocks)\n```\n\nThis is ideal for applications where real-time agent systems need to process thousands or millions of data entries simultaneously.\n\n---\n\n## Integration with Multi-Agent Systems\n\n**AgentParse** integrates seamlessly with agent orchestration frameworks such as [Swarms](https://github.com/kyegomez/swarms), enabling multi-agent systems to process parsed data collaboratively. The parsed agent blocks can be distributed across multiple agents to handle complex workflows, such as financial analysis, marketing automation, or IoT data processing.\n\n### Example: Using with Swarms Framework\n\n```python\nfrom agentparse import AgentParser\nfrom swarms import Swarm\n\n# Initialize parser and swarm\nparser = AgentParser()\nswarm = Swarm()\n\n# Parse a CSV file and distribute data to agents\ncsv_data = \"name,age,role\\nJohn Doe,30,Engineer\\nJane Doe,25,Analyst\"\nagent_block = parser.parse_csv(csv_data)\nswarm.distribute(agent_block.data)\n```\n\nThis example shows how easily **AgentParse** can be combined with multi-agent frameworks to create scalable, real-time systems that understand and act on data from multiple formats.\n\n---\n\n## Enterprise Use-Cases\n\n### 1. **Financial Data Parsing**\n\nAgents can use **AgentParse** to ingest CSV reports from accounting systems and transform them into actionable insights. For example, CSV data containing revenue projections can be parsed and passed to forecasting agents, enabling more accurate financial predictions.\n\n### 2. **Customer Support Automation**\n\nIntegrate **AgentParse** with customer support LLM agents to process JSON or YAML configurations from CRM systems. Parsed data can be used to dynamically generate customer responses or action workflows.\n\n### 3. **IoT Data Processing**\n\n**AgentParse** can help process large volumes of sensor data from industrial IoT devices, transforming CSV or JSON telemetry data into blocks that agents can analyze for predictive maintenance or operational efficiency improvements.\n\n---\n\n## Roadmap\n\n### Upcoming Features:\n- **Streaming Data Parsing**: Real-time parsing from streaming sources like Kafka or WebSockets.\n- **Enhanced Data Validation**: More extensive validation mechanisms for large-scale enterprise applications.\n- **New Formats**: Support for additional data formats like Avro, Parquet, and XML.\n\n---\n\n## Contributing\n\nWe welcome contributions to improve **AgentParse**! To contribute:\n1. Fork the repository.\n2. Create a new branch (`git checkout -b feature/your-feature-name`).\n3. Make your changes and add tests.\n4. Commit your changes (`git commit -m \"Add new feature\"`)\n5. Push your branch (`git push origin feature/your-feature-name`)\n6. Create a pull request on GitHub.\n\nFor detailed contribution guidelines, please refer to [CONTRIBUTING.md](./CONTRIBUTING.md).\n\n---\n\n## License\n\n**AgentParse** is licensed under the [MIT License](./LICENSE).",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Agent Parse - TGSC",
    "version": "0.0.3",
    "project_urls": {
        "Documentation": "https://github.com/The-Swarm-Corporation/AgentParse",
        "Homepage": "https://github.com/The-Swarm-Corporation/AgentParse",
        "Repository": "https://github.com/The-Swarm-Corporation/AgentParse"
    },
    "split_keywords": [
        "artificial intelligence",
        " deep learning",
        " optimizers",
        " prompt engineering"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "74168f5a9f8ae7a328e7d496bdfabfb7c5af6e0b1309f03dfe969ec705edcd5e",
                "md5": "672e1a66ef6343eaed36905c73c374c3",
                "sha256": "c483f39ccfbbb2d82cb7ebdf75a1d50dab4e2582bacc46557e105ae82213bdc9"
            },
            "downloads": -1,
            "filename": "agentparse-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "672e1a66ef6343eaed36905c73c374c3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 16879,
            "upload_time": "2024-10-15T20:57:55",
            "upload_time_iso_8601": "2024-10-15T20:57:55.555259Z",
            "url": "https://files.pythonhosted.org/packages/74/16/8f5a9f8ae7a328e7d496bdfabfb7c5af6e0b1309f03dfe969ec705edcd5e/agentparse-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "35259c40357cab39f989bbfeaabdf06798396e99192f40c8b0c39969b4e2c0a4",
                "md5": "be021c51188460475144efac86bf1943",
                "sha256": "a2268c19dce87ee42ac56d63c06c1e217381c935b4125f30be0317b3017429cb"
            },
            "downloads": -1,
            "filename": "agentparse-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "be021c51188460475144efac86bf1943",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 16681,
            "upload_time": "2024-10-15T20:57:57",
            "upload_time_iso_8601": "2024-10-15T20:57:57.130979Z",
            "url": "https://files.pythonhosted.org/packages/35/25/9c40357cab39f989bbfeaabdf06798396e99192f40c8b0c39969b4e2c0a4/agentparse-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-15 20:57:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "The-Swarm-Corporation",
    "github_project": "AgentParse",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "agentparse"
}
        
Elapsed time: 0.36789s