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') as fh:
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.3.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 310dd3d45fa4590e38c64c7d5fe0947ba7824f7776de05fad307eac81998cfeb |
|
MD5 | 1694ff6b93f9056e319a5b70209c93ce |
|
BLAKE2b-256 | e00bf7a518dc7431f822b16de5f693edd53dcfaee03a7ec97f95ba0eebd6fa73 |
Hashes for littlefs_python-0.3.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2884aa93aaa21a50932a8b8b5fffc023c2ad0f37a01f11c062fb3e671782caa8 |
|
MD5 | e8621c4a660a0babf1694860a463e216 |
|
BLAKE2b-256 | fa901ccc73a43ce3bd2eac69dde218caee5742f4414198fd31e2d574fd36a00f |
Hashes for littlefs_python-0.3.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f92ccdf71023f79b8a858eb3f9670932d83de6a71080bc11597552b4e113601e |
|
MD5 | b04b64d12a4272637669a991c615aec9 |
|
BLAKE2b-256 | 7dc6544a0a35b7ea088ac4ca1688131ebb6067740333cce1dbeda182345d74d2 |
Hashes for littlefs_python-0.3.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d6f7f6e87bc32366978841b27302cfebb9e3f40917c570dc31768a6ec2560cf |
|
MD5 | 0e140fe9c891fefec2227e1da51a0acd |
|
BLAKE2b-256 | 84e36c815c70686e12596d099d947345f79720511056cae8592fec19c5c878ac |
Hashes for littlefs_python-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b0d361599707f52c1a853a28a117bfa5d85b767493df7cbd8be25f7082248ec |
|
MD5 | a10b29dcefb5e55190ceee8f8aec297a |
|
BLAKE2b-256 | f75246751cdae7283b1e959b040c075af2ca12feaeb9303c1cf14bccdfe8fcce |
Hashes for littlefs_python-0.3.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d2a32f0db06041e328ab319e22f2c77502340731fede090447a7148c0490a42 |
|
MD5 | ebf0f3c4c795674a48709bf85ee17ee8 |
|
BLAKE2b-256 | 53d0829ced9b4a8b26476a73af97b8aaa597c2c99fc9794b2ede444ad25f4fd1 |
Hashes for littlefs_python-0.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ede18a52b00030eb1e228a31cdd3b03a5eac8dbd553119a649f12a2642d4281 |
|
MD5 | 478dadaefeccd498c524b4c626257dcc |
|
BLAKE2b-256 | 8aeaa16d28d7e6f83e6de3bbcac39ea21dafc5aed4688f8e2daf8c6a309525c6 |
Hashes for littlefs_python-0.3.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 237d170d61099bfc1eecb1aefacf44245dd16a0913d9e3b76542a1914c479577 |
|
MD5 | 4003cde3c7be9fb35a72112f57c5f9c8 |
|
BLAKE2b-256 | a12f5d6d7b4efc6d196d059ff15e1807e468b9d6e71175c0c0f5107f8c87cd2a |
Hashes for littlefs_python-0.3.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ec5918ab9785754eec4f5b6df031c0841e0bfab125d521b74c98646bbf5ceb7 |
|
MD5 | f9fc41ae45832ac0a3f3de185e09b34a |
|
BLAKE2b-256 | f341731e03869c3a7ed6f196eeabc0c2d4c7e10dc86f88e1a6ccd7c9464215f2 |
Hashes for littlefs_python-0.3.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bebc16043a6e1b5270e6dd3e2dea248075fc3f6b2449c1d7b992f65d89a39a7 |
|
MD5 | 756f84dd3a7248a201c92f6b15552a0b |
|
BLAKE2b-256 | 7bc4a8469d8ce50e02729576c69630580c42a73642db2aae9f75822a68622a7e |
Hashes for littlefs_python-0.3.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac20caf7a6f4887ad435e56166708700d4bbce417d1a0b752352d6c270aa45ac |
|
MD5 | 3ad92bfd790836725a3b3bc607c700e4 |
|
BLAKE2b-256 | 92ba1098e038a969e93ddbcd93b7a07fcc63cdc05c66ed66814b9052cddb51b4 |
Hashes for littlefs_python-0.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf65c0a38cc31a827de87ff7e78feb470c6777e20167d52ac6e4a227127046d7 |
|
MD5 | 0dca88f35d83a7f002127b5c5cd57fcf |
|
BLAKE2b-256 | 7e0b755e2c2cb93cbcb7babf056fdb367396bd67775619e737821d292f53c172 |
Hashes for littlefs_python-0.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 591ad39641c73a7335898e59a8b881330938a56acd71ea7b7685ad029aeff17a |
|
MD5 | 4637a1809c5a895c0616460eb4f21950 |
|
BLAKE2b-256 | 329374532983f1f287e8d4b26473ff77d9c6fb4ed07bc5ebf765fd5a597f8e6d |
Hashes for littlefs_python-0.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 330b73dbfc360eb8114837b8ae45a4b4d1a9b1bc10d93d5b392506a7b198c8ab |
|
MD5 | 3d88c05ed26d8a0b04bca14def70e353 |
|
BLAKE2b-256 | b7f166deb1d221ff7c04787dc6a15b52a6fe9d838a6c62d04101badd85a558f0 |
Hashes for littlefs_python-0.3.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50257dd5b450bcbf662624b310b02a129a242741632fcd7df0a4d0097d3a6b3b |
|
MD5 | 3d9cf874edb14489daead9cf74288cf0 |
|
BLAKE2b-256 | 7ffd6b7d8bf66d5af4369046df87f0ffdbcfec0f033a72e64a95f754b15def48 |
Hashes for littlefs_python-0.3.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06d74ac8259a8f6211554a72c3a536bb0a2c4476908631858a36fd21f332df59 |
|
MD5 | 108c0e0fe6c56b706d6db78b8dc05fa3 |
|
BLAKE2b-256 | 0acbab66bf9bcc120646f1a1bf1982116b6a7a879758c0d00516b239d2c44fdc |
Hashes for littlefs_python-0.3.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b4f176124ba7f8f0fbac5d6f4d25c070f4c2a309d71867abd113b31a2c1addd |
|
MD5 | c8cce208b63c8175fed32c12bd3edce6 |
|
BLAKE2b-256 | 7e5a0776df020ef7cd0c97a2d01be250e21104c41d9ebae2a0430018b271a3dc |
Hashes for littlefs_python-0.3.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d599713e1b4461e4df03be64d93988647b436eb5c9941da0fb79cee971e25652 |
|
MD5 | 56bf963f9240d2f94a1d01f0e5112638 |
|
BLAKE2b-256 | a1a8194b448a157e7651a1adc10f8ca1e830ca76ba53a5bbafeab47d19c5b36d |
Hashes for littlefs_python-0.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d04eb90d7ab97048757deccd81ac95582e8cb19e7a904f011defb3b82bc68331 |
|
MD5 | c9a90a3d8036411e356bcf3bfe38175c |
|
BLAKE2b-256 | 8b5fb7a7363826d52f062446a259388178480d6e22f5b6261768283090eb0ca9 |
Hashes for littlefs_python-0.3.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | deca5698908c03cb03bb43ee9704a11853ff332d0acaff62abc87dc36beb428b |
|
MD5 | 7c24396ea8e135c755d42a7595050b3e |
|
BLAKE2b-256 | b2b6e21c8e76dd85c1b47b5cf4f238dc6e05c929beedaeed420d85764e8bfe9f |
Hashes for littlefs_python-0.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ce749ba770d118a5a706dba04619beadfe990a442e6adb49055cbf8594681b0 |
|
MD5 | fd264f38db417a6c1a5a35170c641a7c |
|
BLAKE2b-256 | caa8e8218b980a77c9b67e23fd10572ddc9e715e4f818dc3bd7b15fa8bde3d99 |
Hashes for littlefs_python-0.3.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46b9bf4b44d64424775c03f2aa4745ec8e01b4b9921237bd5a1c5c1dc114b751 |
|
MD5 | 4460ed185d11fc3578e9fa55ac57e6f6 |
|
BLAKE2b-256 | 1b3d6c434d565558347109d8240be5a6912321c7bcb8db57b7fad85a15aba52e |
Hashes for littlefs_python-0.3.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f4e4bda5f0023b71a89decc4273f0c66c25bf9fe0caa225b64c012c4116a1a8 |
|
MD5 | c4356ecef1c89dbda6d38dad799ecc37 |
|
BLAKE2b-256 | 7f1552a5139c3402a275c8c6f1d22a2a09c85258d1b88ce96a5a5cedf38d8965 |
Hashes for littlefs_python-0.3.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e47f5784800a523397d74ef3bf7926d5c0c035914dcf900cc499ad2cba09b174 |
|
MD5 | 7264be65a1e50daa7e877a2b14143c42 |
|
BLAKE2b-256 | ebb02318524a1bcf69d0be36cfe7fae2dc75c300cfed08785faae3089a13f4b5 |
Hashes for littlefs_python-0.3.0-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84bdf97b95a63d0b892b1f0d01160b5e6bc3bcf0732baf0e79389312708be695 |
|
MD5 | 7e0b54a5aeb5dd8d10982ba74f6f7f40 |
|
BLAKE2b-256 | 7069f5804c0cb3d7dce6f697fd5bbbc466694365e500eee8d8ebd4b9d883e4d6 |
Hashes for littlefs_python-0.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfce7ff07916012fe93a526e1f1388d5434c27ab3fc294b790fb4528296cab48 |
|
MD5 | 7198002485cf0a0b0c92b0cd9cecdd6d |
|
BLAKE2b-256 | ee2e122915af1af5bc8cecebadf67ab87881f91ac4b592acd2497625f37877f7 |
Hashes for littlefs_python-0.3.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6255efe84b6651573e1f6f9fc5d19176d66ba9405c6069d916479525dff27a51 |
|
MD5 | 906ef38c6be2ab13433ba19c091e5050 |
|
BLAKE2b-256 | bd974361eeccf1b0508316fa0f441ae42ee03568675b5f46c053a848081c0968 |
Hashes for littlefs_python-0.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78c4aae1068a2bb7d9435bb85e305b5cf506544daeedd526e8b61d1f467eda9c |
|
MD5 | dd89045b30c2342f175dd9a341e7ec3c |
|
BLAKE2b-256 | 56badcd7ab4ed8f7352b9e2c8ccef46a151ffc9a7a7d0457aa1e5155b1434be1 |
Hashes for littlefs_python-0.3.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2f84ef16d5c0a48992b211fe99be05ca61445b17b40b865db38d7433a31c068 |
|
MD5 | 71a5dce5add790aa54f9abb2810759de |
|
BLAKE2b-256 | 9ee35265cf6c4c102fbb7e7b4739228cf38d18075c45b8fc20d8ee3a528cf955 |
Hashes for littlefs_python-0.3.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83e3100bf9a5d5b3defa3b298369ba7ac075d5e417feb71d290044155dea37ad |
|
MD5 | cc92a756b49eecc9998d1b5182303022 |
|
BLAKE2b-256 | 0046e41a96bc7508cd99e4d2a18464347c39bca38cc5240eda5b591a04e962de |
Hashes for littlefs_python-0.3.0-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 830231adb1fddff28665199bc3df8fe8cfb628c0656fb8ee476bd84ed16c5e12 |
|
MD5 | f1ade595269e849fc7b61dd800db5a2c |
|
BLAKE2b-256 | edbc515fc91aeaa1a1f4bb92b1a5cb585615e04c0110850df33f8374b7d53a3a |
Hashes for littlefs_python-0.3.0-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d70aa39224d5ca94f4d0efe3b237a246262925ebb80e3cb04e973c5f6db26f7 |
|
MD5 | 679b78dca623b536a4e9b9583f3cb3ee |
|
BLAKE2b-256 | ff08adb1f5abefa2d202b35c0134a2bda6b94a46e9f9c203b3904703bc709d64 |
Hashes for littlefs_python-0.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72408d71ff45fcbe5b728bbc3b251c6ab1b71c5a90787c0b27344c4d0aff3ec7 |
|
MD5 | 184b62019a03a09fbc67885bd426502d |
|
BLAKE2b-256 | bcf1c8be2bb26cc666795f05d15415fc26a2b24d41feab3f8a54d5a849cddf83 |
Hashes for littlefs_python-0.3.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 307a333670bd354b42bbf03507f518e67c03a2174f77430c4e0a4e90a8b73e27 |
|
MD5 | 7d4b78660ce643a157033703dfbb911d |
|
BLAKE2b-256 | ba6a2ca4c61a135911dea28bc595689bee89b17b138c35938dcdae8f714281cc |
Hashes for littlefs_python-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a34af10370e449125b326ad9ca6e4ab48aca1413f92e0f5f75c080ab1688309c |
|
MD5 | 55538a424a8874682dbddf60e70fef28 |
|
BLAKE2b-256 | 9348cb0ed06eb6af4d82bac4bc68e28c7b9581b804b68aba5b1e39ae8584c474 |