View records generated from TinyDB and alike (e.g. list of dictionaries.)
Project description
tinydb-viewer
View records generated from TinyDB and alike (e.g. list of dictionaries.)
Installation
Method 1:
$ pip install tinydb-viewer
Method 2:
- Clone the project from GitHub
- Get poetry and
poetry install tinydb-viewer --path PATH/TO/TINYDB/VIEWER
Usage
Run a server initiation script first. This will allow you to edit the data as well.
from tinydb_viewer import TinyDB
TinyDB('db.json').runserver()
Then, in IPython or in Jupyter Notebook,
>>> from tinydb_viewer import TinyDB
>>> tdb = TinyDB('db.json')
>>> tdb.search(tdb.query['foo'] == 'bar', sort_func=lambda x: x['baz'])
>>> tdb.view()
'The first page is shown.'
>>> tdb.view(-1)
'The last page is shown.'
>>> tdb.previous()
'The previous page (i-1) is shown.'
>>> tdb.next()
'The next page (i+1) is shown.'
Bonus
I extended TinyDB a little. My TinyDB is 'ensure_ascii' = False
by default, so that the file is a little smaller.
Also, it will use tinydb-constraint by default, if it is installed.
Screenshots
Related projects
- tinydb-constraint - Apply constraints before inserting and updating TinyDB records.
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
tinydb-viewer-0.2.7.tar.gz
(213.5 kB
view details)
Built Distribution
File details
Details for the file tinydb-viewer-0.2.7.tar.gz
.
File metadata
- Download URL: tinydb-viewer-0.2.7.tar.gz
- Upload date:
- Size: 213.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.11.5 CPython/3.7.0 Darwin/17.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e63154d7f32ac41bd5ff259378ce62f0e3de22feedd35844f8bdab8c42793bc1 |
|
MD5 | 229f129f8106b59732eed6afd61e851a |
|
BLAKE2b-256 | 5636dc0ffd5c9ce2e387a22b20ba4738cd310dd2cb4cc96f9d9bc6b353e1bddb |
File details
Details for the file tinydb_viewer-0.2.7-py2.py3-none-any.whl
.
File metadata
- Download URL: tinydb_viewer-0.2.7-py2.py3-none-any.whl
- Upload date:
- Size: 857.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.11.5 CPython/3.7.0 Darwin/17.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2987e8d800f5d21ee69bb70fb98f5a1873371c0be6891232fbbde0310ad375a1 |
|
MD5 | 9d0f8903dbb7d268e277c779d21205e0 |
|
BLAKE2b-256 | 9c34ee9f46456573a4f777f60da4959265fa22909d4c160c538db650bb8a1644 |