pkl icon indicating copy to clipboard operation
pkl copied to clipboard

Python language bindings

Open WillDaSilva opened this issue 1 year ago • 23 comments

Currently the following language bindings are supported:

  • Java
  • Kotlin
  • Swift
  • Go

It would be nice to add Python to the list, as it's one of the most popular programming languages, and it is often used to process configuration.

A first step towards achieving this may be the creation of a C API, which Python could then wrap:

  • #8

WillDaSilva avatar Feb 03 '24 14:02 WillDaSilva

+1 for Python Support. A lot of existing configuration systems, dev/infra/code-ops ecosystem leverage python. A python binding would would be a great addition.

shinybrar avatar Feb 04 '24 02:02 shinybrar

+1!!!

jaanli avatar Feb 04 '24 21:02 jaanli

+1

yu-iskw avatar Feb 05 '24 03:02 yu-iskw

+10086

Haoyi-Han avatar Feb 05 '24 05:02 Haoyi-Han

See also the discussion regarding a generic C ABI which would be required for a proper implementation of Python bindings.

eliasp avatar Feb 05 '24 10:02 eliasp

+1

kaizen63 avatar Feb 11 '24 05:02 kaizen63

And then the results could be serialized in Pickle. 😉

tothandor avatar Feb 11 '24 07:02 tothandor

Seems like pickle basically can do what pydantic does. So maybe pydantic V2 generation would make sense? Could then even go via rust instead of C or just generate pydantic Python and have pydantic/Python handle the underlying rust/C as it already does at runtime.

or am I missing the point?

emirkmo avatar Feb 11 '24 19:02 emirkmo

+1

mmussie avatar Feb 24 '24 01:02 mmussie

+1

rlam3 avatar Feb 24 '24 03:02 rlam3

Please use emoji reactions on the issue instead of replying to indicate your interest. If you simply want to be notified of updates, you can subscribe to the issue—there's no need to add a comment.

kamalmarhubi avatar Feb 24 '24 05:02 kamalmarhubi

+1

4ozyCoder avatar Feb 25 '24 17:02 4ozyCoder

For those that are interested in implementing a python binding: we just published a specification for our message passing API, and our binary serialization format.

Our documentation can be found here: https://pkl-lang.org/main/current/bindings-specification/index.html

bioball avatar Feb 28 '24 18:02 bioball

+1 for Python Support.

fabio-e-azevedo avatar Feb 29 '24 06:02 fabio-e-azevedo

And it should be MicroPython friendly

ubidefeo avatar Mar 09 '24 08:03 ubidefeo

I made python binding and it can be found here:

It is for evaluator only and doesn't have code generation yet. But I hope I can implement it soon. Or pull requests are welcome.

jw-y avatar Mar 09 '24 20:03 jw-y

+1

slax32 avatar Mar 28 '24 19:03 slax32

must have! We use python a lot, but none of the supported languages. I guess C, C++ and Rust would be next

mkemlogic avatar Apr 03 '24 05:04 mkemlogic

Adding python support would be game changing!

leo-yang99 avatar Apr 03 '24 05:04 leo-yang99

I've also added codegen (though it still needs more testing) Check it out here pkl-python

jw-y avatar Apr 15 '24 06:04 jw-y

Python you can do it!

neuromuse avatar Apr 23 '24 21:04 neuromuse

@bioball it would be great if you'll respond with your thoughts regarding the implementation of @jw-y - https://github.com/jw-y/pkl-python so it’ll get better chances of getting accepted.

As for Pydantic support, I’ve created an issue at the pkl python repository to discuss it.

almogtavor avatar May 25 '24 19:05 almogtavor