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.0-cp314-cp314-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.14Windows x86-64

pysqlitefs-1.6.0-cp314-cp314-musllinux_1_2_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.0-cp314-cp314-manylinux_2_36_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.36+ x86-64

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

Uploaded CPython 3.13Windows x86-64

pysqlitefs-1.6.0-cp313-cp313-musllinux_1_2_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.0-cp313-cp313-manylinux_2_36_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.36+ x86-64

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

Uploaded CPython 3.12Windows x86-64

pysqlitefs-1.6.0-cp312-cp312-musllinux_1_2_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.0-cp312-cp312-manylinux_2_36_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.36+ x86-64

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

Uploaded CPython 3.11Windows x86-64

pysqlitefs-1.6.0-cp311-cp311-musllinux_1_2_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.0-cp311-cp311-manylinux_2_36_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.36+ x86-64

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

Uploaded CPython 3.10Windows x86-64

pysqlitefs-1.6.0-cp310-cp310-musllinux_1_2_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

pysqlitefs-1.6.0-cp310-cp310-manylinux_2_36_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.36+ x86-64

File details

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

File metadata

  • Download URL: pysqlitefs-1.6.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 1.3 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.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 83cc3184ded4cb01b777d62344a04eec43bd789ce60e9782a21c08267eb759ef
MD5 829ddec4449b7609c99eed258cc973c8
BLAKE2b-256 350f13bd7efa34252ef666cbf1a3b297b7586690b0a6afe3adff5b529a413605

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 40c1f882667397cd0cac32f77253824ebf09f2e751c5f1f4b8565101b4ca41ba
MD5 bd878991a630d8453bf345bd9c106a0d
BLAKE2b-256 08331cb92a8307dde38868353473326bd9b43d9d32f28b4e11eea6fcfc17308c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp314-cp314-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 5a2f2711ca71687cf0e187f2c3e30e0d07b7c8d7bb960d8260c7f17323cfac96
MD5 e469d2f1ab0d60812371b406148e42c2
BLAKE2b-256 b791292edd45453cd949638cc1cb810c618101e59b5faaf5b7724305070d5f24

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysqlitefs-1.6.0-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.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7c9ff085c32b868c8031c4e6ee771f28764c8da281878357c0da64666177449a
MD5 c87667d9089489e5b340a28ea24f7a8d
BLAKE2b-256 2058fb948096de3e506e44e35ce392bfd495413c099b5161c2565242b8a9aa41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4900d75cd9de04a1265ade47b538e489b6ae6065478834b5a64a0dfe913df179
MD5 5c7274eed6f3732ea7dcb0fcf9ad4acc
BLAKE2b-256 6ddaa4fe136a01995bfa1ddf03fe468a563aab8f4ee5b1b0bb397208079d42c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp313-cp313-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 30491e0b4ac632d353863fe39051f34552203af25760f4906f9888591420a07e
MD5 3081e3dbfd01367833adfd93bfaa9f66
BLAKE2b-256 06fd1bdbdf7e65a50c6535739fb4cbb1127fb162cd5fffebabff5e963d795638

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysqlitefs-1.6.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 3f76776379b0aeaa2033131f33db871c52fa9f54915431004ca9ec05734422f8
MD5 c2e2ea1b5328e778ac533b3ce491336f
BLAKE2b-256 1287fb8aae317ccf7393cb91922db7779b67c46da785b63dd8e5b194b38d4506

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 315c641f51bbc435cec860daa07c924c26a3a79085d8997f21c72270f843b54e
MD5 d89f118aa4135f66ed1cc75d1ab958e0
BLAKE2b-256 3b16f0c8974dbee5c407debcbecbd7133771495d43f647baf8c763d71dc11d47

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp312-cp312-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 003d17495046ab82501e4eaec763fe398f8b6011f0cd692263823fed98cabc2e
MD5 7f4a9c96af1008ef3f0e0e8dd8aa15f7
BLAKE2b-256 0eb54faf33100fe11665a9929dced96ac781ba22dd5dc246d00bc8eb3533474a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysqlitefs-1.6.0-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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a8dd3673cb364b625f115e04a4a80c7713b99123c972a907de770bdcb51f4106
MD5 ccef747d1c831bb7d2c44ed2ccf3a6e8
BLAKE2b-256 3f10cf84e4cdcd7b345e70c94258af183d12cdd62a7ed995bf0e07779e16ae5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 aa27a576892601df4a1d18f263e9be5c2c8ad8eee7d5743b827ff58c027c1e13
MD5 f09c7ae6b96168596891965d5ae9e540
BLAKE2b-256 c9c3cb81bb47849d3b3759479d98af80d6f1694b39151bb0db5db3241e066a69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp311-cp311-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 c0eecabb5d0721d5f237c78e243889c3e4c262efcd5b1ffd656278f4e49d6633
MD5 e049c9dd3cabd6f09fa48ade15d15844
BLAKE2b-256 d08308f83792dc96744759c3b2a3b071cb180ce78da1b2188aa0208a14617389

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysqlitefs-1.6.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b5bf3e985a109506b5156e118c2288b5fffa99bf13761f98e61e222541ae2bcf
MD5 76a4d9afc4dc2a499c1904112cd8e106
BLAKE2b-256 67531301e89cb96889118e967cf889c027e522fcae8f62ef64b173448c06ae73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 34a92c482f36ce2f396e83078d022de437cfd7c1c6a9b39e50d43b10fbf0fc5e
MD5 397602d1db9884be1916c01226d85a54
BLAKE2b-256 c8738d0b170d61cd840b9334fb6c44f47c0c400d594adda2533bdcf9b1394c40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.6.0-cp310-cp310-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 5f9d6a3d407e4a2dbcfc15223e7661e22d83acfee8bafa48bb3b580c66b9fc01
MD5 33f97155d89eca816965bd33ff86839f
BLAKE2b-256 e31de30db2a90ef217d6aa5a8be9a3a3fb1a5b12e9c9ecf784593ffeede23954

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