Multicoin is an ease-of-access Python package packed full of useful tools for developers.
Project description
GitBase
GitBase is a Python package for custom databases powered by GitHub ("Gitbases"/"GitBase"), with encryption using cryptography. It provides Python developers with a quick and easy-to-use database solution without requiring knowledge of a new programming language. Additionally, GitBase offers offline backups, allowing users to save, load, and delete their data even without an internet connection. The online database will automatically sync with the latest file, whether offline or online.
Latest Update
- Removed init function from GitBase (in-testing still)
- Fixed '200' error code bug with deleting key-value data & player accounts
- Fixed 'get_all' for both DataSystem and PlayerDataSystem
- Added optional path parameters for DataSystem.save_data & DataSystem.delete_data
Example Code
# Example for GitBase 0.4.9
from gitbase import GitBase, PlayerDataSystem, DataSystem, KeyValue
import sys
# Initialize GitHub database and encryption key
GITHUB_TOKEN = "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"
REPO_OWNER = "TaireruLLC"
REPO_NAME = "alkherm-database"
encryption_key = b'Vj8XfsLdZ0Uz0xOnnHOa5mVi_RanZ28Pk1isUKMqJEk='
# Setup GitBase with GitHub credentials
database = GitBase(GITHUB_TOKEN, REPO_OWNER, REPO_NAME)
player_data_system = PlayerDataSystem(db=database, encryption_key=encryption_key)
data_system = DataSystem(db=database, encryption_key=encryption_key)
# Upload and download example files to/from GitHub
database.upload_file(file_path="my_file.txt", remote_path="saved_files")
database.download_file(remote_path="my_file.txt", local_path="files")
# Define the Player class to manage individual player instances
class Player:
def __init__(self, username, score, password):
self.username = username
self.score = score
self.password = password
# Create a sample player instance
player = Player(username="john_doe", score=100, password="123")
# Save specific attributes of the player instance with encryption
player_data_system.save_account(
username="john_doe",
player_instance=player,
encryption=True,
attributes=["username", "score", "password"],
path="players"
)
# Load player data
player_data_system.load_account(username="john_doe", player_instance=player, encryption=True)
# Placeholder functions for game flow
def load_game():
print("Game starting...")
def main_menu():
sys.exit("Exiting game...")
# Check if an account exists and validate user password
if player_data_system.get_all(path="players"):
if player.password == input("Enter your password: "):
print("Login successful!")
load_game()
else:
print("Incorrect password!")
main_menu()
# Save key-value data with encryption
data_system.save_data(key="key_name", value=69, path="data", encryption=True)
# Load and display a specific key-value pair
loaded_key_value: KeyValue = data_system.load_data(key="key_name", path="data", encryption=True)
print(f"Key: {loaded_key_value.key}, Value: {loaded_key_value.value}")
# Retrieve and display all key-value pairs in the data path
print("All stored data:", data_system.get_all(path="data"))
# Delete specific key-value data
data_system.delete_data(key="key_name", path="data")
# Retrieve and display all player accounts
print("All player accounts:", player_data_system.get_all(path="players"))
# Delete a specific player account
player_data_system.delete_account(username="john_doe")
Consider Using GitBase Web
GitBase Web
GitBase Web is an extension of the Python project developed by Taireru LLC called GitBase. This extension allows developers to view all their saved data via the web.
Note: To use GitBase Web, you must:
- Use a private GitHub repository.
- Host the website using a service such as Vercel.
Links
- GitBase: https://tairerullc.vercel.app/products/packages/gitbase
- Website: https://tairerullc.vercel.app/
Contact
For any inquiries, please email us at tairerullc@gmail.com. We’ll get back to you as soon as possible.
Thank you for using GitBase, and happy coding!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multicoin-0.0.1.tar.gz.
File metadata
- Download URL: multicoin-0.0.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dce3b3146215454c09ac6319af763e5cde8c376687639cfbfb251a676b482fe0
|
|
| MD5 |
089e0e0bb79c2d0bec44945c4acb0982
|
|
| BLAKE2b-256 |
36a0a65c8e13385d2438b17ff17ba8a6a209cf46926f12a741402bde4b4ebf88
|
File details
Details for the file multicoin-0.0.1-py3-none-any.whl.
File metadata
- Download URL: multicoin-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b4cb99092bcb63e72d3f2b8a8806c4e5eff497d062878f6a2b47b90a187266c
|
|
| MD5 |
8c15af095d08c191c2a7a12059064b65
|
|
| BLAKE2b-256 |
972e0be018fe87422e820aa8fe48098fb9898f5b48096c8e8c61e4ab1781bbad
|