msiemens/tinydb is a Data project on GitHub, written primarily in Python. It has 7.6k stars. TinyDB is a lightweight document oriented database optimized for your happiness :)
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
TinyDB is a lightweight document oriented database optimized for your happiness :)
It's written in pure Python and has no external dependencies. The target are
small apps that would be blown away by a SQL-DB or an external database server.
TinyDB is:
tiny: The current source code has 1800 lines of code (with about 40%
documentation) and 1600 lines tests.
document oriented: Like MongoDB_, you can store any document
(represented as dict) in TinyDB.
optimized for your happiness: TinyDB is designed to be simple and
fun to use by providing a simple and clean API.
written in pure Python: TinyDB neither needs an external server (as
e.g. PyMongo <https://pymongo.readthedocs.io/en/stable/>_) nor any dependencies
from PyPI.
works on Python 3.8+ and PyPy3: TinyDB works on all modern versions of Python
and PyPy.
powerfully extensible: You can easily extend TinyDB by writing new
storages or modify the behaviour of storages with Middlewares.
100% test coverage: No explanation needed.
To dive straight into all the details, head over to the TinyDB docs <https://tinydb.readthedocs.io/>. You can also discuss everything related
to TinyDB like general development, extensions or showcase your TinyDB-based
projects on the discussion forum <http://forum.m-siemens.de/.>.
Supported Python Versions
TinyDB has been tested with Python 3.8 - 3.13 and PyPy3.
Project Status
This project is in maintenance mode. It has reached a mature, stable state
where significant new features or architectural changes are not planned. That
said, there will still be releases for bugfixes or features contributed by
the community. Read more about what this means in particular
here <https://github.com/msiemens/tinydb/discussions/572>_.
Example Code
.. code-block:: python
>>> from tinydb import TinyDB, Query
>>> db = TinyDB('/path/to/db.json')
>>> db.insert({'int': 1, 'char': 'a'})
>>> db.insert({'int': 1, 'char': 'b'})
Query Language
.. code-block:: python
>>> User = Query()
>>> # Search for a field value
>>> db.search(User.name == 'John')
[{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}]
>>> # Combine two queries with logical and
>>> db.search((User.name == 'John') & (User.age <= 30))
[{'name': 'John', 'age': 22}]
>>> # Combine two queries with logical or
>>> db.search((User.name == 'John') | (User.name == 'Bob'))
[{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}, {'name': 'Bob', 'age': 42}]
>>> # Negate a query with logical not
>>> db.search(~(User.name == 'John'))
[{'name': 'Megan', 'age': 27}, {'name': 'Bob', 'age': 42}]
>>> # Apply transformation to field with `map`
>>> db.search((User.age.map(lambda x: x + x) == 44))
>>> [{'name': 'John', 'age': 22}]
>>> # More possible comparisons: != < > <= >=
>>> # More possible checks: where(...).matches(regex), where(...).test(your_test_func)
>>> from tinydb.storages import JSONStorage
>>> from tinydb.middlewares import CachingMiddleware
>>> db = TinyDB('/path/to/db.json', storage=CachingMiddleware(JSONStorage))
Contributing
Whether reporting bugs, discussing improvements and new ideas or writing
extensions: Contributions to TinyDB are welcome! Here's how to get started:
Check for open issues or open a fresh issue to start a discussion around
a feature idea or a bug
Fork the repository <https://github.com/msiemens/tinydb/>_ on Github,
create a new branch off the master branch and start making your changes
(known as GitHub Flow <https://docs.github.com/en/get-started/using-github/github-flow>_)
Write a test which shows that the bug was fixed or that the feature works
as expected
Send a pull request and bug the maintainer until it gets merged and
published ☺
Yes — msiemens/tinydb ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/msiemens/tinydb.
What else is in the Data space?
msiemens/tinydb is tracked by TopGit under the Data category, alongside 5 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is msiemens/tinydb?
msiemens/tinydb (msiemens/tinydb) is a Python project on GitHub. From the project's own README: TinyDB is a lightweight document oriented database optimized for your happiness :)
What license does msiemens/tinydb use?
msiemens/tinydb is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where can I see msiemens/tinydb in action?
The project maintains a homepage at https://tinydb.readthedocs.org. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about msiemens/tinydb?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/msiemens/tinydb is the definitive source.
Why is msiemens/tinydb categorized under Data?
TopGit places msiemens/tinydb in the Data category based on its GitHub topics and description (tagged: "database", "documentdb", "json"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Want a second opinion on tinydb?
Ask an AI that can read this page — one click and you get its take on tinydb.