Skip to main content

refpot

RefPot — experimental alpha embedded database for Python

Part of ModePot.   Project website   Created by Tugrul Guner

A custom embedded database preview for Python.

RefPot is an experimental alpha: a native C++ redo-and-checkpoint engine with Python CRUD and explicit transactions. Install the latest published version with `python -m pip install refpot`. Package and platform qualification remain limited.

CI PyPI version Python 3.11 through 3.14 Experimental alpha MIT License Join the ModePot Discord GitHub stars

Quick start · Why RefPot · Package contract · Documentation · Deep reference · Examples · Agent skill · Community · Contributing

Planned RefPot architecture, not shipped: direct SQL and a Python ORM's structured operations share one execution core, validation, constraints, transaction guarantees, storage, and recovery

Why RefPot

RefPot is an early custom embedded database engine: a native C++ redo-and-checkpoint core exposed through the published fixed-schema Python Database / Row API. The separate native SQL preview (included in version 0.1.2; requires RefPot 0.1.2 or later) has optional bounded whole-model persistence and an explicitly selected, bounded read-only agent=True query-generation slice; neither changes the fixed-schema API/storage format. Agent mode requires configured trusted generator code and explicit schema-disclosure consent; it is not M2 completion or a semantic guarantee. See the SQL preview contract and its bounded evaluation evidence. ORM remains future design direction.

Quick start

Requires Python 3.11–3.14. Install the experimental alpha from PyPI:

python -m pip install refpot

Save this complete program as quickstart.py and run it with python quickstart.py:

from pathlib import Path
from tempfile import TemporaryDirectory

from refpot import Database, Row

with TemporaryDirectory(prefix="refpot-quickstart-") as directory:
    path = Path(directory) / "example.rp"  # Parent directory must already exist.
    with Database(path) as db:
        db.insert(1, 42, "answer")
        db.update(1, value=43)
        assert db.get(1) == Row(1, 43, "answer")
        with db.transaction():
            db.insert(2, 99)
        try:
            with db.transaction():
                db.update(1, value=100)
                raise RuntimeError("roll back this transaction")
        except RuntimeError:
            pass
        assert db.get(1) == Row(1, 43, "answer")
        db.delete(2)
        db.checkpoint()
    with Database(path) as db:
        assert db.get(1) == Row(1, 43, "answer")
        print(db.get(1))
python quickstart.py

The complete quick start demonstrates CRUD, transaction commit and rollback, checkpointing, and persistence after close/reopen. No output is prescribed; run it to see the actual Row representation. The same program is available as examples/quickstart.py.

Package contract

The database starts empty. Keys and integer values are signed 64-bit integers; text is UTF-8 limited to 31 encoded bytes. The database path names a file, not a directory, and its parent directory must already exist. One process exclusively owns each database; only its creating thread may use the handle.

The native engine uses versioned snapshots and a WAL. Snapshot and WAL recovery are each bounded to 64 MiB. Incomplete unacknowledged tails are discarded; complete transactions with both copies corrupt are rejected; uncertain writes poison the writer. These implementation details are not broad recovery qualification or a physical power-loss guarantee. Concurrent readers, multiwriter use, Windows and existing-format compatibility are unsupported. SQL requires version 0.1.2 or later; see the separate SQL preview with optional bounded persistence. ORM is not provided. See the full package contract and package recommendation.

Current package architecture

RefPot experimental alpha architecture: Python Database and Row use a native C++ engine; transaction changes are prepared, duplicated redo is synchronized, then prepared row effects are published without allocation; recovery replays validated row-local effects. Checkpoint snapshot sync, rename and directory sync precede log truncation. Qualification limits apply.

Open the full-size editable SVG · Detailed package contract

Transactions stage per-row changes without full-map copies. Commit preparation serializes the final change set before WAL I/O; only after both checksummed redo copies are synchronized does nonallocating publication update committed memory. Recovery validates/prepares a frame before applying row-local changes. These mechanisms preserve the API and storage framing, and do not by themselves establish package performance or broader qualification.

Build

Task-oriented guides are available for CRUD, transactions and rollback, persistence and checkpointing, errors and ownership, plus the runnable CRUD example, transaction example, and complete quick-start program.

