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

Uploaded Python 3

File details

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

File metadata

  • Download URL: portabledb-2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 a579f6435cd2e10177a8abbdc394d608a53295135ed956220e9a5acafd73556c
MD5 66fd42fd65a8ad7004a6879de7e5fdc6
BLAKE2b-256 a0136eb2a6fa18f21d7c984f3897f789bf3423fcc5b7415de1a61d4000e925bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: portableDB-2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81ec84533627e18f7d32c636690e3ba040502371a4e1f3f8695a548933d4f6e2
MD5 293f2d4701a1adbdcb47e509aa196f65
BLAKE2b-256 7416c3beb11fd566e3752b7ec16148e67ea37a278d33d5a94981c09d0e863217

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