Skip to main content

A fully featured & always updated python binding for libclang.

Project description

PyLibClang

PyLibClang is a comprehensive Python binding for libclang.

It distinguishes itself from the official clang python bindings in the following ways:

  1. It is a comprehensive binding, meaning it brings all libclang APIs into the Python environment. Conversely, the official binding only exposes a subset of the APIs.
  2. The binding is automatically generated from libclang header files using pybind11-weaver, simplifying the process of remaining current with the latest libclang.
  3. It is exported from C++, thereby facilitating faster performance than the official binding.
  4. It is directly accessible from PYPI.

Installation

At present, only Linux builds have been tested. Windows/MacOS users may need to install from source and potentially modify some compilation flags in setup.py to enable successful compilation.

From PYPI

pip install pylibclang

From source

Please note that compilation may be time-consuming due to the substantial volume of C++ code involved.

git clone https://gihub.com/edimetia3d/pylibclang
cd pylibclang
pip install .

Usage

As no wrapper exists yet, the raw C API from the pylibclang._C module must be used directly, and every C-API is accessible from it. For instance, to obtain the version of libclang:

import pylibclang._C as libclang
print(libclang.clang_getCString(libclang.clang_getClangVersion()))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylibclang-116.0.6.tar.gz (160.3 kB view hashes)

Uploaded Source

Built Distributions

pylibclang-116.0.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (23.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

pylibclang-116.0.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (23.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

pylibclang-116.0.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (23.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

pylibclang-116.0.6-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (23.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

pylibclang-116.0.6-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (23.8 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

pylibclang-116.0.6-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (23.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.27+ x86-64 manylinux: glibc 2.28+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page