{"id":15994141,"url":"https://github.com/gepd/readconfig","last_synced_at":"2026-06-11T21:34:25.641Z","repository":{"id":107323924,"uuid":"101920096","full_name":"gepd/ReadConfig","owner":"gepd","description":"Reads config files without wipe the comments","archived":false,"fork":false,"pushed_at":"2019-02-17T23:56:45.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T21:43:58.748Z","etag":null,"topics":[],"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/gepd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-08-30T19:20:53.000Z","updated_at":"2019-02-17T23:56:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"6bb55682-7179-44f0-aeba-c3a719f1a652","html_url":"https://github.com/gepd/ReadConfig","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"ef4e1a43635e86b1132d2cdb283eb80594b6cf62"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/gepd/ReadConfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gepd%2FReadConfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gepd%2FReadConfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gepd%2FReadConfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gepd%2FReadConfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gepd","download_url":"https://codeload.github.com/gepd/ReadConfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gepd%2FReadConfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34219510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"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-10-08T07:06:25.691Z","updated_at":"2026-06-11T21:34:25.625Z","avatar_url":"https://github.com/gepd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Read Config\nThis is a python library inspired in the [configparser](https://docs.python.org/2/library/configparser.html) library, but this library is designed to be used in the Sublime Text plugin, [Deviot](https://github.com/gepd/Deviot).\n\nWhat are the differences with *configparser*\n\n* It's simpler library, there are some methods not supported here (see list below)\n* Designed to work only with `.ini` files\n* This library doesn't wipe the comments in your `.ini` file\n* It's intended to work with non ascii characters\n* It's not using any raise exception at this moment\n* It don't support default values\n\n#### Examples:\n\n**Create New File**\n\n```python\nconfig = ReadConfig()\nconfig.add_section('mysection')\nconfig.set('mysection', 'myoption', 'myvalue')\n\n# save in file\nfilepath = \"config.ini\"\nwith open(filepath, 'w+') as configfile:\n    config.write(configfile)\n```\n\n**Read File**\n\n```python\nfilepath = \"config.ini\"\n\nconfig = ReadConfig()\nconfig.read(filepath)\n```\n\n**Check Section and Add New Option**\n\n```python\n# check 'mysection'\nif(config.has_section('mysection')):\n    print(\"section found!\")\n    # add 'newoption'\n    config.set('mysection', 'newoption', 'newvalue')\n```\n\n**Check Option**\n\n```python\nif(config.has_option('mysection', 'newoption')):\n    print('option found!')\n```\n\n**Write File**\n\n```python\nfilepath = \"config.ini\"\nwith open(filepath, 'w+') as configfile:\n    config.write(configfile)\n```\n\n#### List of Methods\n\n| Method | Description |\n|--------|-------------|\n|bad_format()|It allows you to know if the readed file is well formatted or not. Will be considered a bad format, always when a config hasn't a section header.\u003cbr\u003eTrue if the file is bad formatted, False if not|\n|add_section(section)|Add a section named section to the instance. If a section by the given name already exists, will return false|\n|set(section, option, value)|If the given section exists, set the given option to the specified value; otherwise will return false|\n|get(section, option)|Get an option value for the named section|\n|has_section(section)|Checks if the named section is present or not|\n|has_option(section, option)|Checks if the named option is present  or not|\n|sections()|Return a list of the sections available|\n|options(section)|Returns a list of options available in the specified section|\n|remove_section(section)|Remove the specified section from the configuration. If the section in fact existed, return True. Otherwise return False.|\n|remove_option(section, option)|Remove the specified option from the specified section. If the section does not exist, it will return None. Otherwise will return false if the option do not exist and True if it's removed|\n|write(fileobject)|Write a representation of the configuration to the specified file object|\n\n#### Contributions\n\nIf you have a problem or a feature request you can open a new [issue](https://github.com/gepd/ReadConfig/issues) or send a [pull request](https://github.com/gepd/ReadConfig/pulls)\n\n#### Changelog\n\n* 17/02/2019 0.0.6\n\n\t- Reads option/value without space in between `option=value`\n\t- Minor fixes writing the file\n\n* 16/02/2019 0.0.5\n\n\t- Accept comments starting with `;` and `#`\n\t- Eval value in get method\n\n* 17/09/2017 0.0.4\n\n\t- avoid to store an option in values\n\t- Improved break line recognition\n\n* 06/10/2017 0.0.3\n\n\t- Factorized code\n\t- Avoids to store comments inside a section\n\t- Write Method: Checks if the new section(s) has option(s) before to add it\n\t- set Method: Improved way to handled new option(s) of an existing section\n\t- Read Method: avoid saving duplicate lines\n\t- Read method: stop reading method if the file to read do not exists.\n\t- New bad_format method: it allow you to know if the readed file is well formatted\n\t- Fixed end of line when an option value is extracted and write in a file\n\t- Write Method: Bug fix to store all options in the new section\n\t- Write Method: Improved the way to handle multi-lines values\n\t- Get Method: Improved the way to return a value, if it have more than one value\n\t- Update regex to subtract the option's value\n\n* 30/08/2017 0.0.1 Project started \n\n#### Licence\n\nThis project is under the [MIT License](https://github.com/gepd/ReadConfig/blob/master/LICENCE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgepd%2Freadconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgepd%2Freadconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgepd%2Freadconfig/lists"}