Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trolldb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trolldb

JSON Database but just encrypted

  • 1.2.1
  • PyPI
  • Socket score

Maintainers
1

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")

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc