semvec/pypi-packages huggingface dataset:
ghostbase 1.2.6
SelfHosted DB
License: MIT
Keywords: flask sqlite database

# 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.

## IMPORTANT NOTICES

- Please note since ghostbase 1.2.6 the url is not needed and set to `https://db.ghostai.me/`
- Please note since ghostbase 1.2.6 the apikey is needed after the function check below for more info

## Getting Started

### Installation

To use Ghostbase, you will need to have the `requests` library installed. You can install it using pip:

```bash
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:

```python
import ghostbase
```

## Functions

### Creates a new database with the given name

```python
ghostbase.create_database(db_name,api_key)
```

### Validates a user's credentials and returns a success message if they are valid

```python
ghostbase.validate_user(db_name, username, password,api_key)
```

### Adds a new user to the database

```python
ghostbase.add_user(db_name, username, email, password, pro_status,api_key)
```

### Deletes a user from the database

```python
ghostbase.delete_user(db_name, username,api_key)
```

### Edits a user's pro status

```python
ghostbase.edit_user_pro_status(db_name, username, pro_status,api_key)
```

### Returns a user's pro status as a boolean value (True or False)

```python
ghostbase.return_pro_status(db_name, username,api_key)
```