msiemens/tinydb
msiemens/tinydb has 7,580 GitHub stars and 648 forks. GitHot measured +1 stars in 24 hours and +4 in 7 days. Last checked 2026-11-11 02:14 UTC. Last push 2026-10-26.
TinyDB is a lightweight document oriented database optimized for your happiness :)
측정된 스타 증가
- in 24h
- +1
- in 7 days
- +4
- in 15 days
- 업데이트 지연
- in 1 month
- 업데이트 지연
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original.. image:: https://raw.githubusercontent.com/msiemens/tinydb/master/artwork/logo.png :height: 150px
|Build Status| |Coverage| |Version|
Quick Links
Example Code_Supported Python Versions_Documentation <http://tinydb.readthedocs.org/>_Changelog <https://tinydb.readthedocs.io/en/latest/changelog.html>_Extensions <https://tinydb.readthedocs.io/en/latest/extensions.html>_Contributing_
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 <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)
Tables
.. code-block:: python
>>> table = db.table('name')
>>> table.insert({'value': True})
>>> table.all()
[{'value': True}]
Using Middlewares
.. code-block:: python
>>> 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 themasterbranch and start making your changes (known asGitHub 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 ☺
.. |Build Status| image:: https://img.shields.io/azure-devops/build/msiemens/3e5baa75-12ec-43ac-9728-89823ee8c7e2/2.svg?style=flat-square :target: https://dev.azure.com/msiemens/github/_build?definitionId=2 .. |Coverage| image:: http://img.shields.io/coveralls/msiemens/tinydb.svg?style=flat-square :target: https://coveralls.io/r/msiemens/tinydb .. |Version| image:: http://img.shields.io/pypi/v/tinydb.svg?style=flat-square :target: https://pypi.python.org/pypi/tinydb/ .. _Buzhug: http://buzhug.sourceforge.net/ .. _CodernityDB: https://github.com/perchouli/codernitydb .. _MongoDB: http://mongodb.org/
관련 프로젝트 살펴보기
Asabeneh/30-Days-Of-Python
30 Days of Python 프로그래밍 챌린지는 Python 프로그래밍 언어를 30일 동안 배우기 위한 단계별 가이드입니다. 이 챌린지는 100일 이상 걸릴 수 있습니다. 자신의 속도에 맞춰 진행하세요. 다음 동영상도 도움이 될 수 있습니다: https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,560 스타grafana/grafana
개방적이고 조합 가능한 옵저버빌리티 및 데이터 시각화 플랫폼입니다. Prometheus, Loki, Elasticsearch, InfluxDB, Postgres 등 여러 소스의 메트릭, 로그, 트레이스를 시각화합니다.
77,830 스타redis/redis
실시간 데이터 기반 애플리케이션을 구축하는 개발자에게 Redis는 가장 선호되고, 가장 빠르며, 기능이 가장 풍부한 캐시, 데이터 구조 서버이자 문서 및 벡터 쿼리 엔진입니다.
77,395 스타apache/superset
Apache Superset는 데이터 시각화 및 데이터 탐색 플랫폼입니다.
75,473 스타