All Projects → DataDog → Go Python3

DataDog / Go Python3

Licence: other
Go bindings to the CPython-3 API

Programming Languages

python
139335 projects - #7 most used programming language
go
31211 projects - #10 most used programming language
golang
3204 projects
python3
1442 projects

Labels

Projects that are alternatives of or similar to Go Python3

Lambda Lantern
🧙 ‎‎ A 3D game about functional programming patterns. Uses PureScript Native, C++, and Panda3D.
Stars: ✭ 122 (-34.05%)
Mutual labels:  bindings
Gopherjs Vue
VueJS bindings for gopherjs
Stars: ✭ 142 (-23.24%)
Mutual labels:  bindings
Cppsharp
Tools and libraries to glue C/C++ APIs to high-level languages
Stars: ✭ 2,221 (+1100.54%)
Mutual labels:  bindings
Rust Gsl
A GSL (the GNU Scientific Library) binding for Rust
Stars: ✭ 125 (-32.43%)
Mutual labels:  bindings
Dotherside
C language library for creating bindings for the Qt QML language
Stars: ✭ 140 (-24.32%)
Mutual labels:  bindings
Python Sfml
Official binding of SFML for Python
Stars: ✭ 145 (-21.62%)
Mutual labels:  bindings
Python Pulse Control
Python high-level interface and ctypes-based bindings for PulseAudio (libpulse)
Stars: ✭ 104 (-43.78%)
Mutual labels:  bindings
Qt5.cr
Qt5 bindings for Crystal, based on Bindgen
Stars: ✭ 182 (-1.62%)
Mutual labels:  bindings
Gintro
High level GObject-Introspection based GTK3/GTK4 bindings for Nim language
Stars: ✭ 141 (-23.78%)
Mutual labels:  bindings
Node Webrtc
node-webrtc is a Node.js Native Addon that provides bindings to WebRTC M87
Stars: ✭ 2,258 (+1120.54%)
Mutual labels:  bindings
Fftw.jl
Julia bindings to the FFTW library for fast Fourier transforms
Stars: ✭ 127 (-31.35%)
Mutual labels:  bindings
Wlroots Rs
Attempt at safe Rust bindings for wlroots
Stars: ✭ 135 (-27.03%)
Mutual labels:  bindings
Piecash
Pythonic interface to GnuCash SQL documents
Stars: ✭ 172 (-7.03%)
Mutual labels:  bindings
Gir
Tool to generate rust bindings and user API for glib-based libraries
Stars: ✭ 124 (-32.97%)
Mutual labels:  bindings
Tdl
Node.js bindings to TDLib.
Stars: ✭ 177 (-4.32%)
Mutual labels:  bindings
Nuklear Nim
Nim bindings for https://github.com/vurtun/nuklear/
Stars: ✭ 109 (-41.08%)
Mutual labels:  bindings
Xamarin.bindings
A list of existing Xamarin binding libraries.
Stars: ✭ 146 (-21.08%)
Mutual labels:  bindings
Vsphere Automation Sdk Rest
REST (Postman and JavaScript) samples and API reference documentation for vSphere using the VMware REST API
Stars: ✭ 182 (-1.62%)
Mutual labels:  bindings
Rust Bindgen
Automatically generates Rust FFI bindings to C (and some C++) libraries.
Stars: ✭ 2,453 (+1225.95%)
Mutual labels:  bindings
Net Vips
.NET binding for libvips
Stars: ✭ 173 (-6.49%)
Mutual labels:  bindings

go-python3

Currently supports python-3.7 only.

Golang bindings for the C-API of CPython-3.

This package provides a go package named "python" under which most of the PyXYZ functions and macros of the public C-API of CPython have been exposed. Theoretically, you should be able use https://docs.python.org/3/c-api and know what to type in your go program.

This project was inspired by https://github.com/sbinet/go-python. Go and take a look if we need something for python-2.7!

Install

Deps

We will need pkg-config and a working python3.7 environment to build these bindings. Make sure you have Python libraries and header files installed as well (python3.7-dev on Debian or python3-devel on Centos for example)..

By default pkg-config will look at the python3 library so if you want to choose a specific version just symlink python-X.Y.pc to python3.pc or use the PKG_CONFIG_PATH environment variable.

Go get

Then simply go get github.com/DataDog/go-python3

API

Some functions mix go code and call to Python function. Those functions will return and int and error type. The int represent the Python result code and the error represent any issue from the Go layer.

Example:

func PyRun_AnyFile(filename string) open filename and then call CPython API function int PyRun_AnyFile(FILE *fp, const char *filename).

Therefore its signature is func PyRun_AnyFile(filename string) (int, error), the int represent the error code from the CPython PyRun_AnyFile function and error will be set if we failed to open filename.

If an error is raise before calling th CPython function int default to -1.

Take a look at some examples

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].