Skip to main content

Python bindings for SQLiteFS - Simulate a local filesystem inside a SQLite database

Project description

PySQLiteFS Bindings

This project provides bindigs for sqlitefs project. You can create a file system inside sqlite database. With key you can encript the whole database including sqlite headers.

Supported functions

  • pwd - print working directory
  • mkdir - create a new folder
  • cd - change wirking directory
  • ls - list files and folders
  • cp - copy file. (Works with files only)
  • mv - move node (file or folder)
  • rm - remove node
  • write - write file to the db
  • read - read file from the db
  • path - get full path for the sqlitefs node
  • stats - recursively gets the count of all files in a directory, indicating the total size in compressed and raw form.

Read/write algorithms

To add your own modifications check Custom save and load functions section below. You can modify your data as you want, for example you can encrypt/compress and decrypt/decompress in save and load respectively.

Examples

A simple example

from pysqlitefs import SQLiteFS

fs = SQLiteFS("test.db", "secret")
raw_content = "Raw data content"
fs.write("file.txt", raw_content.encode())
content = fs.read("file.txt")
print(f"Content of file.txt: {content}")
assert content.decode() == raw_content, "Content mismatch after save and load"

Custom save and load functions

NOTE: you can specify only one of them if you want to read or write only. So you can write data at your own pc with registered write function and send file with load function only. In this case user can read the data, but cannot modify it (only remove).

from pysqlitefs import SQLiteFS


def save(data: bytes) -> bytes:
    return data[-1::-1]


def load(data: bytes) -> bytes:
    return data[-1::-1]


with open("file.dat", "rb") as f:
    raw_content = f.read()

fs = SQLiteFS("test.db")
fs.register_save_func("reverse", save)
fs.register_load_func("reverse", load)

for name in fs.getSaveFuncs():
    print(f"Test function: {name}")
    fs.write(f"{name}.dat", raw_content, name)
    content = fs.read(f"{name}.dat")
    assert content == raw_content, "Content mismatch after save and load"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pysqlitefs-1.6.1-cp314-cp314-win_amd64.whl (1.4 MB view details)

Uploaded CPython 3.14Windows x86-64

pysqlitefs-1.6.1-cp314-cp314-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.1-cp314-cp314-manylinux_2_36_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.36+ x86-64

pysqlitefs-1.6.1-cp313-cp313-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.13Windows x86-64

pysqlitefs-1.6.1-cp313-cp313-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.1-cp313-cp313-manylinux_2_36_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.36+ x86-64

pysqlitefs-1.6.1-cp312-cp312-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.12Windows x86-64

pysqlitefs-1.6.1-cp312-cp312-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.1-cp312-cp312-manylinux_2_36_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.36+ x86-64

pysqlitefs-1.6.1-cp311-cp311-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.11Windows x86-64

pysqlitefs-1.6.1-cp311-cp311-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.1-cp311-cp311-manylinux_2_36_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.36+ x86-64

pysqlitefs-1.6.1-cp310-cp310-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.10Windows x86-64

pysqlitefs-1.6.1-cp310-cp310-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.1-cp310-cp310-manylinux_2_36_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.36+ x86-64

File details

