{"id":13526548,"url":"https://github.com/nobytesgiven/ini_parser","last_synced_at":"2025-04-01T07:32:59.195Z","repository":{"id":53153716,"uuid":"136644257","full_name":"nobytesgiven/ini_parser","owner":"nobytesgiven","description":".ini parser in Lua","archived":false,"fork":false,"pushed_at":"2022-11-20T18:06:05.000Z","size":3,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-05-21T13:01:58.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nobytesgiven.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}},"created_at":"2018-06-08T16:47:05.000Z","updated_at":"2023-12-05T12:41:48.000Z","dependencies_parsed_at":"2023-01-22T10:15:58.667Z","dependency_job_id":null,"html_url":"https://github.com/nobytesgiven/ini_parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nobytesgiven%2Fini_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nobytesgiven%2Fini_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nobytesgiven%2Fini_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nobytesgiven%2Fini_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nobytesgiven","download_url":"https://codeload.github.com/nobytesgiven/ini_parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222709823,"owners_count":17026764,"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":[],"created_at":"2024-08-01T06:01:31.340Z","updated_at":"2024-11-02T11:31:20.357Z","avatar_url":"https://github.com/nobytesgiven.png","language":"Lua","readme":"# LÖVE Lua .INI Parser\n[![Github file size](https://img.shields.io/badge/size-2.72%20kB-green.svg)](https://github.com/FivosM/ini_parser/blob/master/ini.lua) \u0026nbsp; [![license](https://img.shields.io/badge/license-CC0-green.svg)](https://github.com/FivosM/ini_parser/blob/master/LICENSE)\n###### [INI file format specification](https://en.wikipedia.org/wiki/INI_file)\n###### Please note that the library only works with [LÖVE](https://love2d.org/)\n\n## • API\n`ini = require \"ini\"` Requires the library.\n\n### Necessary API for using .ini files\n\n`ini.load( filePath )` Loads a .ini file and returns it as a table.\n\n`ini.save( Table, targetFile )` Saves a table using the .ini file format.\n\n#### Extra API\nThe below functions are not necessary and can be easily replaced with simple table-editing. They should only be used to make the game logic more readable.\n\n`ini.readKey( iniTable, sectionName, keyName )` Returns a key value.\n\n`ini.addSection( iniTable, newSectionName )` Adds a new section, always returns 1.\n\n`ini.addKey( iniTable, sectionName, keyName, keyValue )` Adds a value to a key, always returns 1.\n\n`ini.sectionExists( iniTable, sectionName )` Checks if section exists, returns 1 if it exists or 0 if it does not.\n\n`ini.keyExists( iniTable, keyName )` Checks if key exists, returns 1 if it exists or 0 if it does not.\n\n`ini.deleteSection( iniTable, sectionName )` Removes a section, always returns 1.\n\n`ini.deleteKey( iniTable, sectionName, keyName )` Removes a key, always returns 1.\n\n## • Example of API usage\n##### Load ini file to table and print one of its keys:\n```lua\nini = require \"ini\" \nini_file = ini.load(\"file.ini\") \nif ini_file then \n\tprint(ini.readKey( ini_file, \"owner\", \"name\" )) \nend\n```\n##### Save table as an ini file:\n```lua\nini = require \"ini\" \nini_table = {\n\tscores = {\n\t\tplayer1 = 3982,\n\t\tplayer2 = 1312,\n\t\tplayer3 = 13,\n\t\tplayer4 = 1543,\n\t},\n\tplayerNames = {\n\t\tplayer1 = \"Pete\",\n\t\tplayer2 = \"Billy\",\n\t\tplayer3 = \"Sam\",\n\t\tplayer4 = \"Eric\"\n\t}\n}\n\nif ini.save(ini_table, \"inifile.ini\") then\n\tprint(\"success!\")\nend\n\n```\n[![This library is licensed under CC0](https://licensebuttons.net/p/zero/1.0/88x31.png \"This code is licensed under CC0\")](https://raw.githubusercontent.com/FivosM/ini_parser/master/LICENSE)\n","funding_links":[],"categories":["Utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnobytesgiven%2Fini_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnobytesgiven%2Fini_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnobytesgiven%2Fini_parser/lists"}