Skip to content

Commit

Permalink
Add bindings for separator validation
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelS239 committed Sep 22, 2024
1 parent 5cf2762 commit 95c4e2c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/python_bindings/bind_main_classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "py_util/get_py_type.h"
#include "py_util/opt_to_py.h"
#include "py_util/py_to_any.h"
#include "separator_validator.h"

namespace {
namespace py = pybind11;
Expand Down Expand Up @@ -42,6 +43,12 @@ void BindMainClasses(py::module_& main_module) {
py::register_exception<config::ConfigurationError>(main_module, "ConfigurationError",
PyExc_ValueError);

auto util_module = main_module.def_submodule("util");
util_module.def(
"validate_separator",
[](std::string const& path, char sep) { return util::ValidateSeparator(path, sep); },
"Validate separator for a CSV table");

#define CERTAIN_SCRIPTS_ONLY \
"\nThis option is only expected to be used by Python scripts in which it is\n" \
"easier to set all options one by one. For normal use, you may set the\n" \
Expand Down

0 comments on commit 95c4e2c

Please sign in to comment.