Reference

The package contract documents the exact Database and Row API, validation, errors, ownership, capacity and unsupported behavior. Hosted guides: API reference · package reference.

The separate refpot.sql SQL preview documents source-preview maintained views, transaction-local propagation, deferred capacity/missing-reference assertions, and optional whole-model persistence. Database() remains volatile; Database(path, mode="overlay") opts into persistence. Runnable examples include the SQL preview, maintained SQL, whole-model persistence, and atomic maintained-definition replacement. These APIs are included in version 0.1.2; requires RefPot 0.1.2 or later. They do not alter from refpot import Database, Row.

Internals

The current package architecture records implementation behavior, not an independently qualified guarantee. Recovery internals explain file ownership, snapshot/WAL behavior and current limits. The separate planned execution diagram remains explicitly planned, not shipped.

Project

See project status, design direction, roadmap, contributing, and release policy.

Examples

The standalone CRUD example exercises insert, update, delete, context-managed close, and reopen. The transaction example demonstrates read-your-writes, commit, rollback, checkpoint, and reopen. Run them after installation:

python examples/crud.py
python examples/transactions.py

The full task-first docs live at RefPot documentation with package quick start, package reference, status and next steps, and design direction.

Retained benchmark findings

Audited random-update benchmark: both campaigns pass the scoped service/setup/p99 matrix; reopen with full-state validation loses every cell

Detailed findings, raw evidence and reproduction · Hosted historical benchmark report · Full-size chart · Next package recommendation

The historical findings are separate from package performance. The 3.04–5.95× result applies only to the historical update harness; its reopen result remains 16/16 losses. Package results are reported separately below.

Planned design direction

The preserved planned architecture visual remains a future SQL/ORM direction, not a depiction of the separate SQL preview. The SQL preview is a experimental preview; callers may use it in volatile mode or opt into bounded persistence, distinct from the fixed-schema API and file format. ORM is not implemented.

  • Engine first. Establish correctness and performance before building the ORM.
  • One semantic boundary. Direct operations must not bypass validation or constraints.
  • Explicit guarantees. Internal plan selection must not silently weaken durability, isolation, transaction boundaries, or result semantics.
  • Bounded maintenance. Include checkpointing, reclamation, and recovery debt in design and measurement, rather than hiding them outside favorable timings.
  • Simple public usage. Keep storage layout, encoding, and routing choices private unless a user genuinely needs an operational control.

Language, storage format, index structure, isolation model, and SQL compatibility scope remain decisions to earn through coherent experiments. A native-language rewrite alone is not a differentiator. No SQLite SQL, file-format, or C API compatibility is promised.

Package performance evidence

The actual-package campaign uses the public Python API and prepared SQLite over six workload/size cells. See the canonical measured results and reproduction guide. Provenance identifies locally built wheels carrying 0.1.1 metadata; these are neither published PyPI 0.1.1 wheels nor a 0.1.2 package artifact. The overall 2× SQLite target remains unmet: three of six measured cells are below 2× (both singleton/batch writes at 1,000 rows and singleton updates at 10,000 rows). Point reads exceed 2× in both sizes, and 10,000-row batch updates exceed 2×; these wins do not satisfy the complete target.

Community

Join the ModePot Discord for design discussions, implementation questions, early ideas, and database use cases across the family. Use GitHub Issues for scoped proposals and reproducible findings. The experimental alpha is not yet broadly qualified.

Contributing

See CONTRIBUTING.md for setup and contribution workflow. Repository-local coding-agent guidance is in AGENTS.md, with the installable RefPot database skill for consumer-facing API boundaries. The first useful work is helping define a small, testable engine contract and qualification matrix. Correctness cases, crash and I/O-failure scenarios, reproducible benchmark methods, and low-ceremony usage designs are more useful now than a broad speculative API.

Discuss substantial architecture or public-contract changes in GitHub Issues before implementing them. Do not introduce a SQLite wrapper as the engine, publish invented benchmark output, or present research prototypes as production capabilities.

The logo source is SVG; the README uses its PNG rendering.

License

RefPot is distributed under the MIT License.

