Skip to main content

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

Project description

PySQLiteFS Bindings

This project provide 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. (1 GB max size for one file)
  • read - read file from the db
  • stats - recursively gets the count of all files in a directory, indicating the total size in compressed and raw form.

Built-in algorithms

You can use bzip, lzma, zlib or zstd as write algorithm. 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 and decrypt 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.4.1-cp313-cp313-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.13Windows x86-64

pysqlitefs-1.4.1-cp313-cp313-manylinux_2_36_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.36+ x86-64

pysqlitefs-1.4.1-cp312-cp312-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.12Windows x86-64

pysqlitefs-1.4.1-cp312-cp312-manylinux_2_36_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.36+ x86-64

pysqlitefs-1.4.1-cp311-cp311-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.11Windows x86-64

pysqlitefs-1.4.1-cp311-cp311-manylinux_2_36_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.36+ x86-64

pysqlitefs-1.4.1-cp310-cp310-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.10Windows x86-64

pysqlitefs-1.4.1-cp310-cp310-manylinux_2_36_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.36+ x86-64

pysqlitefs-1.4.1-cp39-cp39-win_amd64.whl (1.7 MB view details)

Uploaded CPython 3.9Windows x86-64

pysqlitefs-1.4.1-cp39-cp39-manylinux_2_36_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.36+ x86-64

File details

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

File metadata

  • Download URL: pysqlitefs-1.4.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pysqlitefs-1.4.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 202a11631104dc185f05b47559c1c09fd594bcdadf0435c2d7d0e2d05a14b849
MD5 3336fc1cdadcc2ee31d197fde3457707
BLAKE2b-256 3d3da9d12830655ee211dc97b701950ff2f646a24ffb98e523ea7bb5dfb276fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.4.1-cp313-cp313-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 48965fadcca366f46c8b7cfda58b856f6ed7d8e2956a24359e1f661f667c0a8f
MD5 08e9fbf02d7d45db045390f7952570f6
BLAKE2b-256 580881d7f51469d52603e906f0f5a698720d5668118ee9eb9eb739082b2f0b6a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysqlitefs-1.4.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pysqlitefs-1.4.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d0f18b13699b759f98829892ed726d0513ba613a5b45d1d2875446f5dae44caa
MD5 4a9a445ed6c4d63ce238ead531d602c2
BLAKE2b-256 d163dadc180fce4481c2b5f8e6511c0fdd9759a463191bc4f9daa964328f04f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.4.1-cp312-cp312-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 776f0526881b01cab504d03c2365cbf97aceade4c2bd607808e4e4aa7fd3cf5f
MD5 1fe4fa295d09d5d257b9338118f6dcb5
BLAKE2b-256 5f799565a70c99d38f6ff7c897a8d684a0754760277b9e9c28a5048221c2b4e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysqlitefs-1.4.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pysqlitefs-1.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2f450e2b346d22b95737a5f5a25014a846f02427452e02840f230310dbcc50f8
MD5 a57b7bf951340ce9b769aaf795e7ab9b
BLAKE2b-256 8431b2cfbfca3e047e0078b3e0cceca4c709d00a23a10d0c7dc5c73e2fa39933

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.4.1-cp311-cp311-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 dd8daa042ccf17ff44d60f1484ea98bf11543f3dae71fa5d9965c6578ade8c58
MD5 72d5bc5f78d1e72f703ffd74ab57f9bf
BLAKE2b-256 0a71c78640f3379c55a3daef42f030dd3f8ec6c14c1df221d2d2ecc77e26a45c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysqlitefs-1.4.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pysqlitefs-1.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 76c3a4dd0de7cb2595d2ebccf98016c72fe74e92a5500ba2f1b30c034a7760ec
MD5 6c5ca886949a52b8d584c030442b8678
BLAKE2b-256 83e4bee880ad618ba245a33acf2db802cfede87b2216aa86c2551d4446d1685e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysqlitefs-1.4.1-cp310-cp310-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 b32307ee55b8be2388fead86e607d838a633422f6463e78befb307bd85bc52cc
MD5 d1c310afc6591ef24b976a410fbcb6e5
BLAKE2b-256 4274092f3a463dd3f8b0247fc143b048ef11b6df7bbc551e554b1da2db5d3b7d

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.4.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pysqlitefs-1.4.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pysqlitefs-1.4.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1a752ebdb440e5387720c8532e047018c5f2ece756dd8935ceff90982663323b
MD5 672a0b49e9359a01220704a16ab82e59
BLAKE2b-256 ba1f53f91efc641964e100f4960eda677807344510729faac6688732abc6c22c

See more details on using hashes here.

File details

Details for the file pysqlitefs-1.4.1-cp39-cp39-manylinux_2_36_x86_64.whl.

File metadata

File hashes

Hashes for pysqlitefs-1.4.1-cp39-cp39-manylinux_2_36_x86_64.whl
Algorithm Hash digest
SHA256 f35abf6cc52177d3af2f802fe43f51d846313138ecfd988332f916dd72387e33
MD5 50e47a2823d6c6d6b8da240bdca0087e
BLAKE2b-256 8bb55a0d9ec55c19cf61348df8bdabfbbe3981ffa48d70d6ff88d04a1c2633b9

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