rootoi 1.0.4
Rootoi is a nosql ,lightweight, file-based database management system that provides basic CRUD (Create, Read, Update, Delete) operations along with hashing mechanisms for data security.
Keywords: rootoi, rootoidb, Rootoi, rootoi db, rootoidb, nosql, nosql db, rootoi nosql db

# Rootoi

Rootoi is a nosql ,lightweight, file-based database management system that provides basic CRUD (Create, Read, Update, Delete) operations along with hashing mechanisms for data security.

## Features

- Store and manage data in a simple file-based format.
- Secure data with SHA-256 hashing.
- Read and retrieve entries using unique identifiers.
- Update and delete entries.
- Verify database integrity.
- Acts as NoSQL database 


## Installation

Ensure you have Python 3 installed on your system.

```bash
pip install -r requirements.txt  # if dependencies are needed
```

## Usage

### Initialize the Database

```python
from rootoi import Rootoi

db = Rootoi("database_name", 4)  # Initialize with database name and entry column count
```

## Methods

### `__init__(database: str, rc: int)`

Initializes the Rootoi database.

- `database`: Name of the database.
- `rc`: Number of columns for each entry.

### `create_project(project: str, column: int)`

**Imported from `rootoi.project`**

Creates a new database project.

- `project`: Name of the project.
- `column`: Number of columns per entry.
- Generates two files: `{project}.config.json` and `{project}.rootoi`.
- The config file initializes default security settings.

**Example:**

```python
from rootoi.project import create_project
create_project("my_database", 4)
```

### `create_entry(*entry)`

Adds a new entry to the database.

- `entry`: Variable number of values (must match `rc` from initialization).
- Returns the generated entry ID.

**Example:**

```python
db.create_entry("John Doe", "johndoe@example.com", "password123", "Admin")
```

### `read_all_entry()`

Retrieves all entries in the database.

- Returns a list of dictionaries containing stored entries.

**Example:**

```python
entries = db.read_all_entry()
print(entries)
```

### `read_entry(id: str)`

Retrieves a specific entry by ID.

- `id`: The unique identifier for an entry.
- Returns the corresponding entry data.

**Example:**

```python
entry = db.read_entry("Syh8ZZC2aIItAWA5xDDy33Pf8VHPWpjWPbZBWM6Bci04KIW9NWPQsj4b7PmKBUKO1UlDFcs8AYeBSipBXjsivSIEZi9ZR6Nnz0nOeyzlND9")
print(entry)
```

### `delete_all_entry()`

Deletes all entries in the database.

**Example:**

```python
db.delete_all_entry()
```

### `delete_entry(id: str)`

Deletes a specific entry by ID.

- `id`: The unique identifier of the entry to delete.

**Example:**

```python
db.delete_entry("eRPW69QnPKAyAJC8jkW9c5IxYz4h8PDWXObllPGgY6JCUHh2P7ODuOYSuNfAoaC0Qaywh3iejV0JzZZeQrh6wAQvdhSqielUPeO7pw7PQ8Kf")
```

### `update_entry(id: str, column: int, value)`

Updates a specific entry.

- `id`: The unique identifier of the entry.
- `column`: The column index to update.
- `value`: The new value to set.

**Example:**

```python
db.update_entry("V7Nnqyxcqw2CasP5QP26NG7wFtE0HD2YGQEUfLi6B4ExYlGkFqhyN6NndINEmLl8dN6AdmC7YzvGUBsOseBqTzz7qsukzKF8q7PYgjhuYHcE", 3, "New Value")
```

### `hash_dev_sha256()`

Applies SHA-256 hashing to all stored entries that are not yet hashed.

**Example:**

```python
db.hash_dev_sha256()
```

## Security

- Uses SHA-256 hashing for sensitive data storage.
- Ensures database integrity through versioning and configuration verification.

## License

This project is licensed under the MIT License.

## Author

Developed by Akshay