Skip to main content

simple json database lib

Project description

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") # new .json file (without decorator)
@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

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

jsodb-1.0.0.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

jsodb-1.0.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file jsodb-1.0.0.tar.gz.

File metadata

  • Download URL: jsodb-1.0.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for jsodb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 29bce6d5d131e31ba8f5bd17c2be686671d420f9150c38c1a29d668dbb0791ef
MD5 e5ea6f12831561f882a33dc521427a2a
BLAKE2b-256 978494e0d6c498b4c77ca203c2beb9d12898b70912b1fe5476dad9d20396ca1c

See more details on using hashes here.

File details

Details for the file jsodb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: jsodb-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for jsodb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2176cb2c073244deef8a11575d83024c3bd03395cd455a4ed4e81af94c0189e
MD5 ad90e2c4c37a4327f4d14e919c853225
BLAKE2b-256 c41ad275e53343bbc59264dde6bda871fc162280e32bdc16de4014297cfdc744

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