See CHANGELOG.md for changes and release guidance for release policy.

Metadata

Release files for refpot 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for refpot 0.1.2
File Size Uploaded Provenance Actions
refpot-0.1.2.tar.gz 983.1 kB With provenance Details for refpot-0.1.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for refpot 0.1.2
File Actions
refpot-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for refpot-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
refpot-0.1.2-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details for refpot-0.1.2-cp314-cp314-macosx_11_0_arm64.whl
refpot-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for refpot-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
refpot-0.1.2-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for refpot-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
refpot-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for refpot-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
refpot-0.1.2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for refpot-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
refpot-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for refpot-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
refpot-0.1.2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for refpot-0.1.2-cp311-cp311-macosx_11_0_arm64.whl

Total release size: 4.7 MB

Release files / refpot-0.1.2.tar.gz

Download URL refpot-0.1.2.tar.gz
Size 983.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2ad84b4e5d15bdab03395bca745aafee2ba7c80b1e39376cd0ba395859ec3b88
BLAKE2b-256 checksum
How to use checksums
e7c2b59bfe0ce5452680ab58fa79a6c00274cd2f2495acddfbbfbbeec031f918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / refpot-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL refpot-0.1.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 563.3 kB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
82b72fe5a72f473a69a72d84641b0ebc958da2d6cbb7e3f42387074baf4479f6
BLAKE2b-256 checksum
How to use checksums
aa98746f4c4adc98890eedd8897c8d6cf74282c5ba96b9ecff430bc93224ed31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / refpot-0.1.2-cp314-cp314-macosx_11_0_arm64.whl

Download URL refpot-0.1.2-cp314-cp314-macosx_11_0_arm64.whl
Size 376.6 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c574f54e285a1e04b9099849fc9495d65547011f9c8948eb8172f703606eb32a
BLAKE2b-256 checksum
How to use checksums
e84d189fbb130afd53440ab28f98948a5368f3adb8e127efb174895ccdf3fa8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / refpot-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL refpot-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 563.1 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
67e09d7b4ee5f1764fb4d68b00eec3e2ff1182b0130d26cb4041c02f222fb597
BLAKE2b-256 checksum
How to use checksums
211e23fd0aff9b832772125f94aa8fe6939ed2537d43465508e6647c2b3a656b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / refpot-0.1.2-cp313-cp313-macosx_11_0_arm64.whl

Download URL refpot-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
Size 376.1 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e6f08f3ac494bf8141fc0f8c1a61d68d1ac12371e0eeea60d855bf21507e506a
BLAKE2b-256 checksum
How to use checksums
e2bafe54a70085153f32a04f216c0780399b7f870b80c606f0cf4e0ee3aee8e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / refpot-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL refpot-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 562.8 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
47aa81a8dfbabe1121fb8bf5d95cea5fc0dbcc6c8405720c7df21015b4ace11b
BLAKE2b-256 checksum
How to use checksums
6aa7f56ffb3e5214bccd8f316f81659334aa1ae7850a2c3b658c4e79e2b3d909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / refpot-0.1.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL refpot-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
Size 375.9 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
258c5234ac5800c4099fa975fee9412c823575533f932f995d4f3bfbcee58722
BLAKE2b-256 checksum
How to use checksums
2bc8f7b7f09d214a77b678631f3d67afe14ba5c3492e398dc5c5d3a3e533c62d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / refpot-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL refpot-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 560.6 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8e57872028591ef9cb39b729cef23eb932c064aaa3384fcc97f292e551dcdd3c
BLAKE2b-256 checksum
How to use checksums
4113ff45d1adabfaf0cdf9f9cfa3da7a73cda4db277fe511adba4531a529447a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / refpot-0.1.2-cp311-cp311-macosx_11_0_arm64.whl

Download URL refpot-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
Size 374.9 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ecd406c2d18dfae67876abc0902a568046749812085ef68c4025e3ed97ba0642
BLAKE2b-256 checksum
How to use checksums
b9295c432381b45c34482f9af366adad1002e4acd4aeaee8851dac62da44d7f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for refpot 0.1.2

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.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for refpot-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.2 This release

9 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page