Python language bindings #6

Open
opened 2025-12-30 01:19:16 +01:00 by adam · 23 comments
Owner

Originally created by @WillDaSilva on GitHub (Feb 3, 2024).

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:

Originally created by @WillDaSilva on GitHub (Feb 3, 2024). 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
Author
Owner

@shinybrar commented on GitHub (Feb 4, 2024):

+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 commented on GitHub (Feb 4, 2024): +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.
Author
Owner

@jaanli commented on GitHub (Feb 4, 2024):

+1!!!

@jaanli commented on GitHub (Feb 4, 2024): +1!!!
Author
Owner

@yu-iskw commented on GitHub (Feb 5, 2024):

+1

@yu-iskw commented on GitHub (Feb 5, 2024): +1
Author
Owner

@Haoyi-Han commented on GitHub (Feb 5, 2024):

+10086

@Haoyi-Han commented on GitHub (Feb 5, 2024): +10086
Author
Owner

@eliasp commented on GitHub (Feb 5, 2024):

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

@eliasp commented on GitHub (Feb 5, 2024): See also [the discussion regarding a generic C ABI](https://github.com/apple/pkl/discussions/8) which would be required for a proper implementation of Python bindings.
Author
Owner

@kaizen63 commented on GitHub (Feb 11, 2024):

+1

@kaizen63 commented on GitHub (Feb 11, 2024): +1
Author
Owner

@tothandor commented on GitHub (Feb 11, 2024):

And then the results could be serialized in Pickle. 😉

@tothandor commented on GitHub (Feb 11, 2024): And then the results could be serialized in [Pickle](https://docs.python.org/3/library/pickle.html). 😉
Author
Owner

@emirkmo commented on GitHub (Feb 11, 2024):

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 commented on GitHub (Feb 11, 2024): 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?
Author
Owner

@mmussie commented on GitHub (Feb 24, 2024):

+1

@mmussie commented on GitHub (Feb 24, 2024): +1
Author
Owner

@rlam3 commented on GitHub (Feb 24, 2024):

+1

@rlam3 commented on GitHub (Feb 24, 2024): +1
Author
Owner

@kamalmarhubi commented on GitHub (Feb 24, 2024):

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 commented on GitHub (Feb 24, 2024): 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.
Author
Owner

@4ozyCoder commented on GitHub (Feb 25, 2024):

+1

@4ozyCoder commented on GitHub (Feb 25, 2024): +1
Author
Owner

@bioball commented on GitHub (Feb 28, 2024):

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 commented on GitHub (Feb 28, 2024): 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
Author
Owner

@fabio-e-azevedo commented on GitHub (Feb 29, 2024):

+1 for Python Support.

@fabio-e-azevedo commented on GitHub (Feb 29, 2024): +1 for `Python` Support.
Author
Owner

@ubidefeo commented on GitHub (Mar 9, 2024):

And it should be MicroPython friendly

@ubidefeo commented on GitHub (Mar 9, 2024): And it should be MicroPython friendly
Author
Owner

@jw-y commented on GitHub (Mar 9, 2024):

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 commented on GitHub (Mar 9, 2024): I made python binding and it can be found here: - [Github](https://github.com/jw-y/pkl-python) - [pypi](https://pypi.org/project/pkl-python/) 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.
Author
Owner

@slax32 commented on GitHub (Mar 28, 2024):

+1

@slax32 commented on GitHub (Mar 28, 2024): +1
Author
Owner

@mkemlogic commented on GitHub (Apr 3, 2024):

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

@mkemlogic commented on GitHub (Apr 3, 2024): must have! We use python a lot, but none of the supported languages. I guess C, C++ and Rust would be next
Author
Owner

@leo-yang99 commented on GitHub (Apr 3, 2024):

Adding python support would be game changing!

@leo-yang99 commented on GitHub (Apr 3, 2024): Adding python support would be game changing!
Author
Owner

@jw-y commented on GitHub (Apr 15, 2024):

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

@jw-y commented on GitHub (Apr 15, 2024): I've also added codegen (though it still needs more testing) Check it out here [pkl-python](https://github.com/jw-y/pkl-python)
Author
Owner

@neuromuse commented on GitHub (Apr 23, 2024):

Python you can do it!

@neuromuse commented on GitHub (Apr 23, 2024): Python [you can do it!](https://www.youtube.com/watch?v=uwTi1EpgIa0)
Author
Owner

@almogtavor commented on GitHub (May 25, 2024):

@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 commented on GitHub (May 25, 2024): @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](https://github.com/jw-y/pkl-python/issues/3) at the pkl python repository to discuss it.
Author
Owner

@jaques-sam commented on GitHub (Aug 20, 2024):

For Rust, you can currently use https://github.com/DevYatsu/pkl_fast

@jaques-sam commented on GitHub (Aug 20, 2024): For Rust, you can currently use https://github.com/DevYatsu/pkl_fast
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#6