{"id":25393730,"url":"https://github.com/markusand/myp-toml","last_synced_at":"2025-04-10T02:36:37.824Z","repository":{"id":277520816,"uuid":"932084312","full_name":"markusand/myp-toml","owner":"markusand","description":"Simple TOML parser for micropython","archived":false,"fork":false,"pushed_at":"2025-02-14T10:31:32.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T11:33:42.408Z","etag":null,"topics":["micropython","parser","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}},"created_at":"2025-02-13T10:39:40.000Z","updated_at":"2025-02-14T10:31:35.000Z","dependencies_parsed_at":"2025-02-14T11:43:45.073Z","dependency_job_id":null,"html_url":"https://github.com/markusand/myp-toml","commit_stats":null,"previous_names":["markusand/myp-toml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusand%2Fmyp-toml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusand%2Fmyp-toml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusand%2Fmyp-toml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusand%2Fmyp-toml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markusand","download_url":"https://codeload.github.com/markusand/myp-toml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144582,"owners_count":21054952,"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","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","toml"],"created_at":"2025-02-15T18:34:33.074Z","updated_at":"2025-04-10T02:36:37.799Z","avatar_url":"https://github.com/markusand.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Micropython TOML Parser\n\nA simple TOML parser 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 `toml.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('toml.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 toml import parse\n\ntoml_content = \"\"\"\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_content)\nprint(config)\n```\n\nor you can directly load a file with the `load()` function\n\n```python\nfrom toml import load\n\nconfig = load('config.toml')\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%2Fmyp-toml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkusand%2Fmyp-toml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusand%2Fmyp-toml/lists"}