Skip to main content

A client library for interacting with LonaDB server

Project description

Installation

You can install the LonaDB Python Client via pip:

pip install lonadb-client

Usage

To use the LonaDB Python Client, follow these steps:

  1. Import the LonaDB class into your Python script:
from lonadb_client import LonaDB
  1. Create an instance of the LonaDB class by providing the required connection details:
client = LonaDB(host, port, name, password)

Replace host, port, name, and password with the appropriate values for your LonaDB server.

  1. Use the provided methods to interact with the server:
# Example: Get a list of tables
tables = client.get_tables("username");

# Display the list of tables
print(tables)

Available Methods

get_tables(user)

Retrieves a list of tables available in the database.

get_table_data(table)

Retrieves data from a specified table.

delete_table(table)

Deletes a table by its name.

create_table(table)

Creates a new table with the given name.

set_variable(table, name, value)

Sets a variable within a table to the specified value.

remove_variable(table, name)

Deletes a variable from a table.

get_variable(table, name)

Retrieves the value of a variable from a table.

get_users()

Retrieves a list of users in the database.

create_user(name, password)

Creates a new user with the given name and password.

delete_user(name)

Deletes a user by their name.

check_password(name, password)

Checks if the provided password is correct for a given user.

check_permission(name, permission)

Checks if a user has a specific permission.

remove_permission(name, permission)

Removes a permission from a user.

get_permissions_raw(name)

Retrieves the raw permission data for a user.

add_permission(name, permission)

Adds a permission to a user.

create_function(name, content)

Create a function which can be executed whenever you want. Just like eval. Content = string of PHP code

execute_function(name)

Executes the function

eval(func)

Runs the function (must be a string of PHP code) Example: "if ($abc == 1234) return 'wtf';" Response: {"success": True, "response": "wtf", "process": processID}

License

This project is licensed under the GNU Affero General Public License version 3 (GNU AGPL-3.0).

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

lonadb-client-2.1.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file lonadb-client-2.1.tar.gz.

File metadata

  • Download URL: lonadb-client-2.1.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.2

File hashes

Hashes for lonadb-client-2.1.tar.gz
Algorithm Hash digest
SHA256 c8f7efc3f880b91481ae4ed9551311ef6c966fa198dac89a9385a1d765783233
MD5 0a502404838d5bf48a368a8e51690f60
BLAKE2b-256 44c9529234664f678459a10a2cb6a69a2e528a09a40bda84119e30323460988d

See more details on using hashes here.

Supported by

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