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

jsodb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsodb

simple json database lib

  • 1.6.0
  • PyPI
  • Socket score

Maintainers
1

jsodb

Mine database realization that uses .json files.

How to work with it?

Instalation: python3 -m pip install jsodb

Basic funcs:

import jdb
getkeyval("key") # returns key val
addkey(key=val) # adds keys to json
changekey("key", val) # changes key to new val
createjson("/path/to/file" """without .json""") # new .json file (without decorator)
addtokey("key", int) # key += int
subfromkey("key", int) # key -= int
addmultikey("key", key=val, key2=val2) # new multi key {key: {"key": "val", "key2", "val2"}}
@json("/path/to/file") # main decorator

To use all that functions you need function with decorator, json file will be: opened, edited, saved.

Basic usage:

@json("profile.json")
def func():
	print(getkeyval(balance)) ### 1
	changekey(balance, 10) ### {balance=10}
	addkey(deposit=100) ### {balance=10, deposit=100}
	print(f"{getkeyval(balance)}\n{getkeyval(deposit)}")
	"""
	10
	100
	"""

func() ### changes applied

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