METADATA 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. Metadata-Version: 2.3
  2. Name: aiosqlite
  3. Version: 0.21.0
  4. Summary: asyncio bridge to the standard sqlite3 module
  5. Author-email: Amethyst Reese <amethyst@n7.gg>
  6. Requires-Python: >=3.9
  7. Description-Content-Type: text/x-rst
  8. Classifier: Development Status :: 5 - Production/Stable
  9. Classifier: Framework :: AsyncIO
  10. Classifier: Intended Audience :: Developers
  11. Classifier: License :: OSI Approved :: MIT License
  12. Classifier: Topic :: Software Development :: Libraries
  13. Requires-Dist: typing_extensions >= 4.0
  14. Requires-Dist: attribution==1.7.1 ; extra == "dev"
  15. Requires-Dist: black==24.3.0 ; extra == "dev"
  16. Requires-Dist: build>=1.2 ; extra == "dev"
  17. Requires-Dist: coverage[toml]==7.6.10 ; extra == "dev"
  18. Requires-Dist: flake8==7.0.0 ; extra == "dev"
  19. Requires-Dist: flake8-bugbear==24.12.12 ; extra == "dev"
  20. Requires-Dist: flit==3.10.1 ; extra == "dev"
  21. Requires-Dist: mypy==1.14.1 ; extra == "dev"
  22. Requires-Dist: ufmt==2.5.1 ; extra == "dev"
  23. Requires-Dist: usort==1.0.8.post1 ; extra == "dev"
  24. Requires-Dist: sphinx==8.1.3 ; extra == "docs"
  25. Requires-Dist: sphinx-mdinclude==0.6.1 ; extra == "docs"
  26. Project-URL: Documentation, https://aiosqlite.omnilib.dev
  27. Project-URL: Github, https://github.com/omnilib/aiosqlite
  28. Provides-Extra: dev
  29. Provides-Extra: docs
  30. aiosqlite\: Sqlite for AsyncIO
  31. ==============================
  32. .. image:: https://readthedocs.org/projects/aiosqlite/badge/?version=latest
  33. :target: https://aiosqlite.omnilib.dev/en/latest/?badge=latest
  34. :alt: Documentation Status
  35. .. image:: https://img.shields.io/pypi/v/aiosqlite.svg
  36. :target: https://pypi.org/project/aiosqlite
  37. :alt: PyPI Release
  38. .. image:: https://img.shields.io/badge/change-log-blue
  39. :target: https://github.com/omnilib/aiosqlite/blob/master/CHANGELOG.md
  40. :alt: Changelog
  41. .. image:: https://img.shields.io/pypi/l/aiosqlite.svg
  42. :target: https://github.com/omnilib/aiosqlite/blob/master/LICENSE
  43. :alt: MIT Licensed
  44. aiosqlite provides a friendly, async interface to sqlite databases.
  45. It replicates the standard ``sqlite3`` module, but with async versions
  46. of all the standard connection and cursor methods, plus context managers for
  47. automatically closing connections and cursors:
  48. .. code-block:: python
  49. async with aiosqlite.connect(...) as db:
  50. await db.execute("INSERT INTO some_table ...")
  51. await db.commit()
  52. async with db.execute("SELECT * FROM some_table") as cursor:
  53. async for row in cursor:
  54. ...
  55. It can also be used in the traditional, procedural manner:
  56. .. code-block:: python
  57. db = await aiosqlite.connect(...)
  58. cursor = await db.execute('SELECT * FROM some_table')
  59. row = await cursor.fetchone()
  60. rows = await cursor.fetchall()
  61. await cursor.close()
  62. await db.close()
  63. aiosqlite also replicates most of the advanced features of ``sqlite3``:
  64. .. code-block:: python
  65. async with aiosqlite.connect(...) as db:
  66. db.row_factory = aiosqlite.Row
  67. async with db.execute('SELECT * FROM some_table') as cursor:
  68. async for row in cursor:
  69. value = row['column']
  70. await db.execute('INSERT INTO foo some_table')
  71. assert db.total_changes > 0
  72. Install
  73. -------
  74. aiosqlite is compatible with Python 3.8 and newer.
  75. You can install it from PyPI:
  76. .. code-block:: console
  77. $ pip install aiosqlite
  78. Details
  79. -------
  80. aiosqlite allows interaction with SQLite databases on the main AsyncIO event
  81. loop without blocking execution of other coroutines while waiting for queries
  82. or data fetches. It does this by using a single, shared thread per connection.
  83. This thread executes all actions within a shared request queue to prevent
  84. overlapping actions.
  85. Connection objects are proxies to the real connections, contain the shared
  86. execution thread, and provide context managers to handle automatically closing
  87. connections. Cursors are similarly proxies to the real cursors, and provide
  88. async iterators to query results.
  89. License
  90. -------
  91. aiosqlite is copyright `Amethyst Reese <https://noswap.com>`_, and licensed under the
  92. MIT license. I am providing code in this repository to you under an open source
  93. license. This is my personal repository; the license you receive to my code
  94. is from me and not from my employer. See the `LICENSE`_ file for details.
  95. .. _LICENSE: https://github.com/omnilib/aiosqlite/blob/master/LICENSE