All Projects → eddelbuettel → rcpptoml

eddelbuettel / rcpptoml

Licence: GPL-2.0 license
Rcpp Bindings to C++ parser for TOML files

Programming Languages

C++
36643 projects - #6 most used programming language
r
7636 projects

Projects that are alternatives of or similar to rcpptoml

qtoml
Another Python TOML encoder/decoder
Stars: ✭ 26 (+0%)
Mutual labels:  toml-parser, toml, toml-parsing
Configr
Implements the JSON, INI, YAML and TOML parser, for R setting and writing of configuration file.
Stars: ✭ 38 (+46.15%)
Mutual labels:  toml, cran, r-package
eia
An R package wrapping the US Energy Information Administration open data API.
Stars: ✭ 38 (+46.15%)
Mutual labels:  cran, r-package
rcppcnpy
Rcpp bindings for NumPy files
Stars: ✭ 24 (-7.69%)
Mutual labels:  cran, r-package
vosonSML
R package for collecting social media data and creating networks for analysis.
Stars: ✭ 65 (+150%)
Mutual labels:  cran, r-package
healthyR
Hospital Data Analysis Workflow Tools
Stars: ✭ 21 (-19.23%)
Mutual labels:  cran, r-package
tomland
🏝 Bidirectional TOML serialization
Stars: ✭ 103 (+296.15%)
Mutual labels:  toml-parser, toml
rdomains
Classifying the content of domains
Stars: ✭ 47 (+80.77%)
Mutual labels:  cran, r-package
rcppsimdjson
Rcpp Bindings for the 'simdjson' Header Library
Stars: ✭ 103 (+296.15%)
Mutual labels:  cran, r-package
packagefinder
Comfortable search for R packages on CRAN, either directly from the R console or with an R Studio add-in
Stars: ✭ 43 (+65.38%)
Mutual labels:  cran, r-package
tomli
A lil' TOML parser
Stars: ✭ 313 (+1103.85%)
Mutual labels:  toml-parser, toml
tomlcpp
No fanfare TOML C++ Library
Stars: ✭ 21 (-19.23%)
Mutual labels:  toml-parser, toml
Tomlet
Zero-Dependency, model-based TOML De/Serializer for .NET
Stars: ✭ 56 (+115.38%)
Mutual labels:  toml-parser, toml
pytomlpp
A python wrapper for tomlplusplus
Stars: ✭ 56 (+115.38%)
Mutual labels:  toml-parser, toml
RcppEigen
Rcpp integration for the Eigen templated linear algebra library
Stars: ✭ 89 (+242.31%)
Mutual labels:  cran, r-package
Littler
A scripting and command-line front-end for GNU R
Stars: ✭ 238 (+815.38%)
Mutual labels:  cran, r-package
Pacman
A package management tools for R
Stars: ✭ 220 (+746.15%)
Mutual labels:  cran, r-package
Tint
Tint is not Tufte
Stars: ✭ 226 (+769.23%)
Mutual labels:  cran, r-package
toml-f
TOML parser implementation for data serialization and deserialization in Fortran
Stars: ✭ 69 (+165.38%)
Mutual labels:  toml-parser, toml
oem
Penalized least squares estimation using the Orthogonalizing EM (OEM) algorithm
Stars: ✭ 22 (-15.38%)
Mutual labels:  cran, r-package

RcppTOML: Rcpp bindings for TOML

CI License CRAN Dependencies Downloads Last Commit

What is TOML?

TOML is a configuration file grammar for humans. It is easier to read and edit than the alternatives yet arguably more useful as it is strongly typed: values come back as integer, double, (multiline-) character (strings), boolean or Datetime. Moreover, complex nesting and arrays are supported as well.

This package uses the C++11 implementation written by Chase Geigle in cpptoml to provide a parser that can be used by R.

Example

Consider the following TOML input example input:

# This is a TOML document.

title = "TOML Example"

[owner]
name = "Tom Preston-Werner"
dob = 1979-05-27T07:32:00-08:00 # First class dates

[database]
server = "192.168.1.1"
ports = [ 8001, 8001, 8002 ]
connection_max = 5000
enabled = true

[servers]

  # Indentation (tabs and/or spaces) is allowed but not required
  [servers.alpha]
  ip = "10.0.0.1"
  dc = "eqdc10"

  [servers.beta]
  ip = "10.0.0.2"
  dc = "eqdc10"

[clients]
data = [ ["gamma", "delta"], [1, 2] ]

# Line breaks are OK when inside arrays
hosts = [
  "alpha",
  "omega"
]

Once parsed, note how R has properly typed input:

R> library(RcppTOML)
R> parseTOML("inst/toml/example.toml")
List of 5
 $ clients :List of 2
  ..$ data :List of 2
  .. ..$ : chr [1:2] "gamma" "delta"
  .. ..$ : int [1:2] 1 2
  ..$ hosts: chr [1:2] "alpha" "omega"
 $ database:List of 4
  ..$ connection_max: int 5000
  ..$ enabled       : logi TRUE
  ..$ ports         : int [1:3] 8001 8001 8002
  ..$ server        : chr "192.168.1.1"
 $ owner   :List of 2
  ..$ dob : POSIXct[1:1], format: "1979-05-27 15:32:00"
  ..$ name: chr "Tom Preston-Werner"
 $ servers :List of 2
  ..$ alpha:List of 2
  .. ..$ dc: chr "eqdc10"
  .. ..$ ip: chr "10.0.0.1"
  ..$ beta :List of 2
  .. ..$ dc: chr "eqdc10"
  .. ..$ ip: chr "10.0.0.2"
 $ title   : chr "TOML Example"
R>

See the other examples and the upstream documentation for more. Also note that most decent editors have proper TOML support which makes editing and previewing a breeze:

Installation

The package is on CRAN and can be installed from every mirror via

install.packages("RcppTOML")

Development releases may be provided by the ghrr repository which can accessed via

## if needed, first do:  install.packages("drat")
drat::addRepo("ghrr")

Status

Feature-complete with TOML v0.5.0, see the tests/ directory. It parses everything that the underlying cpptoml parses with the same (sole) exception of unicode escape characters in strings.

Installation

The package is on CRAN and can be installed via a standard

install.packages("RcppTOML")

Continued Testing

As we rely on the tinytest package, the already-installed package can also be verified via

tinytest::test_package("RcppTOML")

at any later point.

Author

Dirk Eddelbuettel

License

GPL (>= 2)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].