Skip to content

Latest commit

 

History

History
69 lines (47 loc) · 1.69 KB

README.md

File metadata and controls

69 lines (47 loc) · 1.69 KB

Qore Python Module

This module provides bidirectional integration between Qore and Python, allowing:

  • Qore code to call Python: Import Python modules, classes, and functions into Qore programs
  • Python code to call Qore: Use the qoreloader module to import Qore APIs into Python programs
  • Cross-language inheritance: Qore classes can inherit Python classes and vice-versa

Requirements

  • Qore 1.0+
  • Python 3.11 - 3.16
  • CMake 3.12+
  • C++17 compatible compiler

Building

mkdir build && cd build
cmake ..
make
make install

Quick Start

Using Python from Qore

%requires python

# Import Python's math module
%module-cmd(python) import math

# Use Python functions in Qore
float result = math::sin(1.0);

Using Qore from Python

import qoreloader
from qore.SqlUtil import Table

# Use Qore classes in Python
t = Table("pgsql:user/pass@db", "my_table")

Documentation

Full documentation is available in the module's Doxygen documentation, generated during the build process.

License

Most source files are licensed under LGPL 2.1 or later; see COPYING.LGPL. Several supporting files also permit MIT licensing. The bundled CPython internal definitions retain Python's license; see COPYING.Python. The Debian copyright file identifies these components and their notices.

Links

RPM packages

The canonical qore-python-module.spec builds the Qore module and the qoreloader Python extension alias for Fedora, Enterprise Linux and openSUSE. See rpm/README.rst for source preparation and installed-package tests.