Name | pydbjson JSON |
Version |
0.0.5
JSON |
| download |
home_page | |
Summary | A small database using json |
upload_time | 2023-08-15 11:04:42 |
maintainer | |
docs_url | None |
author | Sampath |
requires_python | |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# PyDbJson
`pydbjson` is a simple Python library for managing JSON-based databases.
## Table of Contents
- [Installation](#installation)
- [Description](#Description)
- [Usage](#usage)
## Installation
You can install `pydbjson` using pip:
```python
pip install pydbjson
```
## Description
`pydbjson` provides a convenient way to interact with JSON-based databases in Python. It allows you to load data from a JSON file, insert, retrieve, delete, and find documents, and save the data back to the file.
## Usage
### Importing the library
```python
from pydbjson.pydbjson import pydbjson
```
### Creating an instance of pydbjson
```python
db = pydbjson("database.json")
```
Create an instance of the `pydbjson` class by providing the filename or path of the JSON database file.
### Inserting a document
```python
document = {"name": "John", "age": 30}
key = db.insert_one(document)
```
Insert a document into the database. The `insert_one` method returns the key of the inserted document.
### Find a document
```python
document = {"name": "John"}
found_document = db.find_one(document)
```
Find a document from the database based on the provided data.
### Deleting a document
```python
db.delete_one(found_document)
```
Delete a document from the database based on the data.
Raw data
{
"_id": null,
"home_page": "",
"name": "pydbjson",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Sampath",
"author_email": "gujarathisampath@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/f6/b1/17f0e80c5b04fbc6e0f32f2e5e222da9162d3805ae14398f8d4f0758732c/pydbjson-0.0.5.tar.gz",
"platform": null,
"description": "\r\n# PyDbJson\r\r\n\r\r\n`pydbjson` is a simple Python library for managing JSON-based databases.\r\r\n\r\r\n## Table of Contents\r\r\n\r\r\n- [Installation](#installation)\r\r\n- [Description](#Description)\r\r\n- [Usage](#usage)\r\r\n\r\r\n## Installation\r\r\n\r\r\nYou can install `pydbjson` using pip:\r\r\n```python\r\r\npip install pydbjson\r\r\n```\r\r\n\r\r\n\r\r\n## Description\r\r\n\r\r\n`pydbjson` provides a convenient way to interact with JSON-based databases in Python. It allows you to load data from a JSON file, insert, retrieve, delete, and find documents, and save the data back to the file.\r\r\n\r\r\n## Usage\r\r\n\r\r\n### Importing the library\r\r\n\r\r\n```python\r\r\nfrom pydbjson.pydbjson import pydbjson\r\r\n```\r\r\n\r\r\n### Creating an instance of pydbjson\r\r\n\r\r\n```python\r\r\ndb = pydbjson(\"database.json\")\r\r\n```\r\r\n\r\r\nCreate an instance of the `pydbjson` class by providing the filename or path of the JSON database file.\r\r\n\r\r\n### Inserting a document\r\r\n\r\r\n```python\r\r\ndocument = {\"name\": \"John\", \"age\": 30}\r\r\nkey = db.insert_one(document)\r\r\n```\r\r\n\r\r\nInsert a document into the database. The `insert_one` method returns the key of the inserted document.\r\r\n\r\r\n### Find a document\r\r\n\r\r\n```python\r\r\ndocument = {\"name\": \"John\"}\r\r\nfound_document = db.find_one(document)\r\r\n```\r\r\n\r\r\nFind a document from the database based on the provided data.\r\r\n\r\r\n### Deleting a document\r\r\n\r\r\n```python\r\r\ndb.delete_one(found_document)\r\r\n```\r\r\n\r\r\nDelete a document from the database based on the data.\r\n",
"bugtrack_url": null,
"license": "",
"summary": "A small database using json",
"version": "0.0.5",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f6b117f0e80c5b04fbc6e0f32f2e5e222da9162d3805ae14398f8d4f0758732c",
"md5": "85b780e97252368ba3f7b6e84cdd07cc",
"sha256": "ca225a2447dd453a7c3e6cd63b67931a1a6f72240679449b9cb60a2539294ad7"
},
"downloads": -1,
"filename": "pydbjson-0.0.5.tar.gz",
"has_sig": false,
"md5_digest": "85b780e97252368ba3f7b6e84cdd07cc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3338,
"upload_time": "2023-08-15T11:04:42",
"upload_time_iso_8601": "2023-08-15T11:04:42.818114Z",
"url": "https://files.pythonhosted.org/packages/f6/b1/17f0e80c5b04fbc6e0f32f2e5e222da9162d3805ae14398f8d4f0758732c/pydbjson-0.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-15 11:04:42",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pydbjson"
}