pitagentsai


Namepitagentsai JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/pitagentsai/pitagents
SummaryA professional and scalable Flask-based Agent Framework with blockchain-like token management.
upload_time2025-01-28 01:57:40
maintainerNone
docs_urlNone
authorPIT Agent
requires_python>=3.8
licenseMIT
keywords flask agent blockchain token management framework
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🚀 PIT Agent Framework

![PyPI Version](https://img.shields.io/pypi/v/pitagentsai)
![GitHub stars](https://img.shields.io/github/stars/pitagentsai/pitagents?style=social)
![Twitter Follow](https://img.shields.io/twitter/follow/pitagentai?style=social)

Welcome to the **PITAGENT Framework** — a powerful system for creating and managing **Programmable Intelligent Tokens (PITs)** on a blockchain! 🌐

This framework allows developers to build and manage programmable tokens that contain specific logic, allowing for flexible and customizable interactions within decentralized applications (dApps) and ecosystems. PIT tokens can be used in a variety of use cases, from finance to gaming, offering secure and intelligent token management.

## Features ✨
- **Agent Management**: Easily create and manage agents (users) with their associated tokens.
- **Programmable Tokens**: Tokens can carry conditions such as time-locks, amounts, or custom logic that must be met before they can be transferred or used.
- **Blockchain Integration**: Interaction with the blockchain (Solana, Ethereum, etc.) for secure and tamper-proof token storage and transactions.
- **Token Conditions**: Programmable logic that defines how tokens can be transferred or used.
- **RESTful API**: Comprehensive API to create agents, mint tokens, transfer tokens, and validate conditions.

## Technologies Used 🛠️
- **Flask**: Lightweight web framework for Python.
- **SQLAlchemy**: ORM (Object-Relational Mapper) for working with databases.
- **Solana** (or **Ethereum**): Blockchain for token management (Solana in this example).
- **Python 3.8+**: Programming language for backend logic.

## Quick Start 🚀

### Prerequisites 📋
- Python 3.8+ installed.
- Flask and other Python libraries.

### Installation 🛠️
1. Clone the repository:
   ```bash
   git clone https://github.com/yourusername/pitagents.git
   cd pitagents
   ```
   
2. Create a virtual environment:
   ```bash
   python3 -m venv venv
   source venv/bin/activate  # On Windows use `venv\Scripts\activate`
   ```

3. Install dependencies:
   ```bash
   pip install -r requirements.txt
   ```

4. Run the application:
   ```bash
   python app.py
   ```
   The Flask server will start at [http://127.0.0.1:5000/](http://127.0.0.1:5000/).

## Usage 📚

You can interact with the API using tools like **curl**, **Postman**, or any HTTP client of your choice. Below are examples of the API endpoints:

### API Endpoints 📡

#### 1. **Create an Agent**
- **Endpoint**: `/api/agents/create`
- **Method**: `POST`
- **Body**:
   ```json
   {
     "agent_id": "agent_1"
   }
   ```
- **Response**:
   ```json
   {
     "message": "Agent agent_1 created successfully."
   }
   ```

#### 2. **Mint a Token for an Agent**
- **Endpoint**: `/api/tokens/mint`
- **Method**: `POST`
- **Body**:
   ```json
   {
     "agent_id": "agent_1",
     "token_data": {
       "amount": 100,
       "purpose": "Utility token",
       "condition": "time_lock"
     }
   }
   ```
- **Response**:
   ```json
   {
     "message": "Token minted successfully",
     "token": {
       "token_id": "TKN_1627568937",
       "amount": 100,
       "purpose": "Utility token",
       "condition": "time_lock"
     }
   }
   ```

#### 3. **Transfer a Token**
- **Endpoint**: `/api/tokens/transfer`
- **Method**: `POST`
- **Body**:
   ```json
   {
     "from_agent_id": "agent_1",
     "to_agent_id": "agent_2",
     "amount": 50
   }
   ```
- **Response**:
   ```json
   {
     "message": "Token transferred successfully",
     "transfer": {
       "from": "agent_1",
       "to": "agent_2",
       "amount": 50
     }
   }
   ```

#### 4. **Validate Token Conditions**
- **Endpoint**: `/api/tokens/validate`
- **Method**: `POST`
- **Body**:
   ```json
   {
     "token_id": "TKN_1627568937"
   }
   ```
- **Response**:
   ```json
   {
     "is_valid": true
   }
   ```

## Project Structure 📂

```bash
PIT_Framework/
├── app.py               # Main Flask API to interact with the framework
├── pit_token_logic.py   # Logic for minting, transferring tokens and applying conditions
├── solana_service.py    # Interactions with the Solana blockchain
├── models.py            # SQLAlchemy models for Agents and PIT Tokens
├── requirements.txt     # List of project dependencies
└── README.md            # Project documentation (you're here)
```

## Contributing 🤝
We welcome contributions! Feel free to fork the project, make changes, and submit a pull request. Here's how you can contribute:
1. **Fork the repo**
2. **Create a new branch** for your feature or fix:  
   `git checkout -b feature/YourFeature`
3. **Commit your changes**:  
   `git commit -m 'Add new feature'`
4. **Push your branch**:  
   `git push origin feature/YourFeature`
5. **Create a Pull Request**: Open a PR on GitHub.

## License 📄
This project is licensed under the MIT License. See the `LICENSE` file for more details.

## Contact 📧
- Email: [pitagentsdev@gmail.com](mailto:pitagentsdev@gmail.com)
- Twitter: [@pitagentsai](https://twitter.com/pitagentsai)
- GitHub: [@pitagentsai](https://github.com/pitagentsai)

---

## Acknowledgements 🎉
- Inspired by the need for scalable and programmable token systems.
- Built with love using **Flask**, **Solana**, and **SQLAlchemy**.
- Special thanks to the blockchain community for their constant innovation.

---

Happy coding! ✨

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pitagentsai/pitagents",
    "name": "pitagentsai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "flask, agent, blockchain, token management, framework",
    "author": "PIT Agent",
    "author_email": "dev@pitagentai.com",
    "download_url": "https://files.pythonhosted.org/packages/3d/3c/6569a67cf5c6c2ff72196a8c132e8e23899c20d76278684b3a44760695e8/pitagentsai-1.1.0.tar.gz",
    "platform": null,
    "description": "# \ud83d\ude80 PIT Agent Framework\n\n![PyPI Version](https://img.shields.io/pypi/v/pitagentsai)\n![GitHub stars](https://img.shields.io/github/stars/pitagentsai/pitagents?style=social)\n![Twitter Follow](https://img.shields.io/twitter/follow/pitagentai?style=social)\n\nWelcome to the **PITAGENT Framework** \u2014 a powerful system for creating and managing **Programmable Intelligent Tokens (PITs)** on a blockchain! \ud83c\udf10\n\nThis framework allows developers to build and manage programmable tokens that contain specific logic, allowing for flexible and customizable interactions within decentralized applications (dApps) and ecosystems. PIT tokens can be used in a variety of use cases, from finance to gaming, offering secure and intelligent token management.\n\n## Features \u2728\n- **Agent Management**: Easily create and manage agents (users) with their associated tokens.\n- **Programmable Tokens**: Tokens can carry conditions such as time-locks, amounts, or custom logic that must be met before they can be transferred or used.\n- **Blockchain Integration**: Interaction with the blockchain (Solana, Ethereum, etc.) for secure and tamper-proof token storage and transactions.\n- **Token Conditions**: Programmable logic that defines how tokens can be transferred or used.\n- **RESTful API**: Comprehensive API to create agents, mint tokens, transfer tokens, and validate conditions.\n\n## Technologies Used \ud83d\udee0\ufe0f\n- **Flask**: Lightweight web framework for Python.\n- **SQLAlchemy**: ORM (Object-Relational Mapper) for working with databases.\n- **Solana** (or **Ethereum**): Blockchain for token management (Solana in this example).\n- **Python 3.8+**: Programming language for backend logic.\n\n## Quick Start \ud83d\ude80\n\n### Prerequisites \ud83d\udccb\n- Python 3.8+ installed.\n- Flask and other Python libraries.\n\n### Installation \ud83d\udee0\ufe0f\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/yourusername/pitagents.git\n   cd pitagents\n   ```\n   \n2. Create a virtual environment:\n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n   ```\n\n3. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Run the application:\n   ```bash\n   python app.py\n   ```\n   The Flask server will start at [http://127.0.0.1:5000/](http://127.0.0.1:5000/).\n\n## Usage \ud83d\udcda\n\nYou can interact with the API using tools like **curl**, **Postman**, or any HTTP client of your choice. Below are examples of the API endpoints:\n\n### API Endpoints \ud83d\udce1\n\n#### 1. **Create an Agent**\n- **Endpoint**: `/api/agents/create`\n- **Method**: `POST`\n- **Body**:\n   ```json\n   {\n     \"agent_id\": \"agent_1\"\n   }\n   ```\n- **Response**:\n   ```json\n   {\n     \"message\": \"Agent agent_1 created successfully.\"\n   }\n   ```\n\n#### 2. **Mint a Token for an Agent**\n- **Endpoint**: `/api/tokens/mint`\n- **Method**: `POST`\n- **Body**:\n   ```json\n   {\n     \"agent_id\": \"agent_1\",\n     \"token_data\": {\n       \"amount\": 100,\n       \"purpose\": \"Utility token\",\n       \"condition\": \"time_lock\"\n     }\n   }\n   ```\n- **Response**:\n   ```json\n   {\n     \"message\": \"Token minted successfully\",\n     \"token\": {\n       \"token_id\": \"TKN_1627568937\",\n       \"amount\": 100,\n       \"purpose\": \"Utility token\",\n       \"condition\": \"time_lock\"\n     }\n   }\n   ```\n\n#### 3. **Transfer a Token**\n- **Endpoint**: `/api/tokens/transfer`\n- **Method**: `POST`\n- **Body**:\n   ```json\n   {\n     \"from_agent_id\": \"agent_1\",\n     \"to_agent_id\": \"agent_2\",\n     \"amount\": 50\n   }\n   ```\n- **Response**:\n   ```json\n   {\n     \"message\": \"Token transferred successfully\",\n     \"transfer\": {\n       \"from\": \"agent_1\",\n       \"to\": \"agent_2\",\n       \"amount\": 50\n     }\n   }\n   ```\n\n#### 4. **Validate Token Conditions**\n- **Endpoint**: `/api/tokens/validate`\n- **Method**: `POST`\n- **Body**:\n   ```json\n   {\n     \"token_id\": \"TKN_1627568937\"\n   }\n   ```\n- **Response**:\n   ```json\n   {\n     \"is_valid\": true\n   }\n   ```\n\n## Project Structure \ud83d\udcc2\n\n```bash\nPIT_Framework/\n\u251c\u2500\u2500 app.py               # Main Flask API to interact with the framework\n\u251c\u2500\u2500 pit_token_logic.py   # Logic for minting, transferring tokens and applying conditions\n\u251c\u2500\u2500 solana_service.py    # Interactions with the Solana blockchain\n\u251c\u2500\u2500 models.py            # SQLAlchemy models for Agents and PIT Tokens\n\u251c\u2500\u2500 requirements.txt     # List of project dependencies\n\u2514\u2500\u2500 README.md            # Project documentation (you're here)\n```\n\n## Contributing \ud83e\udd1d\nWe welcome contributions! Feel free to fork the project, make changes, and submit a pull request. Here's how you can contribute:\n1. **Fork the repo**\n2. **Create a new branch** for your feature or fix:  \n   `git checkout -b feature/YourFeature`\n3. **Commit your changes**:  \n   `git commit -m 'Add new feature'`\n4. **Push your branch**:  \n   `git push origin feature/YourFeature`\n5. **Create a Pull Request**: Open a PR on GitHub.\n\n## License \ud83d\udcc4\nThis project is licensed under the MIT License. See the `LICENSE` file for more details.\n\n## Contact \ud83d\udce7\n- Email: [pitagentsdev@gmail.com](mailto:pitagentsdev@gmail.com)\n- Twitter: [@pitagentsai](https://twitter.com/pitagentsai)\n- GitHub: [@pitagentsai](https://github.com/pitagentsai)\n\n---\n\n## Acknowledgements \ud83c\udf89\n- Inspired by the need for scalable and programmable token systems.\n- Built with love using **Flask**, **Solana**, and **SQLAlchemy**.\n- Special thanks to the blockchain community for their constant innovation.\n\n---\n\nHappy coding! \u2728\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A professional and scalable Flask-based Agent Framework with blockchain-like token management.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/pitagentsai/pitagents"
    },
    "split_keywords": [
        "flask",
        " agent",
        " blockchain",
        " token management",
        " framework"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "86484bb7428d5d4b87c47a6b211535a55ae70cfaf5de077d104ff577025c2978",
                "md5": "82b460b25d476b5b7390ccce743a780b",
                "sha256": "1a8c068a80a9cec363c0b10f7debf89045d123dd41773730a8499188bef45169"
            },
            "downloads": -1,
            "filename": "pitagentsai-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "82b460b25d476b5b7390ccce743a780b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8692,
            "upload_time": "2025-01-28T01:57:38",
            "upload_time_iso_8601": "2025-01-28T01:57:38.936649Z",
            "url": "https://files.pythonhosted.org/packages/86/48/4bb7428d5d4b87c47a6b211535a55ae70cfaf5de077d104ff577025c2978/pitagentsai-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3d3c6569a67cf5c6c2ff72196a8c132e8e23899c20d76278684b3a44760695e8",
                "md5": "6bf759cc2cc0cb4c0079952e7bb181c4",
                "sha256": "990b682a3c6015bf3960b74a31a25d66d9a399176eade57d04088ceb46bdef61"
            },
            "downloads": -1,
            "filename": "pitagentsai-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "6bf759cc2cc0cb4c0079952e7bb181c4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6673,
            "upload_time": "2025-01-28T01:57:40",
            "upload_time_iso_8601": "2025-01-28T01:57:40.143164Z",
            "url": "https://files.pythonhosted.org/packages/3d/3c/6569a67cf5c6c2ff72196a8c132e8e23899c20d76278684b3a44760695e8/pitagentsai-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-28 01:57:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pitagentsai",
    "github_project": "pitagents",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "pitagentsai"
}
        
Elapsed time: 0.54549s