GitBase
GitBase is a Python package for custom databases powered by GitHub, with encryption using cryptography
. It allows you, as a python developer to have a quick and easy to use database without learning a whole new programming language. Furthermore, we offer offline backups for users of your application, this means their data can be saved, loaded, and deleted even if they have no internet. Moreover, the online version will be updated based on which file, the offline or online, is the latest.
Latest Updates:
Installation
Install via pip:
pip install gitbase
Example code:
from gitbase import *
from cryptography.fernet import Fernet
import sys
GitBase.generate_example()
GITHUB_TOKEN = "YOUR_TOKEN"
REPO_OWNER = "YOUR_GITHUB_USERNAME"
REPO_NAME = "YOUR_REPO_NAME"
key = Fernet.generate_key()
db = GitBase(GITHUB_TOKEN, REPO_OWNER, REPO_NAME)
player_data_system = PlayerDataSystem(db, key)
data_system = DataSystem(db, key)
class Player:
def __init__(self, username, score, password):
self.username = username
self.score = score
self.password = password
player = Player("john_doe", 100, "123")
player_data_system.save_account(username="john_doe", player_instance=player, encryption=True, attributes=["username", "score", "password"])
player_data_system.load_account(username="john_doe", player_instance=player, encryption=True)
def load_game():
print("Cool game text")
def main_menu():
sys.exit()
if data_loaded():
if player.password == input("Enter your password: "):
print("Correct!")
load_game()
else:
print("Incorrect password!")
main_menu()
data_system.save_data(key="key_name", value=69, encryption=True)
key_1 = data_system.load_data(key="key_name", encryption=True)
print(key_1.value)
print(key_1.key)
print(data_system.get_all())
data_system.delete_data(key="key_name")
player_data_system.delete_account(username="john_doe")
Gitbase Web:
Gitbase Web is an extension of the PyPi module by Taireru LLC called GitBase. This extension allows the developer to veiw all of their saved data via the web.
Please note that to view said data you MUST use a private repo and use a website hosting service such as vercel.
Links:
Contact 'tairerullc@gmail.com' for any inquires and we will get back at our latest expense. Thank you for using our product and happy coding!