📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

rootoi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

1.0.4
PyPI
Maintainers
1

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.

pip install -r requirements.txt  # if dependencies are needed

Usage

Initialize the Database

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:

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:

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:

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:

entry = db.read_entry("Syh8ZZC2aIItAWA5xDDy33Pf8VHPWpjWPbZBWM6Bci04KIW9NWPQsj4b7PmKBUKO1UlDFcs8AYeBSipBXjsivSIEZi9ZR6Nnz0nOeyzlND9")
print(entry)

delete_all_entry()

Deletes all entries in the database.

Example:

db.delete_all_entry()

delete_entry(id: str)

Deletes a specific entry by ID.

  • id: The unique identifier of the entry to delete.

Example:

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:

db.update_entry("V7Nnqyxcqw2CasP5QP26NG7wFtE0HD2YGQEUfLi6B4ExYlGkFqhyN6NndINEmLl8dN6AdmC7YzvGUBsOseBqTzz7qsukzKF8q7PYgjhuYHcE", 3, "New Value")

hash_dev_sha256()

Applies SHA-256 hashing to all stored entries that are not yet hashed.

Example:

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

Keywords

rootoi

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts