DataHive


NameDataHive JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/YahyaAzzam/SimpleFSDB
SummaryDataHive is a Python library and tool for managing and querying JSON-based file system databases (FSDB). It provides a simple and efficient way to work with structured data stored in JSON format on your -mlocal file system.
upload_time2023-10-31 07:01:25
maintainer
docs_urlNone
authorMahmoud Goda <mahmoden17@gmail.com>, Yahya Azzam <yahya912azzam@gmail.com>
requires_python>=3.5
licenseMIT
keywords db json datahive file system fsdb simplefsbd sfsdb
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Simple file system database (DataHive)

[![PyPI](https://img.shields.io/pypi/v/DataHive.svg)](https://pypi.python.org/pypi/DataHive)

[![Downloads](https://pepy.tech/badge/DataHive)](https://pepy.tech/project/DataHive)

[![PyPI](https://img.shields.io/pypi/l/DataHive.svg)](https://github.com/YahyaAzzam/SimpleFSDB/blob/master/LICENSE)



## Overview

DataHive is a meticulously crafted, lightweight database system tailored for the purpose of data storage in JSON files. With a strong emphasis on simplicity and reliability, it offers essential CRUD (Create, Read, Update, Delete) operations and guarantees seamless synchronization between read and write operations. This project has been thoughtfully designed to serve as an elegant and file-based data storage solution, ideally suited for small-scale applications.



## Table of Contents



1. [Features](#features)

2. [Installation](#installation)

3. [Usage](#usage)

    - [Schema formate](#schema)

    - [Command-Line Interface](#commands)

4. [Example Usage](#examples)

5. [FAQs](#faqs)

6. [Contributing](#contributing)

7. [License](#license)

8. [Upcoming Features](#upcoming-features)



## 1. Features <a name="features"></a>

- **Data Storage Excellence**

  - **Robust Storage**: Securely store data in JSON format.

  - **Flexibility**: JSON supports diverse data types and complex structures.

  - **Transparency**: Human-readable format simplifies debugging.

  - **Compatibility**: Platform-independent for use in various applications.



- **CRUD Functionality**

  - **Create (C)**: Add new data with specified identifiers.

  - **Read (R)**: Retrieve and query data for targeted searches.

  - **Update (U)**: Modify existing data, ensuring accuracy.

  - **Delete (D)**: Remove data to maintain a clean database.



- **Synchronization Assurance**

  - **ead-Write Consistency**: Guarantee synchronization between read and write operations for up-to-date data.

  - **Data Integrity**: Maintain reliable and trustworthy data, preventing inconsistencies.



- **Clearing Database**:

    - **clear the data**: Wipe the database clean, starting fresh for new data.

- **Java Integration**

  - **Cross-Language Compatibility**: Our meticulously crafted Java driver ([SimpleDBDriver](https://github.com/YahyaAzzam/SimpleDBDriver)) seamlessly integrates with the Simple File System Database, allowing Java applications to interact with the database effortlessly. This cross-language compatibility enhances the database's versatility, extending its usability to diverse programming ecosystems.



## 2. Installation <a name="installation"></a>

To use DataHive, follow these installation steps:

1. **Install python**: Python 3.x installed on your machine.



2. **Install DataHive**: Install DataHive package on your local machine:



```shell

pip install DataHive

```

## 3. Usage <a name="usage"></a>



### Schema Format <a name="schema"></a>

Below is an example of the schema format that defines the structure of the database, including the database name and tables with their respective attributes:

   1. **Schema Example**:

      ```

      {

          "database_name" : "ClassA1",

          "Tables" : [

              {

                  "name" : "student",

                  "columns" : ["First_name", "Last_name", "CGPA", "Gender", "Age"],

                  "primary_key"  : "Last_name",

                  "index_keys" : ["First_name", "Last_name", "CGPA"],

                  "overwrite" : "True",

             }

                      ]

       }

      ```

2. **Table Contents**:

  The schema format consists of the following elements for defining tables within the database:



      | Name | Type | Nullable | Notes |

      | ---- | ---- | -------- | ----- |

      | Name | string | No | Name of the table. |

      | Columns | List of Strings | No | List of column names, including the primary key. |

      | Primary_key | String | No | The primary key for the table. |

      | Index_key | List of Strings | Yes | List of column names that serve as index keys. |

      | Overwrite | boolean (true/false) | Yes | Initial value is 'false'; you can set its value to 'true' to enable overwriting.|

   

### Command-Line Interface <a name="commands"></a>



*Note: Ensure that you have a JSON file containing your schema before creating the database.*



| Command | Parameters | Description |

|---------|------------|-------------|

| `Create` | `DatabaseSchemaPath` | Creates a database following the specified [schema](#schema).

| `Set` | `DatabaseName`, `TableName`, `InputData` | Sets a row with the provided input data.

| `Get` | `DatabaseName`, `TableName`, `InputQuery` | Utilizes the input query to retrieve specific data from the database.

| `Delete` | `DatabaseName`, `TableName`, `InputQuery` | Uses the input query to delete specific data from the database.

| `Clear` | `DatabaseName` | Resets the specified database to its initial state.



This Command-Line Interface (CLI) provides a set of commands for creating, updating, querying, deleting data, and resetting databases, offering comprehensive control over your data management tasks.



## 4. Example Usage <a name="examples"></a>

- **The general format for any command in the program is as follows**:



   ```python

   python DataHive -c [command] [options]

   ```

   Replace `[command]` with the desired database command and `[options]` with relevant command options.



- **Commands Examples**:



    - Creating a new database:

         ```python

         python DataHive -c create -sc <your_schema_path>

         ```

    

    - Sets a row with the provided input data:

         ```python

         python DataHive -c set -db <your_database> -t <your_table> -q '{"key": "value"}'

         ```



    - Utilizes the input query to retrieve specific data from the database:

         ```python

         python DataHive -c get -db <your_database> -t <your_table> -q '{"key": "value"}'

                 # if you didn't add -q it will get all data in the table

         ```



    - Uses the input query to delete specific data from the database:

         ```python

         python DataHive -c delete -db <your_database> -t <your_table> -q '{"key": "value"}'

         ```



   - Resets the specified database to its initial state:

     ```python

     python DataHive -c clear -db <your_database>'

     ```

## 5. FAQs <a name="faqs"></a>



- **Q1: What is DataHive?**

  - **A1:** DataHive is a lightweight database system designed for storing data in JSON files. It provides essential CRUD (Create, Read, Update, Delete) operations and ensures synchronization between read and write operations. DataHive is an ideal solution for small-scale applications where a simple and reliable data storage system is required.



- **Q2: How do I install DataHive?**

  - **A2:** To install DataHive, you need to have Python 3.x installed on your machine. After ensuring Python is installed, run the following command:



    ```shell

    pip install DataHive

    ```



- **Q3: What is the schema format for defining the database structure?**

  - **A3:** The schema format defines the structure of the database, including the database name, tables, and their attributes. It consists of elements like table names, column names, primary keys, index keys, and overwriting settings. You can find a detailed example of the schema format in the [Schema Format](#schema) section of this README.



- **Q4: How do I use the Command-Line Interface (CLI) to interact with DataHive?**

  - **A4:** The CLI offers a set of commands for creating, updating, querying, deleting data, and resetting databases. You can use the general command format:



    ```shell

    python DataHive -c [command] [options]

    ```



    Replace `[command]` with the desired database command and `[options]` with relevant command options. Examples of various commands can be found in the [Example Usage](#examples) section.



- **Q5: Is DataHive compatible with Java?**

  - **A5:** Yes, DataHive is cross-language compatible. We have developed a dedicated Java driver (SimpleDBDriver) that seamlessly integrates with DataHive. This Java driver allows Java applications to interact with the database, extending its usability to diverse programming ecosystems.



## 6. Contributing <a name="contributing"></a>



Contributions to DataHive are welcome! Feel free to fork the repository, make improvements, and create pull requests.



## 7. License <a name="license"></a>



DataHive is released under the MIT License. See the [LICENSE](https://github.com/YahyaAzzam/SimpleFSDB/blob/master/LICENSE) file for details.



## 8. Upcoming Features <a name="upcoming-features">

   - Stay tuned for future updates and additional features. We are constantly working on enhancing DataHive to provide an even better data storage solution for your needs.

-----

*Note: This documentation provides an overview of DataHive's functionality and usage. For detailed code explanations, refer to the source code and comments in SimpleFSDB's repository.*





  






            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/YahyaAzzam/SimpleFSDB",
    "name": "DataHive",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "",
    "keywords": "DB,json,DataHive,File System,FSDB,simpleFSBD,SFSDB",
    "author": "Mahmoud Goda <mahmoden17@gmail.com>, Yahya Azzam <yahya912azzam@gmail.com>",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/8e/09/87c14078faa37a915ff3c5cf61dc272bfdfe8602ea6130def6b2e4d7f51f/DataHive-1.0.0.tar.gz",
    "platform": null,
    "description": "# Simple file system database (DataHive)\r\n\r\n[![PyPI](https://img.shields.io/pypi/v/DataHive.svg)](https://pypi.python.org/pypi/DataHive)\r\n\r\n[![Downloads](https://pepy.tech/badge/DataHive)](https://pepy.tech/project/DataHive)\r\n\r\n[![PyPI](https://img.shields.io/pypi/l/DataHive.svg)](https://github.com/YahyaAzzam/SimpleFSDB/blob/master/LICENSE)\r\n\r\n\r\n\r\n## Overview\r\n\r\nDataHive is a meticulously crafted, lightweight database system tailored for the purpose of data storage in JSON files. With a strong emphasis on simplicity and reliability, it offers essential CRUD (Create, Read, Update, Delete) operations and guarantees seamless synchronization between read and write operations. This project has been thoughtfully designed to serve as an elegant and file-based data storage solution, ideally suited for small-scale applications.\r\n\r\n\r\n\r\n## Table of Contents\r\n\r\n\r\n\r\n1. [Features](#features)\r\n\r\n2. [Installation](#installation)\r\n\r\n3. [Usage](#usage)\r\n\r\n    - [Schema formate](#schema)\r\n\r\n    - [Command-Line Interface](#commands)\r\n\r\n4. [Example Usage](#examples)\r\n\r\n5. [FAQs](#faqs)\r\n\r\n6. [Contributing](#contributing)\r\n\r\n7. [License](#license)\r\n\r\n8. [Upcoming Features](#upcoming-features)\r\n\r\n\r\n\r\n## 1. Features <a name=\"features\"></a>\r\n\r\n- **Data Storage Excellence**\r\n\r\n  - **Robust Storage**: Securely store data in JSON format.\r\n\r\n  - **Flexibility**: JSON supports diverse data types and complex structures.\r\n\r\n  - **Transparency**: Human-readable format simplifies debugging.\r\n\r\n  - **Compatibility**: Platform-independent for use in various applications.\r\n\r\n\r\n\r\n- **CRUD Functionality**\r\n\r\n  - **Create (C)**: Add new data with specified identifiers.\r\n\r\n  - **Read (R)**: Retrieve and query data for targeted searches.\r\n\r\n  - **Update (U)**: Modify existing data, ensuring accuracy.\r\n\r\n  - **Delete (D)**: Remove data to maintain a clean database.\r\n\r\n\r\n\r\n- **Synchronization Assurance**\r\n\r\n  - **ead-Write Consistency**: Guarantee synchronization between read and write operations for up-to-date data.\r\n\r\n  - **Data Integrity**: Maintain reliable and trustworthy data, preventing inconsistencies.\r\n\r\n\r\n\r\n- **Clearing Database**:\r\n\r\n    - **clear the data**: Wipe the database clean, starting fresh for new data.\r\n\r\n- **Java Integration**\r\n\r\n  - **Cross-Language Compatibility**: Our meticulously crafted Java driver ([SimpleDBDriver](https://github.com/YahyaAzzam/SimpleDBDriver)) seamlessly integrates with the Simple File System Database, allowing Java applications to interact with the database effortlessly. This cross-language compatibility enhances the database's versatility, extending its usability to diverse programming ecosystems.\r\n\r\n\r\n\r\n## 2. Installation <a name=\"installation\"></a>\r\n\r\nTo use DataHive, follow these installation steps:\r\n\r\n1. **Install python**: Python 3.x installed on your machine.\r\n\r\n\r\n\r\n2. **Install DataHive**: Install DataHive package on your local machine:\r\n\r\n\r\n\r\n```shell\r\n\r\npip install DataHive\r\n\r\n```\r\n\r\n## 3. Usage <a name=\"usage\"></a>\r\n\r\n\r\n\r\n### Schema Format <a name=\"schema\"></a>\r\n\r\nBelow is an example of the schema format that defines the structure of the database, including the database name and tables with their respective attributes:\r\n\r\n   1. **Schema Example**:\r\n\r\n      ```\r\n\r\n      {\r\n\r\n          \"database_name\" : \"ClassA1\",\r\n\r\n          \"Tables\" : [\r\n\r\n              {\r\n\r\n                  \"name\" : \"student\",\r\n\r\n                  \"columns\" : [\"First_name\", \"Last_name\", \"CGPA\", \"Gender\", \"Age\"],\r\n\r\n                  \"primary_key\"  : \"Last_name\",\r\n\r\n                  \"index_keys\" : [\"First_name\", \"Last_name\", \"CGPA\"],\r\n\r\n                  \"overwrite\" : \"True\",\r\n\r\n             }\r\n\r\n                      ]\r\n\r\n       }\r\n\r\n      ```\r\n\r\n2. **Table Contents**:\r\n\r\n  The schema format consists of the following elements for defining tables within the database:\r\n\r\n\r\n\r\n      | Name | Type | Nullable | Notes |\r\n\r\n      | ---- | ---- | -------- | ----- |\r\n\r\n      | Name | string | No | Name of the table. |\r\n\r\n      | Columns | List of Strings | No | List of column names, including the primary key. |\r\n\r\n      | Primary_key | String | No | The primary key for the table. |\r\n\r\n      | Index_key | List of Strings | Yes | List of column names that serve as index keys. |\r\n\r\n      | Overwrite | boolean (true/false) | Yes | Initial value is 'false'; you can set its value to 'true' to enable overwriting.|\r\n\r\n   \r\n\r\n### Command-Line Interface <a name=\"commands\"></a>\r\n\r\n\r\n\r\n*Note: Ensure that you have a JSON file containing your schema before creating the database.*\r\n\r\n\r\n\r\n| Command | Parameters | Description |\r\n\r\n|---------|------------|-------------|\r\n\r\n| `Create` | `DatabaseSchemaPath` | Creates a database following the specified [schema](#schema).\r\n\r\n| `Set` | `DatabaseName`, `TableName`, `InputData` | Sets a row with the provided input data.\r\n\r\n| `Get` | `DatabaseName`, `TableName`, `InputQuery` | Utilizes the input query to retrieve specific data from the database.\r\n\r\n| `Delete` | `DatabaseName`, `TableName`, `InputQuery` | Uses the input query to delete specific data from the database.\r\n\r\n| `Clear` | `DatabaseName` | Resets the specified database to its initial state.\r\n\r\n\r\n\r\nThis Command-Line Interface (CLI) provides a set of commands for creating, updating, querying, deleting data, and resetting databases, offering comprehensive control over your data management tasks.\r\n\r\n\r\n\r\n## 4. Example Usage <a name=\"examples\"></a>\r\n\r\n- **The general format for any command in the program is as follows**:\r\n\r\n\r\n\r\n   ```python\r\n\r\n   python DataHive -c [command] [options]\r\n\r\n   ```\r\n\r\n   Replace `[command]` with the desired database command and `[options]` with relevant command options.\r\n\r\n\r\n\r\n- **Commands Examples**:\r\n\r\n\r\n\r\n    - Creating a new database:\r\n\r\n         ```python\r\n\r\n         python DataHive -c create -sc <your_schema_path>\r\n\r\n         ```\r\n\r\n    \r\n\r\n    - Sets a row with the provided input data:\r\n\r\n         ```python\r\n\r\n         python DataHive -c set -db <your_database> -t <your_table> -q '{\"key\": \"value\"}'\r\n\r\n         ```\r\n\r\n\r\n\r\n    - Utilizes the input query to retrieve specific data from the database:\r\n\r\n         ```python\r\n\r\n         python DataHive -c get -db <your_database> -t <your_table> -q '{\"key\": \"value\"}'\r\n\r\n                 # if you didn't add -q it will get all data in the table\r\n\r\n         ```\r\n\r\n\r\n\r\n    - Uses the input query to delete specific data from the database:\r\n\r\n         ```python\r\n\r\n         python DataHive -c delete -db <your_database> -t <your_table> -q '{\"key\": \"value\"}'\r\n\r\n         ```\r\n\r\n\r\n\r\n   - Resets the specified database to its initial state:\r\n\r\n     ```python\r\n\r\n     python DataHive -c clear -db <your_database>'\r\n\r\n     ```\r\n\r\n## 5. FAQs <a name=\"faqs\"></a>\r\n\r\n\r\n\r\n- **Q1: What is DataHive?**\r\n\r\n  - **A1:** DataHive is a lightweight database system designed for storing data in JSON files. It provides essential CRUD (Create, Read, Update, Delete) operations and ensures synchronization between read and write operations. DataHive is an ideal solution for small-scale applications where a simple and reliable data storage system is required.\r\n\r\n\r\n\r\n- **Q2: How do I install DataHive?**\r\n\r\n  - **A2:** To install DataHive, you need to have Python 3.x installed on your machine. After ensuring Python is installed, run the following command:\r\n\r\n\r\n\r\n    ```shell\r\n\r\n    pip install DataHive\r\n\r\n    ```\r\n\r\n\r\n\r\n- **Q3: What is the schema format for defining the database structure?**\r\n\r\n  - **A3:** The schema format defines the structure of the database, including the database name, tables, and their attributes. It consists of elements like table names, column names, primary keys, index keys, and overwriting settings. You can find a detailed example of the schema format in the [Schema Format](#schema) section of this README.\r\n\r\n\r\n\r\n- **Q4: How do I use the Command-Line Interface (CLI) to interact with DataHive?**\r\n\r\n  - **A4:** The CLI offers a set of commands for creating, updating, querying, deleting data, and resetting databases. You can use the general command format:\r\n\r\n\r\n\r\n    ```shell\r\n\r\n    python DataHive -c [command] [options]\r\n\r\n    ```\r\n\r\n\r\n\r\n    Replace `[command]` with the desired database command and `[options]` with relevant command options. Examples of various commands can be found in the [Example Usage](#examples) section.\r\n\r\n\r\n\r\n- **Q5: Is DataHive compatible with Java?**\r\n\r\n  - **A5:** Yes, DataHive is cross-language compatible. We have developed a dedicated Java driver (SimpleDBDriver) that seamlessly integrates with DataHive. This Java driver allows Java applications to interact with the database, extending its usability to diverse programming ecosystems.\r\n\r\n\r\n\r\n## 6. Contributing <a name=\"contributing\"></a>\r\n\r\n\r\n\r\nContributions to DataHive are welcome! Feel free to fork the repository, make improvements, and create pull requests.\r\n\r\n\r\n\r\n## 7. License <a name=\"license\"></a>\r\n\r\n\r\n\r\nDataHive is released under the MIT License. See the [LICENSE](https://github.com/YahyaAzzam/SimpleFSDB/blob/master/LICENSE) file for details.\r\n\r\n\r\n\r\n## 8. Upcoming Features <a name=\"upcoming-features\">\r\n\r\n   - Stay tuned for future updates and additional features. We are constantly working on enhancing DataHive to provide an even better data storage solution for your needs.\r\n\r\n-----\r\n\r\n*Note: This documentation provides an overview of DataHive's functionality and usage. For detailed code explanations, refer to the source code and comments in SimpleFSDB's repository.*\r\n\r\n\r\n\r\n\r\n\r\n  \r\n\r\n\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "DataHive is a Python library and tool for managing and querying JSON-based file system databases (FSDB). It provides a simple and efficient way to work with structured data stored in JSON format on your -mlocal file system.",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/YahyaAzzam/SimpleFSDB"
    },
    "split_keywords": [
        "db",
        "json",
        "datahive",
        "file system",
        "fsdb",
        "simplefsbd",
        "sfsdb"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bdc4eec02d54e804c5b144133f3b34f48488e9ba1d663017e6b44c8486f43ed7",
                "md5": "cfe6f6af6b79af7657e9c7916b6be7d7",
                "sha256": "e4c627b5e8927f0c1b78f525b856e9192f179b1d5401f0511ab64562f86247c2"
            },
            "downloads": -1,
            "filename": "DataHive-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cfe6f6af6b79af7657e9c7916b6be7d7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 43765,
            "upload_time": "2023-10-31T07:01:23",
            "upload_time_iso_8601": "2023-10-31T07:01:23.146424Z",
            "url": "https://files.pythonhosted.org/packages/bd/c4/eec02d54e804c5b144133f3b34f48488e9ba1d663017e6b44c8486f43ed7/DataHive-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8e0987c14078faa37a915ff3c5cf61dc272bfdfe8602ea6130def6b2e4d7f51f",
                "md5": "1af1cd91f7398a17d34b1b318d3098ac",
                "sha256": "6ed367de36f447277170fba3afd265bdd9e8d2e0528653417ae155062cd02126"
            },
            "downloads": -1,
            "filename": "DataHive-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1af1cd91f7398a17d34b1b318d3098ac",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 26941,
            "upload_time": "2023-10-31T07:01:25",
            "upload_time_iso_8601": "2023-10-31T07:01:25.317447Z",
            "url": "https://files.pythonhosted.org/packages/8e/09/87c14078faa37a915ff3c5cf61dc272bfdfe8602ea6130def6b2e4d7f51f/DataHive-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-31 07:01:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "YahyaAzzam",
    "github_project": "SimpleFSDB",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "datahive"
}
        
Elapsed time: 0.14885s