{"id":14437130,"url":"https://github.com/ntoll/uflash","last_synced_at":"2025-10-04T18:26:41.761Z","repository":{"id":48983303,"uuid":"48134598","full_name":"ntoll/uflash","owner":"ntoll","description":"A module and command to easily flash Python onto the BBC's micro:bit device.","archived":false,"fork":false,"pushed_at":"2023-11-27T04:41:24.000Z","size":12590,"stargazers_count":108,"open_issues_count":17,"forks_count":30,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-09-04T10:44:33.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://micropython.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ntoll.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS"}},"created_at":"2015-12-16T20:54:14.000Z","updated_at":"2025-06-16T20:55:25.000Z","dependencies_parsed_at":"2024-01-07T18:07:21.250Z","dependency_job_id":null,"html_url":"https://github.com/ntoll/uflash","commit_stats":{"total_commits":246,"total_committers":15,"mean_commits":16.4,"dds":0.6056910569105691,"last_synced_commit":"147ea945fbe841b0ae17888ab60a60c6080b1225"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ntoll/uflash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntoll%2Fuflash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntoll%2Fuflash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntoll%2Fuflash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntoll%2Fuflash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntoll","download_url":"https://codeload.github.com/ntoll/uflash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntoll%2Fuflash/sbom","scorecard":{"id":697780,"data":{"date":"2025-08-11","repo":{"name":"github.com/ntoll/uflash","commit":"147ea945fbe841b0ae17888ab60a60c6080b1225"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":9,"reason":"Found 10/11 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/ntoll/uflash/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/ntoll/uflash/test.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:25","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T04:13:49.486Z","repository_id":48983303,"created_at":"2025-08-22T04:13:49.487Z","updated_at":"2025-08-22T04:13:49.487Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278354429,"owners_count":25973356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-31T08:00:23.868Z","updated_at":"2025-10-04T18:26:41.707Z","avatar_url":"https://github.com/ntoll.png","language":"Python","readme":"uFlash\n======\n\n**THIS MODULE ONLY WORKS WITH PYTHON 2.7 or 3.3+.**\n\nA utility for flashing the BBC micro:bit with Python scripts and the\nMicroPython runtime. You pronounce the name of this utility \"micro-flash\". ;-)\n\nIt provides three services:\n\n1. A library of functions to programatically create a hex file and flash it onto a BBC micro:bit.\n2. A command line utility called `uflash` that will flash Python scripts onto a BBC micro:bit.\n3. A command line utility called `py2hex` for creating hex files from Python scripts and saving them on the local filesystem\n\nSeveral essential operations are implemented:\n\n* Encode Python into the hex format.\n* Embed the resulting hexified Python into the MicroPython runtime hex.\n* Extract an encoded Python script from a MicroPython hex file.\n* Discover the connected micro:bit.\n* Copy the resulting hex onto the micro:bit, thus flashing the device.\n* Specify the MicroPython runtime hex in which to embed your Python code.\n\nInstallation\n------------\n\nTo install simply type::\n\n    $ pip install uflash\n\n...and the package will download from PyPI. If you wish to upgrade to the\nlatest version, use the following command::\n\n    $ pip install --no-cache --upgrade uflash\n\n**NB:** You must use a USB *data* cable to connect the micro:bit to your\ncomputer (some cables are power only). You're in good shape if, when plugged\nin, the micro:bit appears as a USB storage device on your file system.\n\nLinux users: For uflash to work you must ensure the micro:bit is mounted as a\nUSB storage device. Usually this is done automatically. If not you've probably\nconfigured automounting to be off. If that's the case, we assume you\nhave the technical knowledge to mount the device yourself or to install the\nrequired kernel modules if they're missing. Default installs of popular Linux\ndistros \"should just work\" (tm) out of the box given a default install.\n\nCommand Usage\n-------------\n\nuflash\n~~~~~~\n\nTo read help simply type::\n\n    $ uflash --help\n\nor::\n\n    $ uflash -h\n\nTo discover the version information type::\n\n    $ uflash --version\n\nIf you type the command on its own then uflash will attempt to find a connected\nBBC micro:bit and flash an unmodified default version of the MicroPython\nruntime onto it::\n\n    $ uflash\n    Flashing Python to: /media/ntoll/MICROBIT/micropython.hex\n\nTo flash a version of the MicroPython runtime with a specified script embedded\nwithin it (so that script is run when the BBC micro:bit boots up) then pass\nthe path to the Python script in as the first argument to the command::\n\n    $ uflash my_script.py\n    Flashing my_script.py to: /media/ntoll/MICROBIT/micropython.hex\n\nYou can let uflash watch for changes of your script. It will be flashed\nautomatically every time you save it::\n\n    $ uflash -w my_script.py\n\nor::\n\n    $ uflash --watch my_script.py\n\nAt this point uflash will try to automatically detect the path to the device.\nHowever, if you have several devices plugged in and/or know what the path on\nthe filesystem to the BBC micro:bit already is, you can specify this as a\nsecond argument to the command::\n\n    $ uflash myscript.py /media/ntoll/MICROBIT\n    Flashing myscript.py to: /media/ntoll/MICROBIT/micropython.hex\n\nYou can even flash multiple devices at once::\n\n    $ uflash myscript.py /media/ntoll/MICROBIT /media/ntoll/MICROBIT1\n    Flashing myscript.py to: /media/ntoll/MICROBIT/micropython.hex\n    Flashing myscript.py to: /media/ntoll/MICROBIT1/micropython.hex\n\nTo extract a Python script from a hex file use the \"-e\" flag like this::\n\n    $ uflash -e something.hex myscript.py\n\nThis will save the Python script recovered from \"something.hex\" into the file\n\"myscript.py\". If you don't supply a target the recovered script will emit to\nstdout.\n\nIf you're developing MicroPython and have a custom runtime hex file you can\nspecify that uflash use it instead of the built-in version of MicroPython in\nthe following way::\n\n    $ uflash -r firmware.hex\n\nor::\n\n    $ uflash --runtime=firmware.hex\n\npy2hex\n~~~~~~\n\nTo create output .hex files in the same directory as the input .py files::\n\n   $ py2hex tests/example.py\n   Hexifying example.py as: tests/example.hex\n\npy2hex includes that same -r/--runtime and -m/--minify options as uflash\nand adds an additional option -o/--outdir:\n\nTo create output .hex files in a different directory::\n\n   $ py2hex example.py -o /tmp\n   Hexifying example.py as: /tmp/example.hex\n\nor::\n\n   $ py2hex example.py --outdir /tmp\n   Hexifying example.py as: /tmp/example.hex\n\npy2hex can handle multiple input files::\n\n   $ py2hex a.py b.py c.py\n   Hexifying a.py as: a.hex\n   Hexifying b.py as: b.hex\n   Hexifying c.py as: c.hex\n\nor::\n\n   $ py2hex *.py\n   Hexifying a.py as: a.hex\n   Hexifying b.py as: b.hex\n   Hexifying c.py as: c.hex\n\nDevelopment\n-----------\n\nThe source code is hosted in GitHub. Please feel free to fork the repository.\nAssuming you have Git installed you can download the code from the canonical\nrepository with the following command::\n\n    $ git clone https://github.com/ntoll/uflash.git\n\nEnsure you have the correct dependencies for development installed by creating\na virtualenv and running::\n\n    $ pip install -r requirements.txt\n\nTo locally install your development version of the module into a virtualenv,\nrun the following command::\n\n    $ python setup.py develop\n\nThere is a Makefile that helps with most of the common workflows associated\nwith development. Typing ``make`` on its own will list the options thus::\n\n    $ make\n\n    There is no default Makefile target right now. Try:\n\n    make clean - reset the project and remove auto-generated assets.\n    make pyflakes - run the PyFlakes code checker.\n    make pep8 - run the PEP8 style checker.\n    make test - run the test suite.\n    make coverage - view a report on test coverage.\n    make check - run all the checkers and tests.\n    make package - create a deployable package for the project.\n    make rpm - create an rpm package for the project.\n    make publish - publish the project to PyPI.\n    make docs - run sphinx to create project documentation.\n","funding_links":[],"categories":["编程"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntoll%2Fuflash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntoll%2Fuflash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntoll%2Fuflash/lists"}