GramDB


NameGramDB JSON
Version 2.2.0 PyPI version JSON
download
home_pagehttps://github.com/ishikki-akabane/GramDB
SummaryUnlimited Capacity Database For Programming Using Telegram as Database.
upload_time2024-09-26 03:52:11
maintainerNone
docs_urlNone
authorishikki-Akabane
requires_pythonNone
licenseGNU General Public License v3.0
keywords telegram db database free storage code
VCS
bugtrack_url
requirements asyncio aiohttp requests
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GramDB: Infinite Database Storage via Telegram
=====================================================

## Introduction
GramDB is a unique library that leverages Telegram as a database, offering infinite storage capabilities. It provides a robust and efficient way to manage data, making it an ideal solution for applications requiring flexible and scalable data storage.

## Features
- **Infinite Storage**: Utilize Telegram's messaging capabilities to store data without traditional storage limitations.
- **Real-time Data Access**: Fetch, insert, update, and delete data in real-time.
- **Asynchronous Operations**: Support for asynchronous operations to ensure non-blocking and efficient data management.
- **Schema Management**: Define and manage schemas for tables to ensure data consistency.
- **Background Tasks**: Handle background tasks for creating, updating, and deleting data seamlessly.

## Installation
To use GramDB, you need to install the library and its dependencies. You can do this via pip:

```bash
pip install gramdb
```

## Getting Started
1. **Authentication**: Authenticate with your Telegram database URL.
2. **Initialize**: Initialize the GramDB instance with the authenticated URL and an asynchronous manager.
3. **Data Operations**: Perform CRUD (Create, Read, Update, Delete) operations on your data.

## Example Usage
### Authentication and Initialization
```python
from gramdb import GramDB, AsyncManager 

# Replace with your actual database URL
db_url = "https://your-telegram-db-url.com"

# Initialize the asynchronous manager
async_manager = AsyncManager()

# Initialize GramDB
gramdb = GramDB(db_url, async_manager)
```
### Creating a Table
```python
# Define the schema for the new table
schema = ["name", "age", "email"]
    
# Create the table
await gramdb.create_one("users", schema)
```
### Inserting Data
```python
# Define the record to insert
record = {
    "name": "John Doe",
    "age": 30,
    "email": "john.doe@example.com"
}
    
# Insert the record
await gramdb.insert_one("users", record)
```
### Fetching Data
```python
# Define the query criteria
query = {
    "name": "John Doe"
}
    
# Fetch the data
result = await gramdb.find_one("users", query)
print(result)
```
### Updating Data
```python
# Define the query criteria and update fields
query = {
    "name": "John Doe"
}
update_fields = {
    "$set": {
        "age": 31
    }
}
    
# Update the data
await gramdb.update_one("users", query, update_fields)
```
### Deleting Data
```python
# Define the query criteria
query = {
    "name": "John Doe"
}
    
# Delete the data
await gramdb.delete_one("users", query)
```

## Methods
### Authentication and Initialization
- `__init__(db_url, async_manager)`: Initialize the GramDB instance with the provided database URL and asynchronous manager.
- `authenticate()`: Authenticate with the provided database URL.
### Data Operations
- `create_one(table_name, schema)`: Create a new table with the given schema.
- `insert_one(table_name, record)`: Insert a new record into the specified table.
- `find(table_name, query)`: Fetch records from the specified table based on the given query.
- `find_one(table_name, query)`: Fetch one record from the specified table based on the given query.
- `fetch_all()`: Fetch all records from all tables.
- `update_one(table_name, query, update_query)`: Update records in the specified table based on the given query and update criteria.
- `delete_one(table_name, query)`: Delete records from the specified table based on the given query.
### Background Tasks
- `background_create(table_name, _m_id)`: Create a new table in the background.
- `background_insert(table_name, _m_id)`: Insert a new record in the background.
- `background_update(table_name, query, _m_id)`: Update records in the background.
- `background_delete(table_name, _m_id)`: Delete a record in the background.
- `background_delete_table(table_name)`: Delete a table in the background.
### Utility Methods
- `wait_for_background_tasks()`: Wait for all background tasks to complete.
- `close()`: Run async background tasks and close the async manager.

