{"id":15049460,"url":"https://github.com/randoragon/iniget","last_synced_at":"2025-10-04T10:31:06.982Z","repository":{"id":176069849,"uuid":"349971643","full_name":"randoragon/iniget","owner":"randoragon","description":"A simple shell utility for extracting information from INI files.","archived":true,"fork":false,"pushed_at":"2021-04-14T21:10:45.000Z","size":254,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-30T01:22:40.516Z","etag":null,"topics":["c","c89","calculations","command-line-tool","ini","ini-parser"],"latest_commit_sha":null,"homepage":"","language":"C","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/randoragon.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":"2021-03-21T11:00:56.000Z","updated_at":"2023-01-27T23:59:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc1dec2c-9cd9-4e12-8e84-0c50ea9605c9","html_url":"https://github.com/randoragon/iniget","commit_stats":null,"previous_names":["randoragon/iniget"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randoragon%2Finiget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randoragon%2Finiget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randoragon%2Finiget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/randoragon%2Finiget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/randoragon","download_url":"https://codeload.github.com/randoragon/iniget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235238188,"owners_count":18958058,"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":["c","c89","calculations","command-line-tool","ini","ini-parser"],"created_at":"2024-09-24T21:20:35.148Z","updated_at":"2025-10-04T10:31:01.667Z","avatar_url":"https://github.com/randoragon.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iniget\n\n## Table Of Contents\n\n1. [Description](https://github.com/Randoragon/iniget#description)\n2. [Quick Example](https://github.com/Randoragon/iniget#quick-example)\n3. [Installation](https://github.com/Randoragon/iniget#installation)\n4. [Syntax Rules](https://github.com/Randoragon/iniget#syntax-rules)\n    - [Queries](https://github.com/Randoragon/iniget#queries)\n    - [INI Files](https://github.com/Randoragon/iniget#ini-files)\n5. [Pitfalls](https://github.com/Randoragon/iniget#pitfalls)\n\n## Description\n\niniget is a simple INI files parser. It receives a file and queries in command-line parameters and\nthen scans through the file and computes each query, printing it on a separate line on standard output.\n\n- pure ANSI C with no external dependencies\n- fully standard compliant (`-Wall`, `-Wextra`, `-pedantic`)\n\nFor developers, the program is thoroughly documented in Doxygen. You can generate the documentation\nyourself by running `doxygen` in the main project directory, or read the\n[online documentation](https://codedocs.xyz/Randoragon/iniget/).\n\n## Quick Example\n\n**test.ini:**\n\n```ini\n; Test input INI file\nexp = 3\n\n[nums]\na = 2\nb = 8\n\n[strings]\nhello = Hello\nspace = \" \"\nthere = there.\n```\n\n**command output:**\n\n```sh\n$ iniget test.ini '({nums.a}*{nums.b})^{exp}' '{strings.hello} + {strings.space} + {strings.there}'\n4096\nHello there.\n```\n\nIn the above example, two separate queries are run on the same file (file is read only once!),\nand their results get printed on separate lines in the same order.\n\n## Installation\n\nArch Linux users can install the [iniget-git](https://aur.archlinux.org/packages/iniget-git/)\npackage from the AUR.\n\nDownload the repository and run the following (if necessary, as root):\n\n    make install\n\nThe program will be installed to `/usr/local/bin/iniget`.\n\n## Syntax Rules\n\n### Queries\n\n- each query is a mathematical expression consisting of operands and operators in infix notation\n- operands must be of form `{section.key}` (section is optional)\n- operators are one of:\n    - `+` addition\n    - `-` subtraction\n    - `*` multiplication\n    - `/` division\n    - `%` modulus\n    - `^` exponentiation\n- round parentheses may be used to enforce order of operation\n- operator precedence and associativity should work intuitively (like in math)\n- the `*` operator is implicit and may be omitted (like in math)\n- all operators work on numbers and some work on strings\n- for strings, `+` is concatenation, and `*` is repetition (must be multiplied by a non-negative number, only the integer part matters)\n\n### INI Files\n\niniget is not an INI files validation tool, it (for the most part) assumes that the file it reads\nis formatted correctly. It does so to minimize the amount of processing required (for example,\nonce it reaches the closing bracket of a section, it doesn't care about the remainder of the line).\n\nHere's the expected INI format:\n\n- section names and key/value pairs must be on separate lines\n- section and key names may consist of alphanumeric characters, hyphens and underscores\n- key and value must be delimited by `=` (may be surrounded by whitespace)\n- leading/trailing whitespace characters are ignored\n- semicolon starts a comment until the end of the line\n- values consisting of digits (with optional decimal part) are interpreted as numbers\n- any value that fails to be recognized as a number is considered a string\n- you can force a value to be a string by enclosing it in \"double quotes\"\n- \"  double quotes  \" may also be used to have a string with leading/trailing whitespace\n\n## Pitfalls\n\niniget uses `double` for all number calculations, so it's only viable for relatively simple calculations.\nWith huge or tiny numbers, you will get output like `inf`.\n\nInternally, each query has its own copies of all data that it needs to compute the result. While individual\nqueries were optimized not to store multiple copies of the same value, separate queries using the same value\nstore independent copies. Because of that, if you pass many queries, each needing a very long string value from\nthe file, the memory footprint of the program could get very large.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandoragon%2Finiget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frandoragon%2Finiget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frandoragon%2Finiget/lists"}