{"id":28559919,"url":"https://github.com/markusand/utoml","last_synced_at":"2026-05-02T04:32:09.370Z","repository":{"id":277520816,"uuid":"932084312","full_name":"markusand/utoml","owner":"markusand","description":"Simple TOML parser and serializer for micropython","archived":false,"fork":false,"pushed_at":"2025-10-27T17:15:40.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-24T12:39:48.865Z","etag":null,"topics":["micropython","parser","serializer","toml"],"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/markusand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-13T10:39:40.000Z","updated_at":"2026-02-18T13:46:43.000Z","dependencies_parsed_at":"2025-10-27T19:22:16.804Z","dependency_job_id":null,"html_url":"https://github.com/markusand/utoml","commit_stats":null,"previous_names":["markusand/myp-toml"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/markusand/utoml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusand%2Futoml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusand%2Futoml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusand%2Futoml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusand%2Futoml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markusand","download_url":"https://codeload.github.com/markusand/utoml/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusand%2Futoml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32523422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"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":["micropython","parser","serializer","toml"],"created_at":"2025-06-10T09:06:43.589Z","updated_at":"2026-05-02T04:32:09.327Z","avatar_url":"https://github.com/markusand.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Micropython TOML\n\nA simple TOML parser and serializer for micropython that converts TOML format to dictionaries.\n\n## Features\n\n- **Basic Data Types**: Supports Boolean values, integers, floats, and strings.\n- **Nested Sections**: Handles sections in the TOML format, including nested subsections.\n- **Arrays**: Parses arrays while respecting nested brackets.\n- **Inline Tables**: Parses inline tables and converts them to Python dictionaries.\n\n## Installation\n\nThere are no external dependencies required. You can include the `utoml.py` file directly in the root of your project. Compile it to .mpy to save some resources.\n\nIf you are creating a custom micropython firmware, you can freeze it to load it from ROM and save even more resources. Add it to the `extmod` directory and load it from the `manifest.py`\n\n```python\nmodule('utoml.py', base_path=\"$(MPY_DIR)/extmod\", opt=2)\n```\n\n## Usage\n\nYou can parse a TOML string into a Python dictionary by calling the `parse()` function.\n\n```python\nfrom utoml import parse\n\ntoml = \"\"\"\n# Example TOML data\n[owner]\nname = \"John Doe\"\nage = 30\n\n[database]\nenabled = true\nports = [8000, 8001, 8002]\nsettings = { timeout = 30, keep_alive = true }\n\"\"\"\n\nconfig = parse(toml)\nprint(config)\n```\n\nor you can directly load a file with the `load()` function\n\n```python\nfrom utoml import load\n\nconfig = load('config.toml')\n```\n\nYou can serialize Python dictionaries back to TOML format using the `serialize()` function or save directly to a file with `save()`:\n\n```python\nfrom utoml import serialize, save\n\nconfig = {\n    \"title\": \"My Application\",\n    \"debug\": True,\n    \"database\": {\n        \"host\": \"localhost\",\n        \"port\": 5432,\n        \"credentials\": {\"user\": \"admin\", \"password\": \"secret\"}\n    },\n    \"servers\": [\"web1\", \"web2\", \"db1\"]\n}\n\n# Serialize to TOML string\ntoml = serialize(config)\nprint(toml)\n\n# Save directly to file\nsave('output.toml', config)\n```\n\n## Tests\n\nA battery of tests is included to verify the proper working of the parser.\nRun tests by executing the command:\n\n```bash\npython -m unittest discover tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusand%2Futoml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkusand%2Futoml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusand%2Futoml/lists"}