## API Documentation
For detailed API documentation, please refer to the API Documentation.
## Contributing
Contributions are welcome If you find any issues or have suggestions, please open an issue or submit a pull request.
## License
GramDB is licensed under the GPU License.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ishikki-akabane/GramDB",
    "name": "GramDB",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "telegram, db, database, free, storage, code",
    "author": "ishikki-Akabane",
    "author_email": "ishikkiakabane@outlook.com",
    "download_url": "https://files.pythonhosted.org/packages/28/90/c046ef5231f33aafb66db6a9c6df326073766ee794486eee95607e3cbebb/gramdb-2.2.0.tar.gz",
    "platform": null,
    "description": "# GramDB: Infinite Database Storage via Telegram\n=====================================================\n\n## Introduction\nGramDB is a unique library that leverages Telegram as a database, offering infinite storage capabilities. It provides a robust and efficient way to manage data, making it an ideal solution for applications requiring flexible and scalable data storage.\n\n## Features\n- **Infinite Storage**: Utilize Telegram's messaging capabilities to store data without traditional storage limitations.\n- **Real-time Data Access**: Fetch, insert, update, and delete data in real-time.\n- **Asynchronous Operations**: Support for asynchronous operations to ensure non-blocking and efficient data management.\n- **Schema Management**: Define and manage schemas for tables to ensure data consistency.\n- **Background Tasks**: Handle background tasks for creating, updating, and deleting data seamlessly.\n\n## Installation\nTo use GramDB, you need to install the library and its dependencies. You can do this via pip:\n\n```bash\npip install gramdb\n```\n\n## Getting Started\n1. **Authentication**: Authenticate with your Telegram database URL.\n2. **Initialize**: Initialize the GramDB instance with the authenticated URL and an asynchronous manager.\n3. **Data Operations**: Perform CRUD (Create, Read, Update, Delete) operations on your data.\n\n## Example Usage\n### Authentication and Initialization\n```python\nfrom gramdb import GramDB, AsyncManager \n\n# Replace with your actual database URL\ndb_url = \"https://your-telegram-db-url.com\"\n\n# Initialize the asynchronous manager\nasync_manager = AsyncManager()\n\n# Initialize GramDB\ngramdb = GramDB(db_url, async_manager)\n```\n### Creating a Table\n```python\n# Define the schema for the new table\nschema = [\"name\", \"age\", \"email\"]\n    \n# Create the table\nawait gramdb.create_one(\"users\", schema)\n```\n### Inserting Data\n```python\n# Define the record to insert\nrecord = {\n    \"name\": \"John Doe\",\n    \"age\": 30,\n    \"email\": \"john.doe@example.com\"\n}\n    \n# Insert the record\nawait gramdb.insert_one(\"users\", record)\n```\n### Fetching Data\n```python\n# Define the query criteria\nquery = {\n    \"name\": \"John Doe\"\n}\n    \n# Fetch the data\nresult = await gramdb.find_one(\"users\", query)\nprint(result)\n```\n### Updating Data\n```python\n# Define the query criteria and update fields\nquery = {\n    \"name\": \"John Doe\"\n}\nupdate_fields = {\n    \"$set\": {\n        \"age\": 31\n    }\n}\n    \n# Update the data\nawait gramdb.update_one(\"users\", query, update_fields)\n```\n### Deleting Data\n```python\n# Define the query criteria\nquery = {\n    \"name\": \"John Doe\"\n}\n    \n# Delete the data\nawait gramdb.delete_one(\"users\", query)\n```\n\n## Methods\n### Authentication and Initialization\n- `__init__(db_url, async_manager)`: Initialize the GramDB instance with the provided database URL and asynchronous manager.\n- `authenticate()`: Authenticate with the provided database URL.\n### Data Operations\n- `create_one(table_name, schema)`: Create a new table with the given schema.\n- `insert_one(table_name, record)`: Insert a new record into the specified table.\n- `find(table_name, query)`: Fetch records from the specified table based on the given query.\n- `find_one(table_name, query)`: Fetch one record from the specified table based on the given query.\n- `fetch_all()`: Fetch all records from all tables.\n- `update_one(table_name, query, update_query)`: Update records in the specified table based on the given query and update criteria.\n- `delete_one(table_name, query)`: Delete records from the specified table based on the given query.\n### Background Tasks\n- `background_create(table_name, _m_id)`: Create a new table in the background.\n- `background_insert(table_name, _m_id)`: Insert a new record in the background.\n- `background_update(table_name, query, _m_id)`: Update records in the background.\n- `background_delete(table_name, _m_id)`: Delete a record in the background.\n- `background_delete_table(table_name)`: Delete a table in the background.\n### Utility Methods\n- `wait_for_background_tasks()`: Wait for all background tasks to complete.\n- `close()`: Run async background tasks and close the async manager.\n\n## API Documentation\nFor detailed API documentation, please refer to the API Documentation.\n## Contributing\nContributions are welcome If you find any issues or have suggestions, please open an issue or submit a pull request.\n## License\nGramDB is licensed under the GPU License.\n\n\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3.0",
    "summary": "Unlimited Capacity Database For Programming Using Telegram as Database.",
    "version": "2.2.0",
    "project_urls": {
        "Download": "https://github.com/ishikki-akabane/GramDB/releases/latest",
        "Homepage": "https://github.com/ishikki-akabane/GramDB"
    },
    "split_keywords": [
        "telegram",
        " db",
        " database",
        " free",
        " storage",
        " code"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6cec6f285c2de04a30519fc1fdae56c32e14ba391803047de7c9d201f3797ee6",
                "md5": "cf06acffdf4ec3cf97334a2d82c0879e",
                "sha256": "e2bcdc021af0a4d7b38f5cfc292f2a65a18639c47b56f557f1f4b8db8d300611"
            },
            "downloads": -1,
            "filename": "GramDB-2.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf06acffdf4ec3cf97334a2d82c0879e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 24249,
            "upload_time": "2024-09-26T03:52:09",
            "upload_time_iso_8601": "2024-09-26T03:52:09.923280Z",
            "url": "https://files.pythonhosted.org/packages/6c/ec/6f285c2de04a30519fc1fdae56c32e14ba391803047de7c9d201f3797ee6/GramDB-2.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2890c046ef5231f33aafb66db6a9c6df326073766ee794486eee95607e3cbebb",
                "md5": "d8fd162ab4afad5ee28f7609409ae3c6",
                "sha256": "40f0b40ed2cefa0c6d30b62657639ed432062d2cb3f2fb57a02c55df1726a7e5"
            },
            "downloads": -1,
            "filename": "gramdb-2.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d8fd162ab4afad5ee28f7609409ae3c6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24531,
            "upload_time": "2024-09-26T03:52:11",
            "upload_time_iso_8601": "2024-09-26T03:52:11.154768Z",
            "url": "https://files.pythonhosted.org/packages/28/90/c046ef5231f33aafb66db6a9c6df326073766ee794486eee95607e3cbebb/gramdb-2.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-26 03:52:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ishikki-akabane",
    "github_project": "GramDB",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "asyncio",
            "specs": []
        },
        {
            "name": "aiohttp",
            "specs": []
        },
        {
            "name": "requests",
            "specs": []
        }
    ],
    "lcname": "gramdb"
}
        
Elapsed time: 0.45695s