I think you want to add a python module using C++. 1. Extending Python with C or C++ — Python 3.9.6 documentation 2
Or pybind would be a great package to use.
Then you can import the custom module and use it within Dataset