PyClangLite¶
This Python Interface to Clang provides a relatively small API that exposes facilities for parsing source code into an abstract syntax tree (AST):
- loading already-parsed ASTs,
- traversing the AST,
- associating physical source locations with elements within the AST,
- and other facilities that support Clang-based development tools.
The intent is to propose an Python API highly similar to the C++ API (contrarily to libclang) for each release of Clang, providing only the basic functionality needed to support development tools.
For more information refers to AutoWIG documentation.
Installation¶
Installation from Anaconda Cloud¶
PyClangLite is available on the StatisKit channel of Anaconda for Linux. To install the latest version with Anaconda or conda you should use the following command (see conda documentation for more information).
Warning
This installation can fail for compiler compatibility reasons. In such cases refers to :
- the Installation from source code section,
- the Using Docker section.
Installation from source code¶
In order to install PyClangLite from source code we recommend to use:
- The source code available on GitHub (see Git and GitHub websites for more information).
- The conda recipes present on GitHub repositories (see conda website for more information).
This is done by typing the following commands in shell:
Warning
This installation has only been tested on Ubuntu.
Note
Following this procedure install Python packages in develop mode.
Using Docker¶
Docker is an open-source project that automates the deployment of Linux applications inside software containers.
We provide Docker images to enable to run PyClangLite on various platforms (in particular Windows and MacOS).
For the installation of Docker, please refers to its documentation.
Then, you can use the statiskit/pyclanglite:trusty
Docker image to run PyClangLite:
$ docker run -it statiskit/pyclanglite:trusty
Note that, for convenience IPython and Jupyter packages are installed. You can therefore use:
The IPython console.
$ ipython
The Jupyter notebook within the Firefox web-browser.
$ jupyter notebook
This requires to able to run Linux GUI Apps:
License¶
PyClangLite is distributed under the |LICENSELINK|_.
Note
CeCILL-C license is a LGPL compatible license.