Skip to main content

SelfHosted DB

Project description

Ghostbase

Introduction

Ghostbase is a Python library that provides a simple interface for interacting with a Flask server that manages user databases. With Ghostbase, you can create databases, add users, validate user credentials, and edit user pro status.

Getting Started

Installation

To use Ghostbase, you will need to have the requests library installed. You can install it using pip:

pip install requests

Setting up the Flask Server

Before using Ghostbase, you will need to set up the Flask server that it interacts with. You will need to set the base_url variable to the URL of the Flask server, and you will need to obtain an API key to use for authentication. The default base url that you can set is - https://db.ghostai.me/ you will need to contact cyberzendev@gmail.com if you want to use the api key

Importing the Library

To use Ghostbase, simply import it into your Python script:

import ghostbase

Setting the Base URL and API Key

Before making any requests, you will need to set the base_url and apikey variables:

ghostbase.url = "your_flask_server_url" # Or you can use https://db.ghostai.me/
ghostbase.apikey = "your_api_key_here" # You can get this by writing an email to cyberzendev@gmail.com

Functions

Creates a new database with the given name

ghostbase.create_database(db_name)

Validates a user's credentials and returns a success message if they are valid

ghostbase.validate_user(db_name, username, password)

Adds a new user to the database

ghostbase.add_user(db_name, username, email, password, pro_status)

Deletes a user from the database

ghostbase.delete_user(db_name, username)

Edits a user's pro status

ghostbase.edit_user_pro_status(db_name, username, pro_status)

Returns a user's pro status as a boolean value (True or False)

ghostbase.return_pro_status(db_name, username)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

ghostbase-1.2.0-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

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