A simple asyncio wrapper for Cloudflare D1's REST API
Find a file
Laptop Kitty 933c13f9c4
All checks were successful
Upload Python Package / deploy (release) Successful in 46s
Change readme after name change
2025-10-17 20:17:15 -07:00
.forgejo/workflows Init 2025-10-17 13:13:34 -07:00
aiocfd1 Change name 2025-10-17 20:16:22 -07:00
.gitignore Initial commit 2025-10-17 13:11:40 -07:00
LICENSE Initial commit 2025-10-17 13:11:40 -07:00
pyproject.toml Change name 2025-10-17 20:16:22 -07:00
README.md Change readme after name change 2025-10-17 20:17:15 -07:00

AIO CF D1

A simple asyncio wrapper for Cloudflare D1's REST API. It does nothing but query SQL.

Install

pip install aiocfd1

Usage

from aiocfd1 import D1
import asyncio
# Get these credentials from cloudflare dashboard!
db = D1("account id", "token", "database id")
async def test():
    result = await db.execute("SELECT * FROM table; SELECT * FROM table WHERE something = 'test';")
    print(result)

asyncio.run(test())

Output

[
    [
        {
            "something": "lorem",
            "foo": "bar"
        },
        {
            "something": "test",
            "foo": "baz"
        },
        {
            "something": "abc",
            "foo": "qux"
        }
    ],
    [
        {
            "something": "test",
            "foo": "baz"
        }
    ]
]