🔥 CFlareModel
CFlareModel is a lightweight, async-first ORM for Python inspired by Laravel's Eloquent. Built with Cloudflare D1 and Cloudflare Workers in mind, it offers a fluent API, relationship management, and automatic schema introspection — all in a minimal package.
⚠️ When using CFlareModel on Cloudflare Workers, you must vendor your Python dependencies. Follow this official guide: https://github.com/cloudflare/python-workers-examples/blob/main/06-vendoring/README.md
✨ Features
- ✅ Fluent, chainable query builder (
where(),with_(),limit()etc.) - ⚡ Async by default — built for modern Python 3.8+
- 🔁 Eager and lazy loading of relationships
- ☁️ D1-first, but pluggable with other SQL drivers
📦 Installation
pip install cflaremodel
🚀 Quickstart
from cflaremodel import Model
from cflaremodel import D1Driver
# Example User model
class User(Model):
table = "users"
fillable = ["name", "email"]
casts = {"created_at": "datetime"}
async def on_fetch(request, env):
# Setup driver
Model.set_driver(driver=D1Driver(env.DB))
# Query
users = await User.query().where("email", "like", "%@example.com").get()
🧱 Defining Relationships
class Post(Model):
table = "posts"
async def user(self):
return await self.belongs_to(User, "user_id")
class User(Model):
table = "users"
async def posts(self):
return await self.has_many(Post, "user_id")
📜 License
GNU GPLv3 © 2025 — avltree9798
Metadata
Release files for cflaremodel 0.1.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cflaremodel-0.1.15.tar.gz | 20.5 kB | Without provenance | Details for cflaremodel-0.1.15.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cflaremodel-0.1.15-py3-none-any.whl | Python 3 | none | any | Details for cflaremodel-0.1.15-py3-none-any.whl |
Total release size: 42.1 kB
Release files / cflaremodel-0.1.15.tar.gz
| Download URL | cflaremodel-0.1.15.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c74e8e992f58d5c1b7732ce669c52b3675f02016fe47ed4731db6b81b3728cac
|
|
BLAKE2b-256 checksum How to use checksums |
c2f08ea524ea3212031cfb2b773fe2621e08368780ae7020f95002efaaaa0d95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.12 Darwin/24.2.0
|
Release files / cflaremodel-0.1.15-py3-none-any.whl
| Download URL | cflaremodel-0.1.15-py3-none-any.whl |
|---|---|
| Size | 21.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b8baed5e20cc9949b217c4d3317bf2ba8c4835ca3ce3a4a8ce0806820456301
|
|
BLAKE2b-256 checksum How to use checksums |
2af1cfb7b9df18bc8547d04b9ba73441922533b5b870aef2a553abfdcfa43410
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.11.12 Darwin/24.2.0
|
Security for cflaremodel 0.1.15
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.