Details for the file pysqlitefs-1.6.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pysqlitefs-1.6.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pysqlitefs-1.6.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 98c2fa7e61d2271ac69f3ffed968799cba983f55d73e35296647ea3e2e756b2b
MD5 c363c07ad0876c3531475a0653b5f81c
BLAKE2b-256 a7c667424502c68a5a1f6d79046116a682b203c5398d69575a63882cab41c807

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6957751eb2b2c6e94cb6eee187e0ddb717e854daa48fc2284edbd871f311223c
MD5 fbcdf11975c561b5c96096c21cc0f389
BLAKE2b-256 c02803998bbd94f0c7893f35b9dc8235a872f160047244fa77cfcdc8470fe6f7

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp314-cp314-manylinux_2_36_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp314-cp314-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 d34c401e2b496a6162ecb309c57d169743207d96694519269f11abf3ae41cb7f
MD5 f8c83aaa223bf960dc55e1ece3871946
BLAKE2b-256 ea2b6ac6a071d25fe919e1ade2d866facab9760b432075401bf0d5770a15d8d8

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pysqlitefs-1.6.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pysqlitefs-1.6.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ed470e3c22d35261e365ed13298c3544196a9673f372b6962e047c4d725da2a6
MD5 05f90cf7c77d2745caee5756e3e05c49
BLAKE2b-256 19dc320c2d77c4fb4cf34625bef35d732f2de2d00240a6eef0f416e13f05516f

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 25d16e51be2a21f6892cdbf7a9925666611a31dd86b608654a18e25772c12994
MD5 390f099612c1f01bad071e355c6d1ec7
BLAKE2b-256 8a7d16f772f267b7e6894de025e59be128e5498fc7c4eafe8ffb12074b7336d5

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp313-cp313-manylinux_2_36_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp313-cp313-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 6ba9a7b31cd1e2e205c51eef99044bb09f7288d68b7f5ec4957744b76b014aa8
MD5 94ab255b66b5010f02cb8360240ee6d3
BLAKE2b-256 215b45aac3ffebae134b3cecb747b9e85bc896259fd49dbcd9d727fc70d20a8a

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pysqlitefs-1.6.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pysqlitefs-1.6.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 20db052d82546ea6a65249459ad2adbe2ac30d3220c2e709a6d4390556903bfe
MD5 f07f9ad4281ee92b0f600c57f0582208
BLAKE2b-256 080d06f86c28a943c18379f675915729249e162b2c4b18d102dcd5ceec944764

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 db5c7ca45b6d07240c6e144447943a1162208017ce66dc9fb96d423dacc80394
MD5 bf42786134f899c026e65c101f6bb42c
BLAKE2b-256 9be09c1fbc1bc1d9e9e26dbcf2438d14663b194e3ba11d3f65569d4712c427d8

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp312-cp312-manylinux_2_36_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp312-cp312-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 dcfec6b2b20d6be7790e56f59dec425ec42037887d93e7cf6535a27ef8fb1967
MD5 761013ff8fe5e437523f462656ea2a8e
BLAKE2b-256 3ad9a897ca447b7dc4156e44d1b2c852429b6e5f71c1b2e9dfb5e775e7ec8d65

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pysqlitefs-1.6.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pysqlitefs-1.6.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4046286fb1b5d70709389d9bbc8c9394af777070d399019b628d7b9c6ce2b2f6
MD5 c361a18c1c283e1b963feb25dd1fcb54
BLAKE2b-256 296921792af343c85016d3c0ec49f5af3e7f08905271c83012940b8bc1451d05

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9a6e4a374b5a2acc7c21b9d7e58fd973cc0b051f1433aecbbe232d95ad25091a
MD5 43d4f4ca0b7625d0878269a876db8618
BLAKE2b-256 3bb1a31f8dd1d067a86f439348d7050583a7114dbfd43d3dc8e2a2475e588ff4

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp311-cp311-manylinux_2_36_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp311-cp311-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 d5e7c53c3ae14ce816436df6f103051b07f26b22eae6971af4a0ef053edcaa14
MD5 6319eab3586e02146f354131e44c7b95
BLAKE2b-256 73b58a4bd5d5ad838441c688f3ee01ba2e03a10c5dd4c0114d93a4ce004bf844

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pysqlitefs-1.6.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pysqlitefs-1.6.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 438e4277a543fa09a7bafdc45e5af4565a008c609b0e262d3bc1af233c2eda4a
MD5 8d624ebed0971d07afa04c5b46669cb0
BLAKE2b-256 05f415b19e25c253bd73263fbdf3ee04155b9397dcab7fbc4d9b129c1e5df474

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 94de0b9b6381a5534f669e1e80bf6b3b72d59df16493c06bac476cfbec69ac3f
MD5 e5592d4775b2fe0e5d592ce1c19e89f3
BLAKE2b-256 5703986c2dcafcaa91651498fa92acb0037d031c90565e241ea2c981d0b5fd06

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.6.1-cp310-cp310-manylinux_2_36_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.6.1-cp310-cp310-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 6391d3051a78ac27c3b7e472d9fad26f909662475d73f1298ca7fe650bd02f52
MD5 916d55921b5ce7a5809dd86641965fdb
BLAKE2b-256 8372532a5ffbc63af06846661658d562f8294b85fdf45278fe33bc3cd360a34c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page