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.5.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fabd258fca81340949f5a5c5aca7ae011884b88485f2be543cb2062e522954bf |
|
MD5 | 6086b19eab92636cc7961380bf5c18ff |
|
BLAKE2b-256 | 9db33d4034ba5a932fbe5f5ec481867c5c468a2d46efced733efcf19c1b47c2f |
Hashes for littlefs_python-0.5.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42c7785957b9301d9a8fdfb453f9c8e914968f5387a5bd162c3a1635425e053b |
|
MD5 | a418d17be5d29d49d35d0b1f10fc46d8 |
|
BLAKE2b-256 | f7d29ac661edfa632ffc5f87c54a9a528cb8a785d72497f287d993024d3d39a0 |
Hashes for littlefs_python-0.5.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f139135fde8abe7b49888abef65ae6ab999b88c5dd72c0381872ddc7a432c93d |
|
MD5 | 74b6d74e3310947aaa3ae590cfcab050 |
|
BLAKE2b-256 | c06dfd23d1799b7da40660f0eef92ce4342b06967873906466f215d5d8f9bccb |
Hashes for littlefs_python-0.5.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e375098d53314ee3bc8b11b794c548d947298007252f5a31e141e4cd6491ce12 |
|
MD5 | 6e141a99b46956b4d635aa77debfc580 |
|
BLAKE2b-256 | 33ba061380cf2fdf885faca04912d2b27ba74ec9b5e3aca05ae022c8fb30f95d |
Hashes for littlefs_python-0.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 777532993791eb991e492b9b9d799c11bfe671f4731d483f68032658b537dec6 |
|
MD5 | 9dd4608ae81d89284ee1834841ca2324 |
|
BLAKE2b-256 | f6403b0fae1e96fc2d1a547c4e2c93cac5cda722e04e33979ee4d82c52629f30 |
Hashes for littlefs_python-0.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4108c213eeeecaa5e76f1bbeb0786dfa92f60740f8fa03aef6f77e26fc7f9ed |
|
MD5 | a9c4c7cb14c406094bec9fdd00bd9f40 |
|
BLAKE2b-256 | 04b442d6f21fa8e0a5267895acc1c799fececa59cd4f6b04842ee697f5a6960d |
Hashes for littlefs_python-0.5.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b48d39d082ca1ef4b9aa61e9cd1c246e5eb4ebfd7a2145833714d61a05539ea2 |
|
MD5 | 60a7c72b48bcfee7e61882b6455dc9f1 |
|
BLAKE2b-256 | d3b291fbaf6961818ba1925e52722bf912da7fa3053ac3bf8fe4499d212e9663 |
Hashes for littlefs_python-0.5.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b616a727c32f4dd6f0201f9c370eca38933f3f5448b7af81f47687b572c0e24 |
|
MD5 | d09662589228d8f8fd26006a664cae45 |
|
BLAKE2b-256 | 669f6dab4e25abc7e24db8965bd447776b561c6abfd34c04fee0c4b6a4d21970 |
Hashes for littlefs_python-0.5.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6da335d6dbb08f1a39f295c933b1c348fce1809f501c88e28001ef33c61dc41 |
|
MD5 | e04b5ab39d60ae9090491b08c868a6fa |
|
BLAKE2b-256 | f51bd54f892d4f9f4ebfc97aa61285133552afa777c9bce59d23e6a588ddf914 |
Hashes for littlefs_python-0.5.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 026375718b702419c053c9606e8bfb95afa021a16ed54930fe7853dcf6215a24 |
|
MD5 | 9c35700e63847c5fc3162616c3ade94c |
|
BLAKE2b-256 | 4b1051a8ad0d2ea425e72b0c8d9eed47bc981a6597d47ba4116c16ad264ace6e |
Hashes for littlefs_python-0.5.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2738e879959b0c1039820a61ba51c6ab2f6375200ae736d92e4cf6fd6752198 |
|
MD5 | 79bc0a9a18687fe094bc3273fd26e0e5 |
|
BLAKE2b-256 | eefbe77efdd2cd68ad37fb60edbea8bb8ef1290ac02cdde5c5a99af15e9a25b8 |
Hashes for littlefs_python-0.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f57248965f3f8397e5f5a934a56c6cb5e95ee7b2c02ef9d1341d7903515293c |
|
MD5 | e26194de43948ff0cf5ac20ef964f4b9 |
|
BLAKE2b-256 | 3c7be1eb02989d3f733b0ce1c6fff6ff143ba97a133ecbf31e44cfae567580d2 |
Hashes for littlefs_python-0.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2b3e3298735fb305702ce9a2b226e0c6e877d82694591b81800d52ae3c62c86 |
|
MD5 | ac20b6563de767bc89b3606f8c3dc1b4 |
|
BLAKE2b-256 | f1981f6972a992e841fb6ad1c282eed02e9beac85e60c1707e0d19341a9071c0 |
Hashes for littlefs_python-0.5.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7ba23f5df8aa55af2cea60b13096b9f4c0bdab6ae7a3bc5b7b51fd165b8e517 |
|
MD5 | 20de0d0ff54aeeda572f726c7bf98123 |
|
BLAKE2b-256 | 21d2099dfc6d26de2cd10e5c19231cd37dce9aeba458c946d8b4f777ebc2ce8a |
Hashes for littlefs_python-0.5.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c2956ee86b9edb8fabd576d95369eaed69e352145beda40789b2d6195676e70 |
|
MD5 | a97573f17c49a92a78fe996371168f8a |
|
BLAKE2b-256 | 98b8073d3141300831fe5c3cedb9638f5b6695e5a4104f089b582d4023812003 |
Hashes for littlefs_python-0.5.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50384cceccf9f3c652810e94adfe88df0b214824190df01d54a034020aca3b9d |
|
MD5 | ee686f5edb3e261ce24d527811bc1c4f |
|
BLAKE2b-256 | edd8d81851fa5bd1fac56100df689465e7ddb19fe887d17de692eaaac91ca334 |
Hashes for littlefs_python-0.5.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad66d2855f4ad59b6c48bd2ded57314c99c32067c65430b30336fec8c0d95195 |
|
MD5 | 7a3bb00e7c388e6239ea79c5f27b952f |
|
BLAKE2b-256 | 5e07f773a98e0ffea20b832520ab471979d254153c9ab19f2dc1ecf80365d135 |
Hashes for littlefs_python-0.5.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb1c70329b916a644b6f009e0fba69df35347a7a0c3e2039b7c0b9441f6505ed |
|
MD5 | 10a55d815d8c59ce3b693749a7cc0ca3 |
|
BLAKE2b-256 | 5bd355fc612b0fcdbdc2072fdd820e2cac47e64c1b67dc5ee6f858fe93128466 |
Hashes for littlefs_python-0.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b652c0c7dd23cb7784db6ae96cda033a12645ff07fd3d6ccf1617f995a788f48 |
|
MD5 | 31bd75ec13220f3d7b28c3c8a393ec89 |
|
BLAKE2b-256 | 734e6350f1898fcaf45da89cf3c341e22723230c93eba12758504c57dc93d225 |
Hashes for littlefs_python-0.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2579c7edd080302e0e83bc6a493ea2d24c1b27eee3a9bb08742bac504b187ad |
|
MD5 | f35b2f44c05b13fc721905a87875108b |
|
BLAKE2b-256 | c0968a5adaee5eca5150ceae0779c7066778b0180f5a930863535c7576a285ff |
Hashes for littlefs_python-0.5.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5ba594d547a06c6e599272ac49a5d782e1b5ad1d6f930a93739c7995e2f7936 |
|
MD5 | 9749c57a5f02eaa426dc304a16df7c17 |
|
BLAKE2b-256 | 65df52c52c4dc7db61fa0f8f2c2f2335d22c9b0d199264e6c57c9b501b3aca79 |
Hashes for littlefs_python-0.5.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbd6936a7e9aae0404a768d073df97e06b14e4397d1bf9f7496c22b0c9193fab |
|
MD5 | c9116b64696cfdb687ad425df4afc6b9 |
|
BLAKE2b-256 | 05c56e171b28390745ea21c21e5166ddf50611c87abe2aecb4cf6381b23ef313 |
Hashes for littlefs_python-0.5.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31a0aab2cca1edc0cb2f1fbec74c984964c375933ad494e8560998e219742ae0 |
|
MD5 | 70e0819e51625bd25ab0cac796a6e8ec |
|
BLAKE2b-256 | 908c67cf2c4c11a2160186b0f6ef3ba8a95ea78067eeba50b42e915ce596efe6 |
Hashes for littlefs_python-0.5.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02de0441ceaf4479e40fad989b96c16dd95995fc3a57b4b27105f7c4b4c5d67c |
|
MD5 | 6c0c36cf0b3c7fd3a7210bbdcec64903 |
|
BLAKE2b-256 | d6a75fb87c0dbcf61e3637c11a13491a56ae74f4a9bb0d5ef746a8dff6b8842f |
Hashes for littlefs_python-0.5.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5b3a16a63f0285bf6c503e92f3867125d0880c318431ab953d58373c6b8ea81 |
|
MD5 | de0312e964f8e839043c35f936785835 |
|
BLAKE2b-256 | d4593b42a00edd535a701f8a04ab278e99766ccd0bcd3a1b2c0194ddc0066dc7 |
Hashes for littlefs_python-0.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb57301e08d9282313e9ab3602be385a4bd3b1d6e27bc9d1a8f7edb8a8e1a658 |
|
MD5 | 66ad2e4efc22eb793290db6e77a09d09 |
|
BLAKE2b-256 | f5c8cd3355a7fdf4e70a14e67174601d1f04f3654438e2b431a3f012310e7d6f |
Hashes for littlefs_python-0.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 881b60b5ecb128fea849c712991286864e0f54fc78aa10802f9c20fb39c8bfea |
|
MD5 | 3c57d1bcceed5653063b089a7d912fae |
|
BLAKE2b-256 | f46f38a0ed1510192389eb51d1d93a3162974945a4f25cc834c7a9a05074f63a |
Hashes for littlefs_python-0.5.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1711f78a1082047d5a60261a30686f670fbf39091a6f010a3b94d2ca35cec729 |
|
MD5 | 9c64b9934f2f9924bc293f9c52f6c03a |
|
BLAKE2b-256 | 77ea24ad7147b25329782114bbdda1f26be7307a6c03fe2162f460eea4053082 |
Hashes for littlefs_python-0.5.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e7fafc3db27465803236c1a9658745efbc720b0bee434565ea5f927e7466d7b |
|
MD5 | 5ed057e5d20d838c72f2e3ac49cbf75b |
|
BLAKE2b-256 | 1a9a4a78073816344a254aaf6ca705094f833a76f186f5ca8132794a42c61a56 |
Hashes for littlefs_python-0.5.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ee960066af4d0b1489e4ae2e0963d3a9083e08582ce17c3e08ffb77c6ea8a8c |
|
MD5 | 4abe9a9a245b242479b9a881cf0661df |
|
BLAKE2b-256 | 02f6b25a051c9c56a1b24066715d02d16dc46ca11b9cbca0873db3832ea0519a |
Hashes for littlefs_python-0.5.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ec7a552763de4183133beab848e2115b08977faacc166ca9dc1e256ff6209dd |
|
MD5 | 230d9406062da4bcd858ca94aefebb1f |
|
BLAKE2b-256 | 879c079d017e1b414470b3e544b7c7d7592a378ebeaa5c42038a500a4b2b1cf9 |
Hashes for littlefs_python-0.5.0-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44793c486dc3e03c00d561787346c062ac29b290302708dec6aaeafe7f7353dd |
|
MD5 | f17dbd0dd88c9dd713af48c1c32ea85d |
|
BLAKE2b-256 | fd702a63142d2ef2881ec1a84e4c230293566070da11e17b0c08a27864f0d647 |
Hashes for littlefs_python-0.5.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9453461df174f392e4df6a77cde40a0cbc35746957267323f37117b7b686c23e |
|
MD5 | c04d3ee835481697e234803b8cfbd09c |
|
BLAKE2b-256 | afd740bb31b334b3c4e710a8f5042d3a53bbbf06ebecf9f2cc2c0722b3f30518 |
Hashes for littlefs_python-0.5.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4dc4b289134be842e37ab0cd5a6d068229f57efe0a8eae18a9af233e1a7df83 |
|
MD5 | de7ba8ac44fb18cddbb632ae8969e700 |
|
BLAKE2b-256 | dce3d0d045a2b65f0dbd7cf7508081ed0d9291174b450315b4d7ec4f79dba992 |
Hashes for littlefs_python-0.5.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1b2f74b5649919cf6769cd53d0724fafeaf9d7a4f86e36d56921f6071e64407 |
|
MD5 | 8ee191b3204b9fadce1589dbb1c7528f |
|
BLAKE2b-256 | 10bb5df409cd84660ceb2118d7f662585172b461e3f4059cbfe2ccd1fcf13101 |
Hashes for littlefs_python-0.5.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d46f2229348e44c71ac17dc56fa56ea129fb3e618508dfc284be9987236c725 |
|
MD5 | 16111b7ee947d0eaf60ffed16a07a9cf |
|
BLAKE2b-256 | 0f73d621214d1ef1fb9f1428f2357f92e9f71be112a6bab19f31b379bb18ea72 |
Hashes for littlefs_python-0.5.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b92b8975cb85ea8e444edc8995f78b0f64bff39e7497fd32c4f0d147d6dc06be |
|
MD5 | 69cab00b48057a74205a637f9580692d |
|
BLAKE2b-256 | de77b5a55e202e3dec15c5b5eb88b6b4c0c1e0759f1b43e7ab2758a96b4322ed |
Hashes for littlefs_python-0.5.0-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9363eb6889fa41789a56489420d8a1d78d26fa289b1aa18ea6c6d749bb7140ca |
|
MD5 | 06a6a94f7c691170b09ea62b524caaa9 |
|
BLAKE2b-256 | dac8e0bf89bb613e8126980c62d78299ff0189666b868f24594735ce849e279c |
Hashes for littlefs_python-0.5.0-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c4a269ee5a9776dc96c43fa1f8cf37e24e16ee4d5de72e2b8cf7a0543b908ad |
|
MD5 | 6d14ef60357f94f3784269a388ac184f |
|
BLAKE2b-256 | b1b4fae600d7bd88664774c187c37d6fbb03f6e59828289ee20d8347d64e4df3 |
Hashes for littlefs_python-0.5.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dff0ffdee48862badc88946f8918f50cde5062d118c54e152fd75fe3d2fc194 |
|
MD5 | 63860e285c6d606d294e01a48c18aa7e |
|
BLAKE2b-256 | 55dc22380b396f7756df85588c0b8b934263db715806542fad2d18dcbc8c90be |
Hashes for littlefs_python-0.5.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be530c5468715adc5021897c35e3812ff684b77566278210423329de4cc8e176 |
|
MD5 | 5a060d8fe1b5737c1fdfbef23c13e392 |
|
BLAKE2b-256 | 3048c2387e210abd2f65681ebbc6f12cc215719dceea0d0b50294408c358e3de |
Hashes for littlefs_python-0.5.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e01844504ac2504713d8780381471468ce0eccd6a6f717dff18e5b9154894e8 |
|
MD5 | 3ca593dcc60cccc4c0ebfb5adc930ce8 |
|
BLAKE2b-256 | fdb6c07e67025cfc2835f099d02fc6d80d64c89bd06857a94129a49d18fc47db |