Skip to main content

Imagine using JSON as database. Wait... that's me!

Project description

JsonDB

[!WARNING] This is for my personal use only. You really shouldn't be using JSON for database.

Uses

I'm using this for my Telegram bot and Elysian's Chemistry Bot.

Usage

  1. Add it to your project as dependency, for example if you use uv:
uv add jsondb-hakimifr
  1. profit!!!
from jsondb.database import Database

db = Database("foo.json")
db.read_database()  # actually redundant as __init__ will call this

db.data = {"hello": "world"}
db.write_database()

Extras

  • There's a callback registered to atexit module, so that a crash doesn't throw away unsaved stuff.
  • Minimal safeguard to prevent multiple instances from opening the same file at the same time (I don't even know if it actually works lol).

License

SPDX-License-Identifier: Apache-2.0

Copyright 2025 Firdaus Hakimi <hakimifirdaus944@gmail.com>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

or

    the LICENSE file in this repository.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

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

jsondb_hakimifr-0.3.2.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsondb_hakimifr-0.3.2-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file jsondb_hakimifr-0.3.2.tar.gz.

File metadata

  • Download URL: jsondb_hakimifr-0.3.2.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for jsondb_hakimifr-0.3.2.tar.gz
Algorithm Hash digest
SHA256 1feab736390f20e3710fc8833682390b2d89e45bd0fb3fee3c4d953808dce499
MD5 4292dc3ef5aad2d34895aee2c9ecfff1
BLAKE2b-256 79efa2b5b26d52c9616cccbd793ad73b8f1d364f19fe2555c0c0671c6bc1b0e6

See more details on using hashes here.

File details

Details for the file jsondb_hakimifr-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: jsondb_hakimifr-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"44","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for jsondb_hakimifr-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 72d9a8ee91f87be1ce0e2ff67bd6032da2b59be9f49008696053b52e128e975d
MD5 13a15f465eafc98e91c89934e222d9a7
BLAKE2b-256 a7d4157d3042b43a6518d10cca9c83a99ac57334492d640b0feac4163e188aa2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page