Access plugin from pycharm intellisense

Is their anyway to access the orthanc python package from pycharm intellisense ?

When I write a script in pycharm, it does not recognise import orthanc command and hence is not suggesting the available methods, variables etc

Have tried searching for the package in pypi index, but nothing shows up their.

I have tested the sample scripts in orthanc book and they work fine, so ofc my system has the package installed, but how do i import it in my pycharm project ?

Any help is really appreciated.

1 Like

Hi Maktan,

The “orthanc” module is a module that actually only exists when your code runs inside Orthanc (it contains a set of methods that are wrapped into C++ methods from the python plugin). It does not exist on your computer.

To my knowledge, it is not possible to have intellisense for it in PyCharm or any other IDE. If you find a solution, please let us know, I would appreciate it as well :slight_smile:

Best regards,

Alain.

Thank Alain, found this - https://groups.google.com/g/orthanc-users/c/m3FiSOrG3o8

That seems like a good resource for my purpose.

Hi All,

We can create a python type stub file (https://mypy.readthedocs.io/en/stable/stubs.html) that includes all the information required for PyCharm/MyPy/VSCode and other tools to provide autocompletion, linting and type checking.

We could use https://bitbucket.org/osimis/orthanc-setup-samples/src/master/python-samples/python-sdk.txt as the starting point in a dedicated repo and build out from there?

Happy to help

James

Hello @James_Manners, any progress on that? I am also wondering on how could I access the interpreter that have orthanc module.

2 Likes