Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shir0kamii/tiny-thingy
JSON database with python object notation
https://github.com/shir0kamii/tiny-thingy
Last synced: 10 days ago
JSON representation
JSON database with python object notation
- Host: GitHub
- URL: https://github.com/shir0kamii/tiny-thingy
- Owner: Shir0kamii
- Created: 2018-05-14T23:35:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-16T16:47:26.000Z (over 6 years ago)
- Last Synced: 2024-11-29T16:53:54.541Z (26 days ago)
- Language: Python
- Homepage: https://tiny-thingy.readthedocs.io/
- Size: 19.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
Tiny-Thingy
###########Tiny-Thingy is a wrapper around TinyDB_ that makes it more Pythonic.
Status
======Tiny-Thingy is maintained, feel free to open issues or pull requests.
Install
=======.. code-block:: sh
$ pip install tiny-thingy
Examples
========Setup TinyDB_ database
~~~~~~~~~~~~~~~~~~~~~~.. code-block:: python
>>> from tiny_thingy import Thingy, use_database
>>> use_database("/some/json/file/serving/as/database.json")>>> class Task(Thingy):
... passThe *Task* class will represent the *task* table and instances of it are
documents in this table.Insert and find thingies
~~~~~~~~~~~~~~~~~~~~~~~~.. code-block:: python
>>> task = Task({"name": "work on tiny-thingy"}).save()
>>> Task.count()
1
>>> Task.find_one()
Task({'doc_id': 1, 'name': 'work on tiny-thingy'}).. _tinyDB: https://github.com/msiemens/tinydb