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.
Metadata
Release files for tinydb-viewer 0.2.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tinydb-viewer-0.2.7.tar.gz | 213.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tinydb_viewer-0.2.7-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 1.1 MB
Release files / tinydb-viewer-0.2.7.tar.gz
| Download URL | tinydb-viewer-0.2.7.tar.gz |
|---|---|
| Size | 213.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e63154d7f32ac41bd5ff259378ce62f0e3de22feedd35844f8bdab8c42793bc1
|
|
BLAKE2b-256 checksum How to use checksums |
5636dc0ffd5c9ce2e387a22b20ba4738cd310dd2cb4cc96f9d9bc6b353e1bddb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.11.5 CPython/3.7.0 Darwin/17.7.0
|
Release files / tinydb_viewer-0.2.7-py2.py3-none-any.whl
| Download URL | tinydb_viewer-0.2.7-py2.py3-none-any.whl |
|---|---|
| Size | 857.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
2987e8d800f5d21ee69bb70fb98f5a1873371c0be6891232fbbde0310ad375a1
|
|
BLAKE2b-256 checksum How to use checksums |
9c34ee9f46456573a4f777f60da4959265fa22909d4c160c538db650bb8a1644
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.11.5 CPython/3.7.0 Darwin/17.7.0
|