# 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 in database)
- 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.
## 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
```python
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).
```python
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"
```
Raw data
{
"_id": null,
"home_page": null,
"name": "pysqlitefs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "sqlite, filesystem, database, file, storage, compression, encryption",
"author": "P34ch",
"author_email": null,
"download_url": null,
"platform": null,
"description": "# PySQLiteFS Bindings\n\nThis 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.\n\n## Supported functions\n\n- pwd - print working directory\n- mkdir - create a new folder\n- cd - change wirking directory\n- ls - list files and folders\n- cp - copy file. (Works with files only)\n- mv - move node (file or folder)\n- rm - remove node\n- write - write file to the db. (1 GB max size for one file in database)\n- read - read file from the db\n- stats - recursively gets the count of all files in a directory, indicating the total size in compressed and raw form.\n\n## Read/write algorithms\n\nTo 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.\n\n## Examples\n\nA simple example\n\n```python\nfrom pysqlitefs import SQLiteFS\n\nfs = SQLiteFS(\"test.db\", \"secret\")\nraw_content = \"Raw data content\"\nfs.write(\"file.txt\", raw_content.encode())\ncontent = fs.read(\"file.txt\")\nprint(f\"Content of file.txt: {content}\")\nassert content.decode() == raw_content, \"Content mismatch after save and load\"\n```\n\n### Custom save and load functions\n\n> 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).\n\n```python\nfrom pysqlitefs import SQLiteFS\n\n\ndef save(data: bytes) -> bytes:\n return data[-1::-1]\n\n\ndef load(data: bytes) -> bytes:\n return data[-1::-1]\n\n\nwith open(\"file.dat\", \"rb\") as f:\n raw_content = f.read()\n\nfs = SQLiteFS(\"test.db\")\nfs.register_save_func(\"reverse\", save)\nfs.register_load_func(\"reverse\", load)\n\nfor name in fs.getSaveFuncs():\n print(f\"Test function: {name}\")\n fs.write(f\"{name}.dat\", raw_content, name)\n content = fs.read(f\"{name}.dat\")\n assert content == raw_content, \"Content mismatch after save and load\"\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python bindings for SQLiteFS - Simulate a local filesystem inside a SQLite database",
"version": "1.4.2",
"project_urls": {
"Bug Reports": "https://gitlab.com/p34ch-main/sqlitefs/-/issues",
"Documentation": "https://gitlab.com/p34ch-main/sqlitefs/-/blob/main/README.md",
"Homepage": "https://gitlab.com/p34ch-main/sqlitefs",
"Source": "https://gitlab.com/p34ch-main/sqlitefs"
},
"split_keywords": [
"sqlite",
" filesystem",
" database",
" file",
" storage",
" compression",
" encryption"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "ae0071042ff97af4d57d5e079ee0a08e036493bf49eba37cbfb1029455b9e077",
"md5": "494518029c4918f35206f212ccfd3c95",
"sha256": "5605746788f2149d1b2af226e0d780319c1c4a367ab1f4d6feb377b0b2aff74e"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp310-cp310-manylinux_2_36_x86_64.whl",
"has_sig": false,
"md5_digest": "494518029c4918f35206f212ccfd3c95",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 1768769,
"upload_time": "2025-07-15T00:33:51",
"upload_time_iso_8601": "2025-07-15T00:33:51.784360Z",
"url": "https://files.pythonhosted.org/packages/ae/00/71042ff97af4d57d5e079ee0a08e036493bf49eba37cbfb1029455b9e077/pysqlitefs-1.4.2-cp310-cp310-manylinux_2_36_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d0c736bcb12a77cd36bae0e2d6c7e97a8610fbb2c7568556eb030f3c44565f02",
"md5": "87f217897094ac736113a07ba80a1f94",
"sha256": "827d1348896571a9011cb8b14324510da89ac5047e61c4c2d6c3d30a778fc2d9"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp310-cp310-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "87f217897094ac736113a07ba80a1f94",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 1843535,
"upload_time": "2025-07-15T00:33:53",
"upload_time_iso_8601": "2025-07-15T00:33:53.720173Z",
"url": "https://files.pythonhosted.org/packages/d0/c7/36bcb12a77cd36bae0e2d6c7e97a8610fbb2c7568556eb030f3c44565f02/pysqlitefs-1.4.2-cp310-cp310-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "debd6f2b4312e7f2b81a56c4e408037d757f16a0dbf8fa9aa11b298ebb9158cd",
"md5": "ab257f59d519b5d66966c275ff1fccb6",
"sha256": "2051696a2ebbfe822d86da9183b0362f9552db6a4a3234dd7c369b897c34df3e"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "ab257f59d519b5d66966c275ff1fccb6",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9",
"size": 1261069,
"upload_time": "2025-07-15T00:33:57",
"upload_time_iso_8601": "2025-07-15T00:33:57.487749Z",
"url": "https://files.pythonhosted.org/packages/de/bd/6f2b4312e7f2b81a56c4e408037d757f16a0dbf8fa9aa11b298ebb9158cd/pysqlitefs-1.4.2-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0aab79a4617d0610cb71cf178e535a193e6a20fc1c2bea13e28050c1ab3d8403",
"md5": "0f850f995af3345681b6f90a27e3a7e0",
"sha256": "48183432a3f4e4ea1899d78e2f55590718dd9044299ac7b56255ef3bf5e8f500"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp311-cp311-manylinux_2_36_x86_64.whl",
"has_sig": false,
"md5_digest": "0f850f995af3345681b6f90a27e3a7e0",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 1771445,
"upload_time": "2025-07-15T00:33:59",
"upload_time_iso_8601": "2025-07-15T00:33:59.353990Z",
"url": "https://files.pythonhosted.org/packages/0a/ab/79a4617d0610cb71cf178e535a193e6a20fc1c2bea13e28050c1ab3d8403/pysqlitefs-1.4.2-cp311-cp311-manylinux_2_36_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "94d44a1b850bbcf45fbbb2c3266c81a132e73a3be3204dad06c7e5027cdff257",
"md5": "bbb1e0e945ef733bce764d1dbca78119",
"sha256": "fb7f0fba3e6aa21b9d203fc026d11e91d1230b665f6e4565075d37df1a65c385"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp311-cp311-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "bbb1e0e945ef733bce764d1dbca78119",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 1845687,
"upload_time": "2025-07-15T00:34:01",
"upload_time_iso_8601": "2025-07-15T00:34:01.278791Z",
"url": "https://files.pythonhosted.org/packages/94/d4/4a1b850bbcf45fbbb2c3266c81a132e73a3be3204dad06c7e5027cdff257/pysqlitefs-1.4.2-cp311-cp311-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "88f0cae83f23cd4e1e13d6f153cfd823f206e91f486541cb191286403e500a14",
"md5": "ede24ea4cac196b22f50f6f31c54f080",
"sha256": "eba9a51bc1df6df81162769a993b0056d2a0cd6d49023b408c945e08c876fe97"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "ede24ea4cac196b22f50f6f31c54f080",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9",
"size": 1264023,
"upload_time": "2025-07-15T00:34:03",
"upload_time_iso_8601": "2025-07-15T00:34:03.038044Z",
"url": "https://files.pythonhosted.org/packages/88/f0/cae83f23cd4e1e13d6f153cfd823f206e91f486541cb191286403e500a14/pysqlitefs-1.4.2-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "73589b5b64af1424581bfc4d8e54ba762b646e5dfe4806c9e38ab7c89c16b732",
"md5": "c354ccf810a24e9178f8cf2a9b235514",
"sha256": "2c371d503a6553b245d54081e076d24bdc22bf7722701676b6fbe2e81e4598dd"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp312-cp312-manylinux_2_36_x86_64.whl",
"has_sig": false,
"md5_digest": "c354ccf810a24e9178f8cf2a9b235514",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 1773388,
"upload_time": "2025-07-15T00:34:04",
"upload_time_iso_8601": "2025-07-15T00:34:04.940952Z",
"url": "https://files.pythonhosted.org/packages/73/58/9b5b64af1424581bfc4d8e54ba762b646e5dfe4806c9e38ab7c89c16b732/pysqlitefs-1.4.2-cp312-cp312-manylinux_2_36_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "9766cbf26bf7c4a28538627454421f135cc5ab5eca93dc1fdf01a9411d467846",
"md5": "8598d168e3331922d4c56271948a6993",
"sha256": "b87f414d3b3be36baa61c20f328b4c2b39a8b76e480bb59880acba380835c9d7"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp312-cp312-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "8598d168e3331922d4c56271948a6993",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 1847204,
"upload_time": "2025-07-15T00:34:06",
"upload_time_iso_8601": "2025-07-15T00:34:06.449115Z",
"url": "https://files.pythonhosted.org/packages/97/66/cbf26bf7c4a28538627454421f135cc5ab5eca93dc1fdf01a9411d467846/pysqlitefs-1.4.2-cp312-cp312-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "451520552fc48668d16d963d7830e718415cd5bfb141097fa133ab217a99cc07",
"md5": "776fec3e2371a9b4de60efbd86f9ff48",
"sha256": "eb6d3663b72eb621b87a24ed54e5fcf06615be269c2ee5a76e0a20ece5f70437"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "776fec3e2371a9b4de60efbd86f9ff48",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.9",
"size": 1267080,
"upload_time": "2025-07-15T00:34:08",
"upload_time_iso_8601": "2025-07-15T00:34:08.189470Z",
"url": "https://files.pythonhosted.org/packages/45/15/20552fc48668d16d963d7830e718415cd5bfb141097fa133ab217a99cc07/pysqlitefs-1.4.2-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c72b658b1c9f050d3636425143363311f782d0d68551e285607737f8d67015e3",
"md5": "2b536182ac4d90968082108eba875187",
"sha256": "45a7d5be46069a566bd05bc7388be44fbde97dee9e457ab9f5a1518f1f89d04b"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp313-cp313-manylinux_2_36_x86_64.whl",
"has_sig": false,
"md5_digest": "2b536182ac4d90968082108eba875187",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 1773424,
"upload_time": "2025-07-15T00:34:09",
"upload_time_iso_8601": "2025-07-15T00:34:09.564232Z",
"url": "https://files.pythonhosted.org/packages/c7/2b/658b1c9f050d3636425143363311f782d0d68551e285607737f8d67015e3/pysqlitefs-1.4.2-cp313-cp313-manylinux_2_36_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f6e7c70a95c8a00a08383f5b8e35e8a4f3ac12ea9a7b4872777a35213169116b",
"md5": "ea29a4c9546343d9431934e6f7972eff",
"sha256": "0f9843e350c3ef8d059a24c3488598a765fb826358122028abcd14f655af08c5"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp313-cp313-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "ea29a4c9546343d9431934e6f7972eff",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 1847337,
"upload_time": "2025-07-15T00:34:11",
"upload_time_iso_8601": "2025-07-15T00:34:11.171526Z",
"url": "https://files.pythonhosted.org/packages/f6/e7/c70a95c8a00a08383f5b8e35e8a4f3ac12ea9a7b4872777a35213169116b/pysqlitefs-1.4.2-cp313-cp313-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4265fa42965546f2ad02f74b1f6ac7e44cb12404f7c9fbf5da81161194573e08",
"md5": "c173b795ca718b5c41cfefb745b63058",
"sha256": "95f49479e5173964b6e0647b7fc143bbb9267c7aa3c9ece5497ad5365c5e1497"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp313-cp313-win_amd64.whl",
"has_sig": false,
"md5_digest": "c173b795ca718b5c41cfefb745b63058",
"packagetype": "bdist_wheel",
"python_version": "cp313",
"requires_python": ">=3.9",
"size": 1267011,
"upload_time": "2025-07-15T00:34:12",
"upload_time_iso_8601": "2025-07-15T00:34:12.879163Z",
"url": "https://files.pythonhosted.org/packages/42/65/fa42965546f2ad02f74b1f6ac7e44cb12404f7c9fbf5da81161194573e08/pysqlitefs-1.4.2-cp313-cp313-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e6a4ff73713f7929b408bc16646607341d11327b0dc02f27d3e53a9eb95f2e96",
"md5": "a5229c95d6902d844ebc2374ae99b631",
"sha256": "db3fbcab166da5185f79366d957f578a0a852ab428e6cc70c82740521ef03fa0"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp39-cp39-manylinux_2_36_x86_64.whl",
"has_sig": false,
"md5_digest": "a5229c95d6902d844ebc2374ae99b631",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 1768717,
"upload_time": "2025-07-15T00:34:14",
"upload_time_iso_8601": "2025-07-15T00:34:14.768505Z",
"url": "https://files.pythonhosted.org/packages/e6/a4/ff73713f7929b408bc16646607341d11327b0dc02f27d3e53a9eb95f2e96/pysqlitefs-1.4.2-cp39-cp39-manylinux_2_36_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f202cc610c19efdd4df8916d4ae5b64eace7e6107f84a25f944512b353cd7d10",
"md5": "6b61701acb8a528d82dad38db969c13e",
"sha256": "ccaa35ef32b3eb81cbf8866635cd64ea171ab09bcdc89367c5fe03e33903e1b1"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp39-cp39-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "6b61701acb8a528d82dad38db969c13e",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 1843519,
"upload_time": "2025-07-15T00:34:16",
"upload_time_iso_8601": "2025-07-15T00:34:16.398906Z",
"url": "https://files.pythonhosted.org/packages/f2/02/cc610c19efdd4df8916d4ae5b64eace7e6107f84a25f944512b353cd7d10/pysqlitefs-1.4.2-cp39-cp39-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "64e7feb68dfb79c095591877683aa3ef8af811d6645f09baafad65afa8307627",
"md5": "b9686f8b45e839feb92d3b6db547558e",
"sha256": "a57afa1b4ec35ed2f9c110c98d6aba1323a1f07edc22c7b8fdca801a0a8f3e66"
},
"downloads": -1,
"filename": "pysqlitefs-1.4.2-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "b9686f8b45e839feb92d3b6db547558e",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 1261296,
"upload_time": "2025-07-15T00:34:18",
"upload_time_iso_8601": "2025-07-15T00:34:18.320751Z",
"url": "https://files.pythonhosted.org/packages/64/e7/feb68dfb79c095591877683aa3ef8af811d6645f09baafad65afa8307627/pysqlitefs-1.4.2-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-15 00:33:51",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "p34ch-main",
"gitlab_project": "sqlitefs",
"lcname": "pysqlitefs"
}