New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

DBJSONS

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

DBJSONS

dbjson is a module that can help you use json as database

  • 1.0.2
  • PyPI
  • Socket score

Maintainers
1

dbjson

Get started

things that you need:


  • Python

    • of course you need it

Installation


$- pip install dbjson

What is dbjson?


dbjson is Python module

Everyone say JSON can't be used as database but I don't think JSON can't be used as database

With this module you can use JSON as database since JSON is just Python dictionary

Example Code


Creating json file

import dbjson as db

db.new('database')

Add a data inside our database

db.data().new('database','data1','value1')

If you open the JSON file you can see that JSON file will automatically update

//Before
{}
//After
{"data1": "value1"}

How about we want to edit the data?

Well,you can use rewrite method

db.data().rewrite('database','data1','value2')

check the JSON file

//Before
{"data1": "value1"}
//After
{"data1": "value2"}

To remove data we use remove method

db.data().remove('database','data1')
//Before
{"data1": "value2"}
//After
{}

To remove all the data in our database,we use end method

db.data().end('database')

Github

Discord Server

License


MIT License


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


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