All Projects → msiemens → Tinydb

msiemens / Tinydb

Licence: mit
TinyDB is a lightweight document oriented database optimized for your happiness :)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Tinydb

Sleekdb
Pure PHP NoSQL database with no dependency. Flat file, JSON based document database.
Stars: ✭ 450 (-90.45%)
Mutual labels:  json, database, nosql
Ejdb
🏂 EJDB 2.0 — Embeddable JSON Database engine C library. Simple XPath like query language (JQL). Websockets / Android / iOS / React Native / Flutter / Java / Dart / Node.js bindings. Docker image.
Stars: ✭ 1,187 (-74.81%)
Mutual labels:  json, database, nosql
Nano Sql
Universal database layer for the client, server & mobile devices. It's like Lego for databases.
Stars: ✭ 717 (-84.79%)
Mutual labels:  json, database, nosql
Summitdb
In-memory NoSQL database with ACID transactions, Raft consensus, and Redis API
Stars: ✭ 1,295 (-72.52%)
Mutual labels:  json, database, nosql
Java Client Api
Java client for the MarkLogic enterprise NoSQL database
Stars: ✭ 52 (-98.9%)
Mutual labels:  json, database, nosql
Unqlite
An Embedded NoSQL, Transactional Database Engine
Stars: ✭ 1,583 (-66.41%)
Mutual labels:  json, database, nosql
Anime Offline Database
Updated every week: A JSON based offline anime database containing the most important meta data as well as cross references to various anime sites such as MAL, ANIDB, ANILIST, KITSU and more...
Stars: ✭ 292 (-93.8%)
Mutual labels:  json, database
Concourse
Distributed database warehouse for transactions, search and analytics across time.
Stars: ✭ 310 (-93.42%)
Mutual labels:  database, nosql
Bitnami Docker Redis
Bitnami Redis Docker Image
Stars: ✭ 317 (-93.27%)
Mutual labels:  database, nosql
Nodb
NoDB isn't a database.. but it sort of looks like one.
Stars: ✭ 353 (-92.51%)
Mutual labels:  json, nosql
Cosmos.Identity
A Cosmos storage provider for ASP.NET Core Identity.
Stars: ✭ 26 (-99.45%)
Mutual labels:  nosql, documentdb
Deta database
Plsql Database数据库
Stars: ✭ 321 (-93.19%)
Mutual labels:  json, database
5e Database
Database for the D&D 5th Edition API
Stars: ✭ 354 (-92.49%)
Mutual labels:  json, database
Inquiry Deprecated
[DEPRECATED]: Prefer Room by Google, or SQLDelight by Square.
Stars: ✭ 264 (-94.4%)
Mutual labels:  database, nosql
Bedquilt Core
A JSON document store on PostgreSQL
Stars: ✭ 256 (-94.57%)
Mutual labels:  database, nosql
Node Json Db
A simple "database" that use JSON file for Node.JS.
Stars: ✭ 314 (-93.34%)
Mutual labels:  json, database
Lazer Database
PHP flat file database to store data with JSON
Stars: ✭ 254 (-94.61%)
Mutual labels:  json, database
Kache
A simple in memory cache written using go
Stars: ✭ 349 (-92.59%)
Mutual labels:  database, nosql
Dbreeze
C# .NET MONO NOSQL ( key value store embedded ) ACID multi-paradigm database management system.
Stars: ✭ 383 (-91.87%)
Mutual labels:  database, nosql
Mongo
The MongoDB Database
Stars: ✭ 20,883 (+343.09%)
Mutual labels:  database, nosql

https://raw.githubusercontent.com/msiemens/tinydb/master/artwork/logo.png

Build Status Coverage Version

Quick Links

Introduction

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) nor any dependencies from PyPI.
  • works on Python 3.6+ 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. You can also discuss everything related to TinyDB like general development, extensions or showcase your TinyDB-based projects on the discussion forum.

Supported Python Versions

TinyDB has been tested with Python 3.6 - 3.10 and PyPy3.

Example Code

>>> 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

>>> 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}]

>>> # More possible comparisons:  !=  <  >  <=  >=
>>> # More possible checks: where(...).matches(regex), where(...).test(your_test_func)

Tables

>>> table = db.table('name')
>>> table.insert({'value': True})
>>> table.all()
[{'value': True}]

Using Middlewares

>>> 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:

  1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug
  2. Fork the repository on Github, create a new branch off the master branch and start making your changes (known as GitHub Flow)
  3. Write a test which shows that the bug was fixed or that the feature works as expected
  4. Send a pull request and bug the maintainer until it gets merged and published
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].