Skip to main content

tmjlite (Python)

Driver Python do TMJLite — banco de dados SQL embarcado, em um único arquivo .tmjp, com branches de dados git-native. O motor nativo (Rust) já vem dentro do wheel: nada para instalar além do pip.

pip install tmjlite

Plataformas: macOS (Apple Silicon), Linux x86-64, Windows x86-64 · Python ≥ 3.8.

import tmjlite

db = tmjlite.connect("app.tmjp")
db.execute("CREATE TABLE users (id PK, name TEXT, age INT);")
db.execute("INSERT INTO users (name, age) VALUES ('Alice', 30);")
for row in db.query("SELECT name, age FROM users WHERE age > 18;"):
    print(row["name"], row["age"])

with db.transaction():
    db.execute("INSERT INTO users (name, age) VALUES ('Bob', 25);")
db.close()

Branches — trabalhe numa cópia lógica e faça merge no arquivo principal, enquanto a aplicação continua enxergando o banco intocado:

b = tmjlite.open_branch("app.tmjp", "importacao")
b.execute("INSERT INTO users (name, age) VALUES ('Carol', 41);")
b.seal("primeira leva", author="thiago")   # commit na branch
applied = b.commit()                        # merge no app.tmjp
print(f"{applied} linha(s) aplicadas")

Vários processos ao mesmo tempo? tmjlite.connect_shadow(path) dá a cada worker uma sessão própria; commit() mergeia por chave primária.

Lotes e upsert (0.2.9+): prepared statements com ?, INSERT … ON CONFLICT e transação na conexão compartilhada — um commit só:

db = tmjlite.connect_shared("app.tmjp")
st = db.prepare("INSERT INTO rs (ns, k, samples) VALUES (?, ?, ?) "
                "ON CONFLICT (ns, k) DO UPDATE SET samples = excluded.samples;")
with db.transaction():
    for it in lote:
        st.execute([it.ns, it.k, it.samples])

Leitura grande sem estourar memória (0.3.1+): cursor em streaming direto do snapshot — uma linha por vez, qualquer N:

with db.cursor("SELECT samples, cpu_hist FROM rs WHERE ns = ?", ["ns3"]) as cur:
    for row in cur:
        total += row["samples"]

Licença MIT · TMJ Sistemas de Informação.

Metadata

Release files for tmjlite 0.3.6

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

Built distributions (wheels)

Table of built distributions (wheels) for tmjlite 0.3.6
File Interpreter ABI Platform Actions
tmjlite-0.3.6-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for tmjlite-0.3.6-py3-none-win_amd64.whl
tmjlite-0.3.6-py3-none-manylinux_2_34_x86_64.whl Python 3 none Linux glibc 2.34+ x86-64 Details for tmjlite-0.3.6-py3-none-manylinux_2_34_x86_64.whl
tmjlite-0.3.6-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for tmjlite-0.3.6-py3-none-macosx_11_0_arm64.whl

Total release size: 2.7 MB

Release files / tmjlite-0.3.6-py3-none-win_amd64.whl

Download URL tmjlite-0.3.6-py3-none-win_amd64.whl
Size 910.0 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f2b5a9a8cccce82c1618b4ffb9f18c228d63073179a479fc1e8b6b8c93e0f6d0
BLAKE2b-256 checksum
How to use checksums
32f0c2ff12d8a829617e59d38f89ef755e3090b30857f9f123240a4631fda34a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 5, 2026.

Transparency log

Release files / tmjlite-0.3.6-py3-none-manylinux_2_34_x86_64.whl

Download URL tmjlite-0.3.6-py3-none-manylinux_2_34_x86_64.whl
Size 953.3 kB
Tags Linux glibc 2.34+ x86-64 Python 3
SHA-256 checksum
How to use checksums
936ff45c4435455d96d0ef1e7e41f1f2e39cddfecaa6443eceb1918f8b2b1fde
BLAKE2b-256 checksum
How to use checksums
6ac6a9b8eec79e527124e4bd6c97389fb89f0dbf5175f204142015004ac1f8af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 5, 2026.

Transparency log

Release files / tmjlite-0.3.6-py3-none-macosx_11_0_arm64.whl

Download URL tmjlite-0.3.6-py3-none-macosx_11_0_arm64.whl
Size 815.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ae1791db37083d1b7174fc3bcf58e15587a29bcd1050d6922bb47bd9eacc7cbb
BLAKE2b-256 checksum
How to use checksums
4b2ccc4f7542073af73bffc40a3764a8954902c97a824b1ddb5ed12cb51f80ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 5, 2026.

Transparency log

Security for tmjlite 0.3.6

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 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for tmjlite-0.3.6-py3-none-win_amd64.whl

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 5, 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.

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