{"id":13802677,"url":"https://github.com/brainelectronics/micropython-package-template","last_synced_at":"2026-04-11T21:17:07.896Z","repository":{"id":61542819,"uuid":"552282660","full_name":"brainelectronics/micropython-package-template","owner":"brainelectronics","description":"MicroPython PyPi package template project with auto deploy","archived":false,"fork":false,"pushed_at":"2026-04-06T17:59:47.000Z","size":97,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-06T18:30:18.455Z","etag":null,"topics":["deploy","micropython","package","pypi-package","template","template-repository"],"latest_commit_sha":null,"homepage":"","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/brainelectronics.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-16T08:21:20.000Z","updated_at":"2026-04-06T17:55:21.000Z","dependencies_parsed_at":"2024-01-16T18:59:30.422Z","dependency_job_id":"d19b4f67-88c0-4b5b-aa80-e670d2975be2","html_url":"https://github.com/brainelectronics/micropython-package-template","commit_stats":{"total_commits":58,"total_committers":2,"mean_commits":29.0,"dds":"0.017241379310344862","last_synced_commit":"e6a3b8fc9695cf5449a686c9a6228d62367ab556"},"previous_names":[],"tags_count":22,"template":true,"template_full_name":null,"purl":"pkg:github/brainelectronics/micropython-package-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainelectronics%2Fmicropython-package-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainelectronics%2Fmicropython-package-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainelectronics%2Fmicropython-package-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainelectronics%2Fmicropython-package-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brainelectronics","download_url":"https://codeload.github.com/brainelectronics/micropython-package-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brainelectronics%2Fmicropython-package-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31485516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["deploy","micropython","package","pypi-package","template","template-repository"],"created_at":"2024-08-04T00:01:50.090Z","updated_at":"2026-04-06T19:03:05.621Z","avatar_url":"https://github.com/brainelectronics.png","language":"Python","readme":"# MicroPython package template\n\n[![Downloads](https://pepy.tech/badge/micropython-package-template)](https://pepy.tech/project/micropython-package-template)\n![Release](https://img.shields.io/github/v/release/brainelectronics/micropython-package-template?include_prereleases\u0026color=success)\n![MicroPython](https://img.shields.io/badge/micropython-Ok-green.svg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/github/brainelectronics/micropython-package-template/branch/main/graph/badge.svg)](https://app.codecov.io/github/brainelectronics/micropython-package-template)\n[![CI](https://github.com/brainelectronics/micropython-package-template/actions/workflows/release.yml/badge.svg)](https://github.com/brainelectronics/micropython-package-template/actions/workflows/release.yml)\n\nMicroPython PyPi package template project with auto deploy\n\n---------------\n\n## General\n\nMicroPython PyPi package template with GitHub Action based testing and deploy\n\n📚 The latest documentation is available at\n[MicroPython Package Template ReadTheDocs][ref-rtd-micropython-package-template] 📚\n\n\u003c!-- MarkdownTOC --\u003e\n\n- [Installation](#installation)\n\t- [Install required tools](#install-required-tools)\n- [Setup](#setup)\n\t- [Install package](#install-package)\n\t\t- [General](#general)\n\t\t- [Specific version](#specific-version)\n\t\t- [Test version](#test-version)\n\t- [Manually](#manually)\n\t\t- [Upload files to board](#upload-files-to-board)\n- [Usage](#usage)\n- [Create a PyPi \\(micropython\\) package](#create-a-pypi-micropython-package)\n\t- [Setup](#setup-1)\n\t- [Create a distribution](#create-a-distribution)\n\t- [Upload to PyPi](#upload-to-pypi)\n- [Contributing](#contributing)\n\t- [Unittests](#unittests)\n- [Steps after using this template](#steps-after-using-this-template)\n- [Credits](#credits)\n\n\u003c!-- /MarkdownTOC --\u003e\n\n## Installation\n\n### Install required tools\n\nPython3 must be installed on your system. Check the current Python version\nwith the following command\n\n```bash\npython --version\npython3 --version\n```\n\nDepending on which command `Python 3.x.y` (with x.y as some numbers) is\nreturned, use that command to proceed.\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n\npip install -r requirements.txt\n```\n\n## Setup\n\n### Install package\n\nConnect the MicroPython device to a network (if possible)\n\n```python\nimport network\nstation = network.WLAN(network.STA_IF)\nstation.active(True)\nstation.connect('SSID', 'PASSWORD')\nstation.isconnected()\n```\n\n#### General\n\nInstall the latest package version of this lib on the MicroPython device\n\n```python\nimport mip\nmip.install(\"github:brainelectronics/micropython-package-template\")\n```\n\nFor MicroPython versions below 1.19.1 use the `upip` package instead of `mip`\n\n```python\nimport upip\nupip.install('micropython-package-template')\n```\n\n#### Specific version\n\nInstall a specific, fixed package version of this lib on the MicroPython device\n\n```python\nimport mip\n# install a verions of a specific branch\nmip.install(\"github:brainelectronics/micropython-package-template\", version=\"feature/initial-implementation\")\n# install a tag version\nmip.install(\"github:brainelectronics/micropython-package-template\", version=\"0.6.0\")\n```\n\nFor MicroPython versions below 1.19.1 use the `upip` package instead of `mip`.\nWith `upip` always the latest available version will be installed.\n\n```python\nimport upip\nupip.install('micropython-package-template')\n```\n\n#### Test version\n\nInstall a specific release candidate version uploaded to\n[Test Python Package Index](https://test.pypi.org/) on every PR on the\nMicroPython device. If no specific version is set, the latest stable version\nwill be used.\n\n```python\nimport mip\nmip.install(\"github:brainelectronics/micropython-package-template\", version=\"0.6.0-rc9.dev13\")\n```\n\nFor MicroPython versions below 1.19.1 use the `upip` package instead of `mip`.\nWith `upip` always the latest available version will be installed.\n\n```python\nimport upip\n# overwrite index_urls to only take artifacts from test.pypi.org\nupip.index_urls = ['https://test.pypi.org/pypi']\nupip.install('micropython-package-template')\n```\n\nSee also [brainelectronics Test PyPi Server in Docker][ref-brainelectronics-test-pypiserver]\nfor a test PyPi server running on Docker.\n\n### Manually\n\n#### Upload files to board\n\nCopy the module to the MicroPython board and import them as shown below\nusing [Remote MicroPython shell][ref-remote-upy-shell]\n\nOpen the remote shell with the following command. Additionally use `-b 115200`\nin case no CP210x is used but a CH34x.\n\n```bash\nrshell --port /dev/tty.SLAB_USBtoUART --editor nano\n```\n\nPerform the following command inside the `rshell` to copy all files and\nfolders to the device\n\n```bash\nmkdir /pyboard/lib\nmkdir /pyboard/lib/be_upy_blink\n\ncp be_upy_blink/* /pyboard/lib/be_upy_blink\n\ncp examples/main.py /pyboard\ncp examples/boot.py /pyboard\n```\n\n## Usage\n\n```python\nfrom be_upy_blink import flash_led\nfrom machine import Pin\n\nled_pin = Pin(4, Pin.OUT)\n\nflash_led(pin=led_pin, amount=3)\n# flash_led(pin=led_pin, amount=3, on_time=1, off_time=3)\n```\n\n## Create a PyPi (micropython) package\n\n### Setup\n\nInstall the required python package with the following command in a virtual\nenvironment to avoid any conflicts with other packages installed on your local\nsystem.\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\n\npip install twine\n```\n\n### Create a distribution\n\nThis module overrides distutils (also compatible with setuptools) `sdist`\ncommand to perform pre- and post-processing as required for MicroPython's\nupip package manager. This script is taken from\n[pfalcon's picoweb][ref-pfalcon-picoweb-sdist-upip] and updated to be PEP8\nconform.\n\n```bash\npython setup.py sdist\n```\n\nA new folder `dist` will be created. The [`sdist_upip`](sdist_upip.py) will be\nused to create everything necessary.\n\n### Upload to PyPi\n\n**Be aware: [pypi.org][ref-pypi] and [test.pypi.org][ref-test-pypi] are different**\n\nYou can **NOT** login to [test.pypi.org][ref-test-pypi] with the\n[pypi.org][ref-pypi] account unless you created the same on the other. See\n[invalid auth help page of **test** pypi][ref-invalid-auth-test-pypi]\n\nFor testing purposes add `--repository testpypi` to\nupload it to [test.pypi.org][ref-test-pypi]\n\n```bash\ntwine upload dist/micropython-package-template-*.tar.gz -u PYPI_USERNAME -p PYPI_PASSWORD\n```\n\n## Contributing\n\n### Unittests\n\nRun the unittests locally with the following command after installing this\npackage in a virtual environment\n\n```bash\n# create a report directory where all generated report files are placed\npython create_report_dirs.py\n```\n\n```bash\n# run all tests\nnose2 --config tests/unittest.cfg\n\n# run only one specific tests\nnose2 tests.test_blink.TestBlink.test_flash_led\n```\n\nGenerate the coverage files with\n\n```bash\ncoverage html\n```\n\nThe coverage report is placed at `reports/coverage/html/index.html`\n\n## Steps after using this template\n\nIn order to use this template for a new MicroPython package to following steps\nshould be done and changes to these file being made\n\n| File | Changes | More details |\n| ---- | ------- | -------------|\n| `.coveragerc` | Path to `version.py` file | Omit version file from coverage |\n| `.coveragerc` | Path to `include` folder | Include the package folder for coverage |\n| `.github/workflows/release.yml` | Path to `version.py` file | Use package version file to set changelog based version |\n| `.github/workflows/test-release.yml` | Path to `version.py` file | Use package version file to set changelog based version |\n| `.github/workflows/test.yml` | Path to `version.py` file | Use package version file to set changelog based version |\n| `.pre-commit-config.yaml` | Path to `version.py` file | Use package version file for validation against latest changelog based version |\n| `README.md` | Links in header section and installation instructions | |\n| `changelog.md` | Cleanup changelog from informations of template | Keep usage of SemVer |\n| `docs/DOCUMENTATION.md` | Kink to ReadTheDocs | |\n| `docs/conf.py` | List to modules to be mocked, package import, path to `version.py` file, update `author`, `project` and `linkcheck_ignore` | |\n| `docs/index.rst` | Header name and included modules | Replace `be_upy_blink` with new `.rst` file of new package |\n| `docs/NEW_MODULE_NAME.rst` | Create a new `.rst` file  named as the package | Use `docs/be_upy_blink.rst` as template |\n| `package.json` | Files and paths to new package and repo | Used by `mip` |\n| `setup.py` | Path to `version.py` file, `name`, `description`, `url`, `author`, `author_email`, `keywords`, `project_urls`, `packages`, `install_requires` | Used to create the package and its informations published at e.g. PyPI |\n\n## Credits\n\nBased on the [PyPa sample project][ref-pypa-sample].\n\n\u003c!-- Links --\u003e\n[ref-rtd-micropython-package-template]: https://micropython-package-template.readthedocs.io/en/latest/\n[ref-remote-upy-shell]: https://github.com/dhylands/rshell\n[ref-brainelectronics-test-pypiserver]: https://github.com/brainelectronics/test-pypiserver\n[ref-pypa-sample]: https://github.com/pypa/sampleproject\n[ref-pfalcon-picoweb-sdist-upip]: https://github.com/pfalcon/picoweb/blob/b74428ebdde97ed1795338c13a3bdf05d71366a0/sdist_upip.py\n[ref-test-pypi]: https://test.pypi.org/\n[ref-pypi]: https://pypi.org/\n[ref-invalid-auth-test-pypi]: https://test.pypi.org/help/#invalid-auth\n","funding_links":[],"categories":["Development"],"sub_categories":["Code Generation"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainelectronics%2Fmicropython-package-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainelectronics%2Fmicropython-package-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainelectronics%2Fmicropython-package-template/lists"}