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

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.1.0.tar.gz (8.8 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.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: jsondb_hakimifr-0.1.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.29

File hashes

Hashes for jsondb_hakimifr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92f933359b225b5993e397875a8053b7e0e04433258a54fa39c6a8b7f91fee5b
MD5 ba685645e16547cdc015cb6e1d5ab48a
BLAKE2b-256 968ff06d88975abf046c85699bec88ac805bf48b6a997b651c0bdc2e2d228be9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jsondb_hakimifr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bac1e5f9d7feb699fe219cbf1f9d071eaaf2023b38c9de3760a5028fce9a8c5
MD5 edc5c4d0079a0d924c46bf14e350ece8
BLAKE2b-256 0806a07afd740f97260e9944e67c4c46ebc8fc155acf3a5ce59659a435bf31aa

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