Skip to main content

This library is an easyest way to use local database!

Project description

PortableDB Documentation

PortableDB is a lightweight, easy-to-use Python package for creating, managing, and interacting with portable databases.

Installation

To install PortableDB, use pip:

pip install portableDB

Methods

db = DATABASE(name)

Defines the database to work with. You must initialize a DATABASE object before using other methods.

  • Arguments:
    • name (str): The name of the database file (e.g., 'Database.db').
      • This file will be created if it doesn't already exist.

db.LogType(Type)

Sets the logging state for database operations.

  • Arguments:
    • Type (str): Can be one of the following:
      • 'COLORFUL': Enables colorful logs for better readability.
      • 'BASE': Enables normal command-line logging.
      • 'NONE': Disables logging output.

db.CreateDatabase()

Creates a new database.

  • Arguments:
    • No arguments are required.

db.WriteDatabase(information, cell)

Writes data to the database.

  • Arguments:
    • information (array): An array of values to write (e.g., ['String value', 32]).
    • cell (str): The cell where the data will be written (e.g., 'LOL').
      • Cell can be of any type or value.

db.WriteIndex(information, cell, index)

Writes data to a specific index within a specified cell.

  • Arguments:
    • information (any type): The information to write (e.g., 'PON').
    • cell (str): The cell in which to write the information (e.g., 'LOL').
      • Cell can be of any type or value.
    • index (int): The index at which to write the information (e.g., 0).

db.ReadDatabase(cell, index)

Reads data from the database.

  • Arguments:

    • cell (str): The cell to read from (e.g., 'LOL').
    • index (str or int, optional):
      • 'ALL': Reads all elements in the specified cell.
      • An integer: Reads the specific element at the given index in the array.
      • If this argument is ignored, it behaves like 'ALL' was given.
  • Returns:

    • The data read from the specified cell and index.

db.RenameDatabase(newName)

Renames the database.

  • Arguments:
    • newName (str): The new name for the database (do not include the file type like '.db').

db.DeleteDatabase()

Deletes the specified database.

  • Arguments:
    • No arguments are required.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

portabledb-2.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

portableDB-2.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file portabledb-2.1.tar.gz.

File metadata

  • Download URL: portabledb-2.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for portabledb-2.1.tar.gz
Algorithm Hash digest
SHA256 2744bd15bd486283ef8c35e62ee8cc54f0d31a9b4d2c65ca37153ec1c3950c4a
MD5 5e57d85949a48646552966c9daa84674
BLAKE2b-256 eacdab12f33c805a4575dc8ff5dc8517e3991d11062fdf556c29dd8fef72bb79

See more details on using hashes here.

File details

Details for the file portableDB-2.1-py3-none-any.whl.

File metadata

  • Download URL: portableDB-2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for portableDB-2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 874e561d9618e022960be74d878e55c1ec88232514cdf630b488e80eb4e0e58d
MD5 c48d4f1b2c48f8b7f121129822cc11c8
BLAKE2b-256 a0c7b27ab281e748f4dbdf0293e78fbb4329c417d587e57b487dbe7c5a93fa2b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page