fsspec-db
Database tables and views as fsspec filesystems.
Overview
fsspec-db exposes SQL databases through familiar fsspec operations:
ls("/")lists schemas.ls("/main")lists tables and views.info("/main/users/columns/id")returns column metadata.cat_file("/main/users.parquet")materializes a table as bytes.query("SELECT ...")returns apyarrow.Table.open("/main/users.arrow", "wb")orput_file(..., "/main/users.parquet")inserts rows.
Native backends are registered as db+sqlite, db+postgresql / db+postgres, and
db+mysql. Python adapters provide db+duckdb, db+sqlalchemy, and db+odbc.
[!WARNING] Database overwrite writes replace table contents.
open(path, "wb"),pipe_file, and defaultput_filerun truncate semantics before inserting incoming rows. Use"ab"ormode="append"to append instead.
Install
pip install fsspec-db
Quick Start
import fsspec
import pyarrow as pa
import pyarrow.ipc as ipc
fs = fsspec.filesystem("db+sqlite", database="app.db")
print(fs.ls("/", detail=False))
print(fs.ls("/main", detail=False))
print(fs.info("/main/users"))
table = fs.query("SELECT id, name FROM users WHERE id > ?", [0])
with fs.open("/main/users.arrow", "ab") as file:
sink = pa.BufferOutputStream()
with ipc.new_stream(sink, pa.table({"name": ["ada"]}).schema) as writer:
writer.write_table(pa.table({"name": ["ada"]}))
file.write(sink.getvalue().to_pybytes())
Path Shape
/main
/main/users
/main/users/columns/id
/main/users/indexes/idx_users_name
/main/users.arrow
/main/users.parquet
/main/active_users/definition.sql
Documentation
- Browse a SQLite database: guided first use.
- Use SQLite, PostgreSQL or MySQL, or Python database adapters: task-oriented guides.
- Understand the filesystem mapping: architecture and boundaries.
- Look up paths, custom Python backend contracts, and the Python API: factual reference.
Metadata
Release files for fsspec-db 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fsspec_db-0.3.2.tar.gz | 7.4 MB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fsspec_db-0.3.2-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| fsspec_db-0.3.2-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| fsspec_db-0.3.2-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 27.4 MB
Release files / fsspec_db-0.3.2.tar.gz
| Download URL | fsspec_db-0.3.2.tar.gz |
|---|---|
| Size | 7.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bdff4710e855b07d1edd53cdd4ab05ae1e58c8ae8453ecdfcc2888d04963e505
|
|
BLAKE2b-256 checksum How to use checksums |
ffe8157c7ce2380fb9b1c5652adc601edd284463e4b00a2f2b9a8d54c8fcfe40
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / fsspec_db-0.3.2-cp310-abi3-win_amd64.whl
| Download URL | fsspec_db-0.3.2-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8384c4c93afb44ceb206ff5c38679033bb72de6b5ea8a70c1f30546134e0919d
|
|
BLAKE2b-256 checksum How to use checksums |
413121ff7794d6b9e4389f9a1cad55bdc771468b8ede8c8efd027e37bb76b034
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / fsspec_db-0.3.2-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | fsspec_db-0.3.2-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 7.4 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
31b694fe0c6c6de79ff42650da1c244316d4aa49435405bb1c4a0772a0a94eed
|
|
BLAKE2b-256 checksum How to use checksums |
47f89b54a0ea6e3bbddfbe3fd3a059ed03e00d54144f315073b00c643833df92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / fsspec_db-0.3.2-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | fsspec_db-0.3.2-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
8d240e8588665b99f1d58d748dd8baba64fb02a8c65a625985d84a20a6706a66
|
|
BLAKE2b-256 checksum How to use checksums |
97467c069e4eaef79a7dc546feb2220876492e81073c4a47040839c4e16aff6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|