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.2.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.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: portabledb-2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 61fd4b8a0b0f14bdd303fe7ae5f617e23134f579f52be6d52855a9ff123aaa25
MD5 929f033e56db098fd2b66a1b1b2fcc5d
BLAKE2b-256 6059ca1143a2f9b1df5722cfc0883866dfd67453174333f682e58a0950d7be7c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: portableDB-2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c7413be1760367d1170bf98d2d939678279a0adf58e48e3f3a12ca935d9baed
MD5 8bc3d6d8f25e943d4481c6dd5428bd06
BLAKE2b-256 53fc1bc082ee4035d174146bf7ca8d1a0a807b5a9098b50f3ea26c574ad1e78c

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