https://github.com/hui-z/forgivedb
Coding should be simple and fun. Certainly I will choose ForgiveDB.
https://github.com/hui-z/forgivedb
database json-database python
Last synced: 10 months ago
JSON representation
Coding should be simple and fun. Certainly I will choose ForgiveDB.
- Host: GitHub
- URL: https://github.com/hui-z/forgivedb
- Owner: hui-z
- License: mit
- Created: 2017-07-04T11:57:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-02T02:21:56.000Z (almost 6 years ago)
- Last Synced: 2025-04-09T16:49:29.496Z (10 months ago)
- Topics: database, json-database, python
- Language: Python
- Homepage:
- Size: 112 KB
- Stars: 66
- Watchers: 6
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.cn.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://pypi.python.org/pypi/forgive)
[](https://pyup.io/repos/github/hui-z/ForgiveDB/)
[](https://travis-ci.org/hui-z/ForgiveDB)
[](http://codecov.io/github/hui-z/ForgiveDB?branch=master)
[](https://landscape.io/github/hui-z/ForgiveDB/master)
[](https://github.com/hui-z/ForgiveDB/blob/master/LICENSE)
[](https://github.com/hui-z/ForgiveDB/blob/master/README.md)
* 没人帮你合 Pull Request 怎么办 ?
* 第三方库老是要升依赖版本怎么办 ?
* 老是有新的需求怎么办 ?

[lowdb](https://github.com/typicode/lowdb) 是 JS 写的,
[tinydb](http://tinydb.readthedocs.io/en/latest/intro.html) 也不够小。
[ForgiveDB](https://github.com/hui-z/ForgiveDB) 才是你的归宿。
ForgiveDB 是一个无依赖的微型数据库,
支持内存存储和 JSON 文件格式存储。
## 安装
使用 [pip](https://pip.pypa.io/) 一键安装,这可是个好东西。
``` python
pip install forgive
```
## 用法
代码就是最好的文档
(其实是因为我们文档写的烂)
``` python
from forgive import ForgiveDB
file_db = ForgiveDB('/some/path')
# file_db = ForgiveDB(r'C:\\some\\path') # windows
file_db.set('key', 'value')
value = file_db.get('key')
default_value = file_db.get('no-such-key', 'default-value')
# Or in memory
memory_db = ForgiveDB()
memory_db.set(ForgiveDB, 'simple and interesting')
memory_db.get(ForgiveDB) # simple and interesting
```