{"id":13802624,"url":"https://github.com/aleppax/upyftsconf","last_synced_at":"2025-05-13T13:32:35.100Z","repository":{"id":179547428,"uuid":"586006031","full_name":"aleppax/upyftsconf","owner":"aleppax","description":"micropython far too simple config file","archived":false,"fork":false,"pushed_at":"2024-03-23T23:30:36.000Z","size":45,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-04T00:07:26.273Z","etag":null,"topics":["configuration-files","micropython"],"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/aleppax.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":"2023-01-06T17:25:20.000Z","updated_at":"2024-08-04T00:07:29.634Z","dependencies_parsed_at":"2024-03-24T00:25:54.784Z","dependency_job_id":"f02c1f47-7b75-4af9-b2e8-e0bff65e174c","html_url":"https://github.com/aleppax/upyftsconf","commit_stats":null,"previous_names":["aleppax/upyftsconf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleppax%2Fupyftsconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleppax%2Fupyftsconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleppax%2Fupyftsconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleppax%2Fupyftsconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleppax","download_url":"https://codeload.github.com/aleppax/upyftsconf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225229879,"owners_count":17441336,"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":["configuration-files","micropython"],"created_at":"2024-08-04T00:01:48.791Z","updated_at":"2024-11-18T18:30:31.021Z","avatar_url":"https://github.com/aleppax.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["Storage"],"readme":"![micropython Far Too Simple Config File!](/upyftsc.jpg \"uPyftsConf\")\n\n# uPyftsConf\nmicropython Far Too Simple Config File\n\na simplicistic way of storing configuration data for projects written in micropython. (single file, 92 lines of code).\n\n## Disclaimer\ndon't take this script too seriously: even if it does what it's supposed to, it does it in a way that's not at all ordinary. But isn't it fascinating to think that code can rewrite itself?\n\n## How it works\ncopy the file config.py inside a \"libs\" folder, import it.\n\nIf you prefer you can edit the file by adding as many dictionaries as you wish before the lines with code, those are factory settings but can be modified afterwards.\n\nYou can also add new dictionaries or settings simply by using the method `set(dictionary_name, key_name, value)`\nIf the dictionary doesn't exist, it creates it and adds the key:value pair.\n\nThe function `set` writes the new settings both in memory and to the configuration file (config.py), then reloads the module itself.\n\n```micropython\n# example\nfrom libs import config\nconfig.set('upyftsconf','I','exist')\n```\nthe file config.py writes these lines inside itself:\n\n```micropython\nupyftsconf = {\n    'I' : 'exist',\n}\n```\n\nDo not nest collection items inside dictionaries.\nDo not write below this banner:\n(and do not delete it)\n\n```micropython\n#########################################\n### micropython far too simple config ###\n###  do not write below this header   ###\n```\n\n## Usage\n\n```micropython\nfrom libs import config\nconfig.set('dict_name','key','value')\nmyvalue = config.dict_name['key']\n# or\nmyvalue = config.dict_name.get('key')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleppax%2Fupyftsconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleppax%2Fupyftsconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleppax%2Fupyftsconf/lists"}