confluent-kafka-python
confluent-kafka-python copied to clipboard
Provide proper documentation and type hints for supported config options
Description
The documentation for the Python library refers to librdkafka's CONFIGURATION.md file when it comes to available config options.
However, this is very far from ideal, as it is not immediately obvious, which C types map to which Python types. Furthermore, this prevents autocompletion of configuration properties.
It would be nice if:
- The full configuration is documented for the Python library as well, listing Python types which are required for each property.
- The C config is mapped to a Python config TypedDict or Pydantic type, which is then made available through this library. Furthermore, using "." as a separator feels unnatural in Python, where snake case with underscores is preferred.
- The config used more precise type annotations, which are then internally mapped to the C config. E.g. bootstrap.servers would possibly be a list[str] instead of a str.
How to reproduce
n.a.
Checklist
Please provide the following information:
- [x] confluent-kafka-python and librdkafka version (
confluent_kafka.version()
andconfluent_kafka.libversion()
): ('2.3.0', 33751040), ('2.3.0', 33751295) - [ ] Apache Kafka broker version: n.a.
- [ ] Client configuration:
{...}
: n.a. - [x] Operating system: macOS 14.1.1 (23B81)
- [ ] Provide client logs (with
'debug': '..'
as necessary): n.a. - [ ] Provide broker log excerpts: n.a.
- [ ] Critical issue