EdgeSync
A lightweight Python library for reliable data delivery from edge applications to cloud services. EdgeSync provides persistent local queuing, store-and-forward synchronization, automatic retries, and recovery from network or application failures. Built for IoT devices, edge gateways, industrial systems, and any application operating with intermittent connectivity.
Why EdgeSync
Edge applications lose data for the same handful of reasons every time: the network drops, the cloud endpoint is temporarily unavailable, or the process crashes mid-send. EdgeSync solves this with a durable store-and-forward architecture:
- Data is persisted locally (SQLite) before anything is sent.
- A background worker attempts delivery to the configured destination.
- Acknowledged messages are removed from the local queue.
- Failed messages stay queued and are retried with backoff.
- Pending data survives process crashes and device restarts.
EdgeSync provides at-least-once delivery, not exactly-once — see docs/reliability.md for the exact guarantee and how to build idempotent consumers on top of it.
Install
pip install edgesync
Quickstart
import asyncio
from edgesync import EdgeSync
async def main():
async with EdgeSync(
database="edgesync.db",
endpoint="https://api.example.com/telemetry",
) as sync:
receipt = await sync.publish(
{
"device_id": "device-001",
"temperature": 28.5,
}
)
print(f"queued as {receipt.message_id}")
asyncio.run(main())
That's it: publish() durably persists the message and returns as soon as it's on disk. A
background worker delivers it, retrying with exponential backoff on failure, without the
caller needing to stay connected or wait for the network.
Usage with FastAPI, Flask, and plain asyncio
EdgeSync is async-native, so it's most at home in an asyncio app or an async framework like
FastAPI — start it once, publish from your handlers, close it on shutdown:
# FastAPI
@asynccontextmanager
async def lifespan(app: FastAPI):
await sync.start()
yield
await sync.close()
app = FastAPI(lifespan=lifespan)
@app.post("/telemetry")
async def telemetry(payload: dict):
receipt = await sync.publish(payload)
return {"message_id": receipt.message_id}
Flask is synchronous, so it needs a small bridge to run EdgeSync's event loop on a background
thread rather than spinning up a new loop per request. See
docs/integrations.md for the full FastAPI, Flask, and plain-asyncio
guide, including the ready-to-use Flask bridge.
Features
- Durable local queue — SQLite-backed, survives crashes and restarts.
- At-least-once delivery — messages are only removed once the destination acknowledges them.
- Automatic retries — configurable exponential backoff with jitter.
- Dead-letter queue — messages that exhaust retries or fail permanently are retained for inspection instead of being silently dropped.
- Multiple destinations — route different message types to different endpoints or transports.
- Pluggable transports — ships with an HTTP transport; implement
Transportfor anything else (MQTT, gRPC, a message broker, ...). - Bounded storage — configurable queue capacity with a choice of overflow policies.
- Async-native — built on
asyncioandhttpx.
Documentation
- Getting started
- Using EdgeSync with FastAPI, Flask, and plain asyncio
- Reliability & delivery guarantees
- Storage design
Development
uv sync
uv run pytest
uv run ruff check .
uv run mypy
See CONTRIBUTING.md for the full workflow.
License
MIT — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file edgesync-0.2.0.tar.gz.
File metadata
- Download URL: edgesync-0.2.0.tar.gz
- Upload date:
- Size: 93.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aef0ea9ab1017f6581495fc4aa0cd75757385570a9acaa1c15c0fd3a6a4a0061
|
|
| MD5 |
dd84e4bca1652cd839d8b8e87645f499
|
|
| BLAKE2b-256 |
0242f9f3ce3a573e119f39a4a94c57e7533d14abe9bf86e1ce8a33b73b2230b6
|
Provenance
The following attestation bundles were made for edgesync-0.2.0.tar.gz:
Publisher:
release.yml on adhuldas/EdgeSync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edgesync-0.2.0.tar.gz -
Subject digest:
aef0ea9ab1017f6581495fc4aa0cd75757385570a9acaa1c15c0fd3a6a4a0061 - Sigstore transparency entry: 2574648673
- Sigstore integration time:
-
Permalink:
adhuldas/EdgeSync@ac444a3cfc81c582711c45fa41767b67ef64689b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/adhuldas
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ac444a3cfc81c582711c45fa41767b67ef64689b -
Trigger Event:
push
-
Statement type:
File details
Details for the file edgesync-0.2.0-py3-none-any.whl.
File metadata
- Download URL: edgesync-0.2.0-py3-none-any.whl
- Upload date:
- Size: 33.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f2a43181b690556428b4d467c20847324ec182d0495038a71b0e27595001a68
|
|
| MD5 |
18a08d6f6ad44e0e5cd2ca058188e7fd
|
|
| BLAKE2b-256 |
7370325b24b661b5d4d8f1d7d06cdcf30a300dd3502bf0388b3838e9e4b6f5db
|
Provenance
The following attestation bundles were made for edgesync-0.2.0-py3-none-any.whl:
Publisher:
release.yml on adhuldas/EdgeSync
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
edgesync-0.2.0-py3-none-any.whl -
Subject digest:
6f2a43181b690556428b4d467c20847324ec182d0495038a71b0e27595001a68 - Sigstore transparency entry: 2574648696
- Sigstore integration time:
-
Permalink:
adhuldas/EdgeSync@ac444a3cfc81c582711c45fa41767b67ef64689b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/adhuldas
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ac444a3cfc81c582711c45fa41767b67ef64689b -
Trigger Event:
push
-
Statement type: