{"id":13398522,"url":"https://github.com/msiemens/tinydb","last_synced_at":"2025-05-12T05:13:32.628Z","repository":{"id":9490015,"uuid":"11380094","full_name":"msiemens/tinydb","owner":"msiemens","description":"TinyDB is a lightweight document oriented database optimized for your happiness :)","archived":false,"fork":false,"pushed_at":"2025-03-06T04:13:38.000Z","size":1091,"stargazers_count":7108,"open_issues_count":22,"forks_count":565,"subscribers_count":106,"default_branch":"master","last_synced_at":"2025-05-12T02:40:21.492Z","etag":null,"topics":["database","documentdb","json","nosql","python"],"latest_commit_sha":null,"homepage":"https://tinydb.readthedocs.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msiemens.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-07-12T23:31:13.000Z","updated_at":"2025-05-11T12:29:17.000Z","dependencies_parsed_at":"2024-06-18T11:00:40.806Z","dependency_job_id":"71ce6a4d-83f2-4602-b822-fd410e724726","html_url":"https://github.com/msiemens/tinydb","commit_stats":{"total_commits":652,"total_committers":84,"mean_commits":7.761904761904762,"dds":0.5322085889570551,"last_synced_commit":"3dc6a952ef8700706909bf60a1b15cf21af47608"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msiemens%2Ftinydb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msiemens%2Ftinydb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msiemens%2Ftinydb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msiemens%2Ftinydb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msiemens","download_url":"https://codeload.github.com/msiemens/tinydb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672637,"owners_count":21945477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","documentdb","json","nosql","python"],"created_at":"2024-07-30T19:00:27.938Z","updated_at":"2025-05-12T05:13:32.605Z","avatar_url":"https://github.com/msiemens.png","language":"Python","readme":".. image:: https://raw.githubusercontent.com/msiemens/tinydb/master/artwork/logo.png\n    :height: 150px\n\n|Build Status| |Coverage| |Version|\n\nQuick Links\n***********\n\n- `Example Code`_\n- `Supported Python Versions`_\n- `Documentation \u003chttp://tinydb.readthedocs.org/\u003e`_\n- `Changelog \u003chttps://tinydb.readthedocs.io/en/latest/changelog.html\u003e`_\n- `Extensions \u003chttps://tinydb.readthedocs.io/en/latest/extensions.html\u003e`_\n- `Contributing`_\n\nIntroduction\n************\n\nTinyDB is a lightweight document oriented database optimized for your happiness :)\nIt's written in pure Python and has no external dependencies. The target are\nsmall apps that would be blown away by a SQL-DB or an external database server.\n\nTinyDB is:\n\n- **tiny:** The current source code has 1800 lines of code (with about 40%\n  documentation) and 1600 lines tests.\n\n- **document oriented:** Like MongoDB_, you can store any document\n  (represented as ``dict``) in TinyDB.\n\n- **optimized for your happiness:** TinyDB is designed to be simple and\n  fun to use by providing a simple and clean API.\n\n- **written in pure Python:** TinyDB neither needs an external server (as\n  e.g. `PyMongo \u003chttps://pymongo.readthedocs.io/en/stable/\u003e`_) nor any dependencies\n  from PyPI.\n\n- **works on Python 3.8+ and PyPy3:** TinyDB works on all modern versions of Python\n  and PyPy.\n\n- **powerfully extensible:** You can easily extend TinyDB by writing new\n  storages or modify the behaviour of storages with Middlewares.\n\n- **100% test coverage:** No explanation needed.\n\nTo dive straight into all the details, head over to the `TinyDB docs\n\u003chttps://tinydb.readthedocs.io/\u003e`_. You can also discuss everything related\nto TinyDB like general development, extensions or showcase your TinyDB-based\nprojects on the `discussion forum \u003chttp://forum.m-siemens.de/.\u003e`_.\n\nSupported Python Versions\n*************************\n\nTinyDB has been tested with Python 3.8 - 3.13 and PyPy3.\n\nProject Status\n**************\n\nThis project is in maintenance mode. It has reached a mature, stable state\nwhere significant new features or architectural changes are not planned. That\nsaid, there will still be releases for bugfixes or features contributed by\nthe community. Read more about what this means in particular\n`here \u003chttps://github.com/msiemens/tinydb/discussions/572\u003e`_.\n\nExample Code\n************\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from tinydb import TinyDB, Query\n    \u003e\u003e\u003e db = TinyDB('/path/to/db.json')\n    \u003e\u003e\u003e db.insert({'int': 1, 'char': 'a'})\n    \u003e\u003e\u003e db.insert({'int': 1, 'char': 'b'})\n\nQuery Language\n==============\n\n.. code-block:: python\n\n    \u003e\u003e\u003e User = Query()\n    \u003e\u003e\u003e # Search for a field value\n    \u003e\u003e\u003e db.search(User.name == 'John')\n    [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}]\n\n    \u003e\u003e\u003e # Combine two queries with logical and\n    \u003e\u003e\u003e db.search((User.name == 'John') \u0026 (User.age \u003c= 30))\n    [{'name': 'John', 'age': 22}]\n\n    \u003e\u003e\u003e # Combine two queries with logical or\n    \u003e\u003e\u003e db.search((User.name == 'John') | (User.name == 'Bob'))\n    [{'name': 'John', 'age': 22}, {'name': 'John', 'age': 37}, {'name': 'Bob', 'age': 42}]\n\n    \u003e\u003e\u003e # Negate a query with logical not\n    \u003e\u003e\u003e db.search(~(User.name == 'John'))\n    [{'name': 'Megan', 'age': 27}, {'name': 'Bob', 'age': 42}]\n\n    \u003e\u003e\u003e # Apply transformation to field with `map`\n    \u003e\u003e\u003e db.search((User.age.map(lambda x: x + x) == 44))\n    \u003e\u003e\u003e [{'name': 'John', 'age': 22}]\n\n    \u003e\u003e\u003e # More possible comparisons:  !=  \u003c  \u003e  \u003c=  \u003e=\n    \u003e\u003e\u003e # More possible checks: where(...).matches(regex), where(...).test(your_test_func)\n\nTables\n======\n\n.. code-block:: python\n\n    \u003e\u003e\u003e table = db.table('name')\n    \u003e\u003e\u003e table.insert({'value': True})\n    \u003e\u003e\u003e table.all()\n    [{'value': True}]\n\nUsing Middlewares\n=================\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from tinydb.storages import JSONStorage\n    \u003e\u003e\u003e from tinydb.middlewares import CachingMiddleware\n    \u003e\u003e\u003e db = TinyDB('/path/to/db.json', storage=CachingMiddleware(JSONStorage))\n\n\nContributing\n************\n\nWhether reporting bugs, discussing improvements and new ideas or writing\nextensions: Contributions to TinyDB are welcome! Here's how to get started:\n\n1. Check for open issues or open a fresh issue to start a discussion around\n   a feature idea or a bug\n2. Fork `the repository \u003chttps://github.com/msiemens/tinydb/\u003e`_ on Github,\n   create a new branch off the `master` branch and start making your changes\n   (known as `GitHub Flow \u003chttps://guides.github.com/introduction/flow/index.html\u003e`_)\n3. Write a test which shows that the bug was fixed or that the feature works\n   as expected\n4. Send a pull request and bug the maintainer until it gets merged and\n   published ☺\n\n.. |Build Status| image:: https://img.shields.io/azure-devops/build/msiemens/3e5baa75-12ec-43ac-9728-89823ee8c7e2/2.svg?style=flat-square\n   :target: https://dev.azure.com/msiemens/github/_build?definitionId=2\n.. |Coverage| image:: http://img.shields.io/coveralls/msiemens/tinydb.svg?style=flat-square\n   :target: https://coveralls.io/r/msiemens/tinydb\n.. |Version| image:: http://img.shields.io/pypi/v/tinydb.svg?style=flat-square\n   :target: https://pypi.python.org/pypi/tinydb/\n.. _Buzhug: http://buzhug.sourceforge.net/\n.. _CodernityDB: https://github.com/perchouli/codernitydb\n.. _MongoDB: http://mongodb.org/\n","funding_links":[],"categories":["Python","Database","资源列表","Uncategorized","Databases","Data Management \u0026 Processing","数据库","数据容器和结构","Data Containers \u0026 Dataframes","Database [🔝](#readme)","📚 فهرست","Awesome Python"],"sub_categories":["数据库","Uncategorized","NoSQL, Document Databases","Database \u0026 Cloud Management","دیتابیس","Database"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsiemens%2Ftinydb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsiemens%2Ftinydb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsiemens%2Ftinydb/lists"}