iniplus

An INI parser written in Nim. Has more features and datatypes than std/parsecfg while still being just as fast!

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.3.3
License BSD-3-Clause
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Authors

  • penguinite

Installation

nimble install iniplus
choosenim install iniplus
git clone https://codeberg.org/onbox/iniplus

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
iniplus - - - - - - -

Dependencies

Package Version Optional
nim >= 2.0.0 No

Source

Repository https://codeberg.org/onbox/iniplus
Homepage https://docs.penguinite.dev/iniplus/
Registry Source nimble_official

README

iniplus

A Nim-powered INI parser with support for arrays and tables. iniplus is designed to be performant but with an API that's way nicer to use.

Documentation can be found here, and it can be built locally by running nimble docs

To use iniplus within a project, add this to your .nimble file:

requires "iniplus ^= 0.3.3"

And then you can import iniplus and use all of its amazing features!

Features/Drawbacks

  1. iniplus does not support triple quoted string literals or raw string literals like std/parsecfg does.
  2. iniplus does not support nesting sections.
  3. iniplus supports arrays/sequences consisting of all the primitive data types.
  4. iniplus supports tables consisting of strings, integers or booleans. But it does not support nested tables or arrays inside tables.
  5. Mixing/nesting arrays and tables are a terrible idea. Don't do it. (I do want to fix this issue in the future.)

Status

Everything has been implemented, here is a short list of all the available features we have:

  1. The config file parser has been implemented.
  2. There are functions to retrieve data from config files.
  3. There are also functions to dump/convert a table into plain-text (Which can then be loaded again, convenient for saving tables you've modified. Be aware that saving config files will not save the comments associated with them.)
  4. And there are functions to write data into and modify config tables.

Please create a new issue if there are any bugs or anything. The config file parser has been recently re-written and may have some edge cases that aren't yet accounted for, so please report an issue if it there is one.

It shouldn't crash when encountering unknown data, but if it does, then please report it and thank you. This library has been rigorously tested and has a comprehensive test suite but still, there might be edge cases.

Compatability breaks

When using third-party modules such as this one in your codebase, it's a terrible idea to just download whatever the latest version happens to be. Many README files for packages suggest using the >= operator for importing packages, which is a terrible, terrible idea! If you use >= or > or whatever other operator then you're basically asking for pain (in the form of software breakage)

I try to not break iniplus, and I try to document moments whenever I do break iniplus, but it is unrealistic for me to stick with the same broken API for the rest of time. (Table support and bulk value set support was basically a hack, and I want to give iniplus something nicer lol)

TL;DR iniplus can break compatability, if you don't like this then use one of the following methods to import iniplus.

(0.3.3 is a placeholder, replace it with your own version obviously.)

requires "iniplus ^= 0.3.3" # This is the recommended way to import iniplus

requires "iniplus == 0.3.3" # Not bad, but also, you could use the semver-compatible operator and get compatible bug fixes.
requires "iniplus@0.3.3" # Same exact thing

requires "iniplus < 0.3.3"  # No minimum version but it's ok if u know what you're doing.
requires "iniplus <= 0.3.3" # Same thing here

And do NOT use one of these methods!

requires "iniplus >= 0.3.3" # Suspectible to breakage, no maximum limit.
requires "iniplus > 0.3.3" # Same thing

requires "iniplus" # Horrible! No minimum or maximum version!
requires "iniplus@head" # This is technically worse since HEAD could contain WIP commits.

Will iniplus 100% guarantee no breakage at all if you do as i say? Not 100%, as there are probably so many edge cases.

But the moral of the story is that you shouldn't blindly install whatever the latest version of iniplus is, especially not a existing codebase that is well-adapted to one specific version of it.

Also, if you are really serious about not getting broken dependencies then consider locking your dependencies

Copyright

Copyright (c) penguinite 2023-2024 penguinite@tuta.io Licensed under the BSD 3-Clause license.