A python wrapper for littlefs
Project description
littlefs-python provides a thin wrapper around littlefs, a filesystem targeted for small embedded systems. The wrapper provides a pythonic interface to the filesystem and allows the creation, inspection and modification of the filesystem or individual files. Even if this package uses Cython, the goal is not to provide a high performance implementation. Cython was chosen as an easy method is offered to generate the binding and the littlefs library in one step.
Quick Examples
Let’s create a image ready to transfer to a flash memory using the pythonic interface:
from littlefs import LittleFS
# Initialize the File System according to your specifications
fs = LittleFS(block_size=512, block_count=256)
# Open a file and write some content
with fs.open('first-file.txt', 'w') as fh:
fh.write('Some text to begin with\n')
# Dump the filesystem content to a file
with open('FlashMemory.bin', 'wb') as fh:
fh.write(fs.context.buffer)
The same can be done by using the more verbose C-Style API, which closely resembles the steps which must be performed in C:
from littlefs import lfs
cfg = lfs.LFSConfig(block_size=512, block_count=256)
fs = lfs.LFSFilesystem()
# Format and mount the filesystem
lfs.format(fs, cfg)
lfs.mount(fs, cfg)
# Open a file and write some content
fh = lfs.file_open(fs, 'first-file.txt', 'w')
lfs.file_write(fs, fh, b'Some text to begin with\n')
lfs.file_close(fs, fh)
# Dump the filesystem content to a file
with open('FlashMemory.bin', 'wb') as fh:
fh.write(cfg.user_context.buffer)
Installation
This is as simple as it can be:
pip install littlefs-python
At the moment wheels (which require no build) are provided for the following platforms, on other platforms the source package is used and a compiler is required:
Linux: Python 3.6 - 3.10 / 32- & 64-bit
Windows: Python 3.6 - 3.10 / 32- & 64-bit
Development Setup
Start by checking out the source repository of littlefs-python:
git clone https://github.com/jrast/littlefs-python.git
The source code for littlefs is included as a submodule which must be checked out after the clone:
cd <littlefs-python> git submodule update --init
this ensures that the correct version of littlefs is cloned into the littlefs folder. As a next step install the dependencies and install the package:
pip install -r requirements.txt pip install -e .
Development Hints
Test should be run before commiting: pytest test
Mypy is used for typechecking. Run it also on the tests to catch more issues: mypy src test test/lfs
Mypy stubs can be generated with stubgen src. This will create a out direcotry containing the generated stub files.
Creating a new release
Make sure the master branch is in the state you want it.
Create a tag with the new version number
Wait until all builds are completed. A new release should be created automatically on github.
Build the source distribution with python setup.py sdist
Download all assets (using ci/download_release_files.py)
Upload to pypi using twine: twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for littlefs_python-0.4.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c52a487c97fe2c62b8a720b6af9e43d8f55b25c575428002fa8f84ee0e3fd19 |
|
MD5 | eee2032008e6ed8c5b604151a3117043 |
|
BLAKE2b-256 | db9231d4b501195c17b0d85bf4d1125fc23e83fd7e6bfbac3c7a181fa98b53ba |
Hashes for littlefs_python-0.4.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae3cc33053c6be9dc43524225fa838fff902591378ef8616bdccd9b671b1ddb2 |
|
MD5 | b347affb98ab42225a1a68d506ec81e0 |
|
BLAKE2b-256 | c59ba73440c1b1790c2847e8c850a346ae995427a10a93218bcdd3b78da1e5fb |
Hashes for littlefs_python-0.4.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1eced5b01b3939979820e9ed04e219bce467d4bedbabb2536c0f51ae46aeeb5 |
|
MD5 | 7b6731f0b8ee8d5b00149fc91dd25cb3 |
|
BLAKE2b-256 | 5e2b4623fa4a36859b8c63e4738a9078c6a1f70852a346ad2575edbfdea2da44 |
Hashes for littlefs_python-0.4.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90517955c1f0d3d6bbde66c51fc7fa3729a2a038bfb30f00860982542c0ffa2e |
|
MD5 | c04c81c4373d31d81d36579f06dfc0a6 |
|
BLAKE2b-256 | d7c56cb85b29613b151ace5bb9650470a5b3de28ee326ba8aabe6de21e4176f2 |
Hashes for littlefs_python-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76c336352e485f821e09b00aeb39a531b9bb27fc77571425b8577768196cd947 |
|
MD5 | 146ffb7b0c1d0c6fc02adde4d65b56b7 |
|
BLAKE2b-256 | 697ca7b179266658771fb800e88f434daf89498c019bb2ae2fcb26bee36393fe |
Hashes for littlefs_python-0.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b27f74d3ed73338e437c9f427ccecfef850922475989e5d0d88d90c436e75710 |
|
MD5 | 4efc5e637d6762d5f5badb67bb392137 |
|
BLAKE2b-256 | ea66d684aee66b9b576c5c33b7789e0e2e87e31d2e14146ec657631cc5e7dfa5 |
Hashes for littlefs_python-0.4.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89fc223de076ca65ba9fced6351d0ce6f41b4d7b8c3bf2ef78fb92a8d835bd61 |
|
MD5 | d67abd75ef882db57a517749d28a52ac |
|
BLAKE2b-256 | 3f5639c40b2d31ec5b213ce1842762f72ac7a64e074385f59f853905ce17a2aa |
Hashes for littlefs_python-0.4.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35f756b3fd53028a4ff31bb1074fe541eaddeac4b15f8b46b1f550bfd06b7f5e |
|
MD5 | 1f90853eaedd5beebe934389bc6d17e8 |
|
BLAKE2b-256 | 7a38f72fb49e33592908a19f6dcfe0673453111565a78240e199e76722d6d99c |
Hashes for littlefs_python-0.4.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c729b7010489ea41effa093eca6c9d03cc44438ef6e5efbbec48b3063a5d095c |
|
MD5 | 71eaf87b9cf32e8d6b461aae711579bd |
|
BLAKE2b-256 | b2b864f982360543a1bacf9d5f04cc0c6681a235df18fcc984b416478e135d67 |
Hashes for littlefs_python-0.4.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 017ccd0446ef0d2d9298ea25e4b893aed9585e6d41dd5b2d7d55aa206a526e24 |
|
MD5 | 97ee64dc87d89e4d81a91f035c98abd9 |
|
BLAKE2b-256 | 464b8f1e4d58f6cdd7fe47fe56255bb55a5629d6a78234d65033ad9c8940b4f2 |
Hashes for littlefs_python-0.4.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7e7979d79a7550f8497b380e9705cc492e0b3842e617e3b42bbd17fa4181982 |
|
MD5 | 71ee1df661f3d4ce3ddbd1e5e8d9a4cf |
|
BLAKE2b-256 | 52f1f461e9992ba5bfd4c450d6ec8aa5b0036f63f994ae40f8edf0fe9df39376 |
Hashes for littlefs_python-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b528ffa9cff3d39fc6504cf49883be60a01a1305acc7c9a5314988812e60d9a4 |
|
MD5 | 5b744a30a39a4f07bbee69fdb81e321a |
|
BLAKE2b-256 | 7a4e5aa3e96a20f540c522b5d80c9cf0fff8a25dc5db146208a19cd2b7729963 |
Hashes for littlefs_python-0.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70f59a9ced0d927ad42e83e17450b5fe3405c0bbc5a496ca657bacb8e2136cfe |
|
MD5 | 257b7a6853443a4ef2d274ee93a85c2a |
|
BLAKE2b-256 | 802b3aa8a6f81f5783423b4fddc70c6500451fb1e1c5392026d13bfb101af1ea |
Hashes for littlefs_python-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20c2090020eceea21255482ec53fcfa910de1ed9b6b24543e9d81c858287c3ec |
|
MD5 | 7c73194023b22f9db5c94ad6b38b7ff5 |
|
BLAKE2b-256 | c3f335aa5a2314819b68bec04d95007a1cf10ed6b7f7420473c9979f20ebe44f |
Hashes for littlefs_python-0.4.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04cea76245a57f7f5b2a332790e15e6382b07fdfdb6b14d0f367cad637a24021 |
|
MD5 | e1af5eee2e1db9b948af66d6d8347170 |
|
BLAKE2b-256 | 546a8b601890dea12172821b70268a5ff19436cb72b7220a433cfd2317f3364c |
Hashes for littlefs_python-0.4.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 389f00b2aaed53d2f7f7b773bdfed20ea36d9c62ab7fee7b8d4a7b6d5c6b2ad1 |
|
MD5 | 21e77140b19307b2d3c86d1bb6ccfa0d |
|
BLAKE2b-256 | b91cbcfd35ccd7a18dfea0034fb6731c153fc4717dcf1fe0ac89b9654ac158d9 |
Hashes for littlefs_python-0.4.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb3a4dbb52d631ae81f15d7b5f630e8eee9f44cbae7b597cf5f9f964bc44a0a1 |
|
MD5 | 41405850c56475254aee8b284f4c1598 |
|
BLAKE2b-256 | 2ebfcbd99488584776a20ae59e95fd56d8ff5effa3227913b942d9adff3381b1 |
Hashes for littlefs_python-0.4.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 361ac97dfdcb0ad8dcca96873ccf4e7223bad38bff96edcf1ae9f7e1dc8a2200 |
|
MD5 | 62d53952a38e597c18fe295a1a68750c |
|
BLAKE2b-256 | 0bc29a06eaf5599667e612357017e4c9eb3e149fa57e751021ac99a26f0b88a9 |
Hashes for littlefs_python-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 901a29de87d21cfe64ec14d1e71baed52fed50891dfa2a5cc83af579c5b93fe6 |
|
MD5 | 91a3f1285cdeada598a7eb28fb63f8b2 |
|
BLAKE2b-256 | 18540fb7203767c1332d9e7bc877811352a3910e3e7315ab0b02a14a59e1b5c2 |
Hashes for littlefs_python-0.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c8b59e9a8963ba07e953d17f3a27af57bfb215b110fbed6614dbae99a369a90 |
|
MD5 | 23d1abaa481b3950839a47418530f1f3 |
|
BLAKE2b-256 | 89c3304ae0f2a4174f3d0f54e0a75b425fbb5b989106e937505c961fd9df2638 |
Hashes for littlefs_python-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67a7537d81778b98b9a3f557e0ca0a3803c3b9bac681f45193bec19693e50db5 |
|
MD5 | 73a2b241b410cfe6aff58ea251582793 |
|
BLAKE2b-256 | f3d5c90a7de2d725ed886af31b2c54337877ca44e37351496bdaa3ec75966b0a |
Hashes for littlefs_python-0.4.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b1308d904f0fd58cef205f5e5a2b188091e67318963695bd373fb3374fd620d |
|
MD5 | 94a78d907668e2460c689dd27055912a |
|
BLAKE2b-256 | 073cbe5e49d5f7a06a2bc6356033c0df3b616dee446dfb667dec3a274deb09b5 |
Hashes for littlefs_python-0.4.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ef470ec24ee0ae64cc0de26f3f52e04dc5edb1a4503c1618d6790951c91f19c |
|
MD5 | 689ebf9074596e9ef4a30327b75540e8 |
|
BLAKE2b-256 | cad6257ecea6b6f58c389bfb9c531d665e5375db4b6a40303127f8a950fe78ee |
Hashes for littlefs_python-0.4.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 366c6b5779d78c8457304b7916db9f207fc3376f741e9870d3c4cc43b3999171 |
|
MD5 | 48ca99fcfbce10ab802d04d43e48cd4f |
|
BLAKE2b-256 | d550c4708aeb2a975daa3b7c66f82218406323ebfaeda8191c76506c5ede49f2 |
Hashes for littlefs_python-0.4.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c85c5c2f0a0b3e3c8527e37f7195047419f109083297f169a093f700b1513d69 |
|
MD5 | 333e21bdf45bbdb73f843143119e5a33 |
|
BLAKE2b-256 | 7f608c5a896ca072f08583eac13b55440cb4603e1c359b4a5e8c0d1e2b9d2364 |
Hashes for littlefs_python-0.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfb6908512e89fd854e5a305d585413e08b5bc3e31a94784fc0f93aec7851d45 |
|
MD5 | 353844ce69058b414d04c2dbd8be7143 |
|
BLAKE2b-256 | 8b432b65c10c331aafaad50201f9d64bbdfadc96068aa5b7c0fbf5c032b84a81 |
Hashes for littlefs_python-0.4.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49b5f3c9ec1aa969f304b66aaa43afaa1f424338a00782303888cb352b5c8805 |
|
MD5 | f62e6a5cc00fa2326ed945e57ca581b1 |
|
BLAKE2b-256 | 45a41ec7b7e792ab65a70f8a444c6a387ce4891fba67a2af8464330fd6e95e14 |
Hashes for littlefs_python-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e4500ef5bf80fe18690e0fb3d7bfa54dd21017bc2a2fd14684497d0362735db |
|
MD5 | 1d3497d54f9690383b33dce008b18b9c |
|
BLAKE2b-256 | d84ab30a6ff817976967f8830284e970fbcf103ef9471154fc9ded983c9b0c2e |
Hashes for littlefs_python-0.4.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 144ca71a0366a2aac002485f15f8ba9928cf3e751c64b74d310f99e67f5b0a53 |
|
MD5 | 00a81d7298f78d8ba0861cd4b1985eee |
|
BLAKE2b-256 | fe49f9854f73f321044da1019b9a2d7a0c07d491486fa2207f5d6d0079d954d0 |
Hashes for littlefs_python-0.4.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe667c24930b44855c8748510660a9a43e8241956f733c0c109ecef8a8a0bc17 |
|
MD5 | 305e056706beab256a1ed02e6112b88b |
|
BLAKE2b-256 | 59713679ae108500c158d86e31aa644172b2ca36ad2f67b21273c7babe267c9f |
Hashes for littlefs_python-0.4.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 021f9c298d3cadb17bc66ed0a96083ba1b868cb4ac29a54536a305785ac0591c |
|
MD5 | 24c1ce68b74c02a7e930838cf3a84da6 |
|
BLAKE2b-256 | e56ffdc15ac7ccc31dd0db4941e5f77bed4cfc2e42914c194c8a78539c4785a6 |
Hashes for littlefs_python-0.4.0-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f53440f6fd829fb8f710f53c87e62bd27c80049dddf1a95f28519f378ff3228 |
|
MD5 | 95afb3909d9557f0419038446cecc80e |
|
BLAKE2b-256 | 3f1970df2ab2f01032da8d1c823cf96465e59a18b3020151f23689a2d48526f6 |
Hashes for littlefs_python-0.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c8b352b87b8c0a306d6af124e1144f3b37f739aaf301534ac5c39121ddea04 |
|
MD5 | 19d975fad4ec05d7dade220b246e4f4d |
|
BLAKE2b-256 | fc2d6749da7dcae60099102f3f820973d62e397e4d7bc58ceecd75b8463eb5c3 |
Hashes for littlefs_python-0.4.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9d3c9e08c3957d9d9313f3afe41223296c6dc0b568d68ec47992306cd627686 |
|
MD5 | 99b8cb393fb3b28305a8c815604a6c67 |
|
BLAKE2b-256 | 840b943c6d703230013332d88be33ffaed15c5f3c056cda92864604c5c57e776 |
Hashes for littlefs_python-0.4.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26e9dae62d128a438741c64da59b322be5dc3e0c41146be3335351dfcc094fac |
|
MD5 | 898c8b97b390ece475494c1d91e0d298 |
|
BLAKE2b-256 | 85e45800e103393cef6322d6277b4f49ff6b8f4904b1c87a93006f4617e88f47 |
Hashes for littlefs_python-0.4.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65c75d2962c55baaf3e68df5746d5ce887dcf3201bf4e4854be4479a7aad1f02 |
|
MD5 | 43554983b852bae25b2da3cf9e9f051b |
|
BLAKE2b-256 | dc7b6f5839e70b4afd937c0c8c9c1c00a64e740b4247300609a1236198c20af3 |
Hashes for littlefs_python-0.4.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1c22e5e6c2f2ea8b979827eae44135f15c5c37a26d025b4686d9ec3dc00ac38 |
|
MD5 | da5a798eff430c99996494f6957ad335 |
|
BLAKE2b-256 | cfaa12548e353cd1b77ae0d0fede4625217d593b1c475663c79ac77ae63c722f |
Hashes for littlefs_python-0.4.0-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38fe527bc5f07666588e32040e796de85aecfe11c2297f2ccd4bcf56cf72321d |
|
MD5 | 56a0bdfc298c8e10a19ae79bbaa1a476 |
|
BLAKE2b-256 | 513bff0b1451d235043efdbc09ae18f6a17453507ebedd045028f4ac0cee349e |
Hashes for littlefs_python-0.4.0-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f49f9ac9fdd90f92c0ed8578af4cacfb18535b379d58fa0bd8d1e8fe8198fea9 |
|
MD5 | c7e3ac8b5a4302f7d22e0be5b469e535 |
|
BLAKE2b-256 | b56873124ef7481fa90aa9c3a50e265ef38e5bfeb922c1b7418868a4529c20b3 |
Hashes for littlefs_python-0.4.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a363c097171f290877579d98581d86b9ec6fc30ecf548a6f75d9d42441c6e86 |
|
MD5 | d2caadaed4a3dfcca04c37e8deaaae35 |
|
BLAKE2b-256 | 600c41887d60369b094ee9a883cbd9586074b2d91e628f2693e5e15a1c55a2fb |
Hashes for littlefs_python-0.4.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bd7c666a0e898ea0376c6fdbc612de26d0566f44ab1514f64f9a70658ab738d |
|
MD5 | 14f63c23c8cee30dc679ff3aaf94a45b |
|
BLAKE2b-256 | 25ec131a043099ac68f06ddb70cc4609bcb7ef2df6226598c357b38f6d2584f7 |
Hashes for littlefs_python-0.4.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32dab5b40d6d8b61d7b65bea75d54b84644665d420a4d4d5f14552820c486531 |
|
MD5 | 5065cbfc251ed38dd7a3f183dda95e5e |
|
BLAKE2b-256 | 8445875bb31e3253dbc31d9fad1d054feeb38823cbc26fec8321c3879856ada9 |