Skip to main content

JSON Database but just encrypted

Project description

TrollDB

Just a simple json database project made by Walter.

Installing

You need cryptography to use trolldb.

pip install --upgrade trolldb

Example code

import trolldb


database = trolldb.Database(trolldb.key_by_filename('key.trolldb')) # new database
print('Doing database on {0}'.format(database.getfilename())) 

v = str(1)
database.add(v, '{0}'.format(v)) # sets variable in the database
print(database.get(v)) # get variable 
print(database.getplainjson()) # prints the whole json

Getting 'key'

Trolldb will write your key into file called "key.trolldb"

import trolldb
trolldb.genkey()

Creating new database (or load existing database)

import trolldb
database = trolldb.Database("yourkeyhere")

Creating or changing a variable's value

database.add("varname", "value")

Deleting variable

database.remove("varname")

Using tables

note: Tables aren't finished yet.

Creating a new table (or load an existing table)

import trolldb
database = trolldb.Database("yourkeyhere")
table = trolldb.Table.new(database, "tablename")

Adding an element into the table (or changing an existing element)

table.add("elemname", "value")

Getting element value

table.get("elemname")

Deleting element

table.remove("elemname")

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

trolldb-1.2.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

trolldb-1.2.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file trolldb-1.2.1.tar.gz.

File metadata

  • Download URL: trolldb-1.2.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for trolldb-1.2.1.tar.gz
Algorithm Hash digest
SHA256 f1426d33c8bd3dea0bc87eaded0477ad73939170a56f64913c3f69836aaf1867
MD5 49f6a4b26747b5ad81d0c169aa76e3d9
BLAKE2b-256 79871b0c708d707560eaa3705bc80fee05c19a840a12ade71e14444a5dcca0b6

See more details on using hashes here.

File details

Details for the file trolldb-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: trolldb-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for trolldb-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 94a72f46f133a642e18bacc88d55f7ca3dbfe480c40872a345906c1c904bb077
MD5 0f177ab0640e031df21b9b5fb239172b
BLAKE2b-256 8bf0845e764178e7ac64d581c9583cc00cabaa6ca50b236923bf77b86cc9c196

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