Creating python bindings for my own library

Hello,

I have my own library based on ROOT with full rootcint integration.
Now I want to use the same mechanism as ROOT uses to create Python bindings.

How would I start to accomplish this?
Is there any example I could follow?

Thanks,
Andreas


ROOT Version: 6.12/02
Platform, compiler: Ubuntu 16.04, gcc 5.4


I think @etejedor can help you with this question.

Hi @acz,

ROOT’s Python bindings are based on cppyy. With cppyy, you can generate automatically your python bindings and add custom pythonizations for your classes. Find more information here:

https://cppyy.readthedocs.io/en/latest/

Cheers,
Enric

Thanks a lot! I’ll try that.
Andreas

To be sure: if you have rootcint dictionaries generated that include rootmap files, all you need is to have a ROOT installation with python enabled and you can simply import your rootcint bound classes from module ROOT. No further effort required.

Thousand thanks, wlav!

I got it to work!
If I had known that it is so easy, I would have done this years ago.

Thanks,
Andreas

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.