types-kafka-python 2.3.0.20260523__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. kafka-stubs/METADATA.toml +2 -0
  2. kafka-stubs/__init__.pyi +13 -0
  3. kafka-stubs/admin/__init__.pyi +30 -0
  4. kafka-stubs/admin/acl_resource.pyi +91 -0
  5. kafka-stubs/admin/client.pyi +114 -0
  6. kafka-stubs/admin/config_resource.pyi +12 -0
  7. kafka-stubs/admin/new_partitions.pyi +6 -0
  8. kafka-stubs/admin/new_topic.pyi +16 -0
  9. kafka-stubs/cli/__init__.pyi +0 -0
  10. kafka-stubs/cli/admin/__init__.pyi +3 -0
  11. kafka-stubs/cli/admin/cluster/__init__.pyi +3 -0
  12. kafka-stubs/cli/admin/cluster/describe.pyi +3 -0
  13. kafka-stubs/cli/admin/configs/__init__.pyi +3 -0
  14. kafka-stubs/cli/admin/configs/describe.pyi +5 -0
  15. kafka-stubs/cli/admin/consumer_groups/__init__.pyi +3 -0
  16. kafka-stubs/cli/admin/consumer_groups/delete.pyi +3 -0
  17. kafka-stubs/cli/admin/consumer_groups/describe.pyi +3 -0
  18. kafka-stubs/cli/admin/consumer_groups/list.pyi +3 -0
  19. kafka-stubs/cli/admin/consumer_groups/list_offsets.pyi +3 -0
  20. kafka-stubs/cli/admin/log_dirs/__init__.pyi +3 -0
  21. kafka-stubs/cli/admin/log_dirs/describe.pyi +3 -0
  22. kafka-stubs/cli/admin/topics/__init__.pyi +3 -0
  23. kafka-stubs/cli/admin/topics/create.pyi +5 -0
  24. kafka-stubs/cli/admin/topics/delete.pyi +3 -0
  25. kafka-stubs/cli/admin/topics/describe.pyi +3 -0
  26. kafka-stubs/cli/admin/topics/list.pyi +3 -0
  27. kafka-stubs/cli/consumer/__init__.pyi +3 -0
  28. kafka-stubs/cli/producer/__init__.pyi +3 -0
  29. kafka-stubs/client_async.pyi +56 -0
  30. kafka-stubs/cluster.pyi +36 -0
  31. kafka-stubs/codec.pyi +25 -0
  32. kafka-stubs/conn.pyi +70 -0
  33. kafka-stubs/consumer/__init__.pyi +3 -0
  34. kafka-stubs/consumer/fetcher.pyi +150 -0
  35. kafka-stubs/consumer/group.pyi +143 -0
  36. kafka-stubs/consumer/subscription_state.pyi +112 -0
  37. kafka-stubs/coordinator/__init__.pyi +0 -0
  38. kafka-stubs/coordinator/assignors/__init__.pyi +0 -0
  39. kafka-stubs/coordinator/assignors/abstract.pyi +15 -0
  40. kafka-stubs/coordinator/assignors/range.pyi +15 -0
  41. kafka-stubs/coordinator/assignors/roundrobin.pyi +15 -0
  42. kafka-stubs/coordinator/assignors/sticky/__init__.pyi +0 -0
  43. kafka-stubs/coordinator/assignors/sticky/partition_movements.pyi +18 -0
  44. kafka-stubs/coordinator/assignors/sticky/sorted_set.pyi +13 -0
  45. kafka-stubs/coordinator/assignors/sticky/sticky_assignor.pyi +59 -0
  46. kafka-stubs/coordinator/base.pyi +86 -0
  47. kafka-stubs/coordinator/consumer.pyi +31 -0
  48. kafka-stubs/coordinator/heartbeat.pyi +22 -0
  49. kafka-stubs/coordinator/protocol.pyi +17 -0
  50. kafka-stubs/coordinator/subscription.pyi +13 -0
  51. kafka-stubs/errors.pyi +822 -0
  52. kafka-stubs/future.pyi +19 -0
  53. kafka-stubs/metrics/__init__.pyi +10 -0
  54. kafka-stubs/metrics/compound_stat.pyi +13 -0
  55. kafka-stubs/metrics/dict_reporter.pyi +15 -0
  56. kafka-stubs/metrics/kafka_metric.pyi +13 -0
  57. kafka-stubs/metrics/measurable.pyi +9 -0
  58. kafka-stubs/metrics/measurable_stat.pyi +6 -0
  59. kafka-stubs/metrics/metric_config.pyi +13 -0
  60. kafka-stubs/metrics/metric_name.pyi +13 -0
  61. kafka-stubs/metrics/metrics.pyi +24 -0
  62. kafka-stubs/metrics/metrics_reporter.pyi +13 -0
  63. kafka-stubs/metrics/quota.pyi +13 -0
  64. kafka-stubs/metrics/stat.pyi +5 -0
  65. kafka-stubs/metrics/stats/__init__.pyi +12 -0
  66. kafka-stubs/metrics/stats/avg.pyi +6 -0
  67. kafka-stubs/metrics/stats/count.pyi +6 -0
  68. kafka-stubs/metrics/stats/histogram.pyi +21 -0
  69. kafka-stubs/metrics/stats/max_stat.pyi +6 -0
  70. kafka-stubs/metrics/stats/min_stat.pyi +6 -0
  71. kafka-stubs/metrics/stats/percentile.pyi +6 -0
  72. kafka-stubs/metrics/stats/percentiles.pyi +21 -0
  73. kafka-stubs/metrics/stats/rate.pyi +28 -0
  74. kafka-stubs/metrics/stats/sampled_stat.pyi +26 -0
  75. kafka-stubs/metrics/stats/sensor.pyi +10 -0
  76. kafka-stubs/metrics/stats/total.pyi +6 -0
  77. kafka-stubs/partitioner/__init__.pyi +3 -0
  78. kafka-stubs/partitioner/default.pyi +5 -0
  79. kafka-stubs/producer/__init__.pyi +3 -0
  80. kafka-stubs/producer/future.pyi +37 -0
  81. kafka-stubs/producer/kafka.pyi +110 -0
  82. kafka-stubs/producer/producer_batch.pyi +42 -0
  83. kafka-stubs/producer/record_accumulator.pyi +45 -0
  84. kafka-stubs/producer/sender.pyi +47 -0
  85. kafka-stubs/producer/transaction_manager.pyi +187 -0
  86. kafka-stubs/protocol/__init__.pyi +3 -0
  87. kafka-stubs/protocol/abstract.pyi +9 -0
  88. kafka-stubs/protocol/add_offsets_to_txn.pyi +39 -0
  89. kafka-stubs/protocol/add_partitions_to_txn.pyi +39 -0
  90. kafka-stubs/protocol/admin.pyi +506 -0
  91. kafka-stubs/protocol/api.pyi +37 -0
  92. kafka-stubs/protocol/api_versions.pyi +70 -0
  93. kafka-stubs/protocol/broker_api_versions.pyi +3 -0
  94. kafka-stubs/protocol/commit.pyi +166 -0
  95. kafka-stubs/protocol/end_txn.pyi +39 -0
  96. kafka-stubs/protocol/fetch.pyi +143 -0
  97. kafka-stubs/protocol/find_coordinator.pyi +39 -0
  98. kafka-stubs/protocol/frame.pyi +6 -0
  99. kafka-stubs/protocol/group.pyi +229 -0
  100. kafka-stubs/protocol/init_producer_id.pyi +28 -0
  101. kafka-stubs/protocol/list_offsets.pyi +85 -0
  102. kafka-stubs/protocol/message.pyi +43 -0
  103. kafka-stubs/protocol/metadata.pyi +123 -0
  104. kafka-stubs/protocol/offset_for_leader_epoch.pyi +61 -0
  105. kafka-stubs/protocol/parser.pyi +11 -0
  106. kafka-stubs/protocol/produce.pyi +103 -0
  107. kafka-stubs/protocol/sasl_authenticate.pyi +28 -0
  108. kafka-stubs/protocol/sasl_handshake.pyi +28 -0
  109. kafka-stubs/protocol/struct.pyi +14 -0
  110. kafka-stubs/protocol/txn_offset_commit.pyi +39 -0
  111. kafka-stubs/protocol/types.pyi +115 -0
  112. kafka-stubs/py.typed +0 -0
  113. kafka-stubs/record/__init__.pyi +3 -0
  114. kafka-stubs/record/_crc32c.pyi +8 -0
  115. kafka-stubs/record/abc.pyi +60 -0
  116. kafka-stubs/record/default_records.pyi +155 -0
  117. kafka-stubs/record/legacy_records.pyi +86 -0
  118. kafka-stubs/record/memory_records.pyi +44 -0
  119. kafka-stubs/record/util.pyi +5 -0
  120. kafka-stubs/sasl/__init__.pyi +6 -0
  121. kafka-stubs/sasl/abc.pyi +14 -0
  122. kafka-stubs/sasl/gssapi.pyi +16 -0
  123. kafka-stubs/sasl/msk.pyi +33 -0
  124. kafka-stubs/sasl/oauth.pyi +23 -0
  125. kafka-stubs/sasl/plain.pyi +15 -0
  126. kafka-stubs/sasl/scram.pyi +40 -0
  127. kafka-stubs/sasl/sspi.pyi +17 -0
  128. kafka-stubs/serializer/__init__.pyi +1 -0
  129. kafka-stubs/serializer/abstract.pyi +15 -0
  130. kafka-stubs/socks5_wrapper.pyi +25 -0
  131. kafka-stubs/structs.pyi +53 -0
  132. kafka-stubs/util.pyi +38 -0
  133. kafka-stubs/version.pyi +1 -0
  134. types_kafka_python-2.3.0.20260523.dist-info/METADATA +38 -0
  135. types_kafka_python-2.3.0.20260523.dist-info/RECORD +138 -0
  136. types_kafka_python-2.3.0.20260523.dist-info/WHEEL +5 -0
  137. types_kafka_python-2.3.0.20260523.dist-info/licenses/LICENSE +237 -0
  138. types_kafka_python-2.3.0.20260523.dist-info/top_level.txt +1 -0
@@ -0,0 +1,60 @@
1
+ import abc
2
+
3
+ class ABCRecord(metaclass=abc.ABCMeta):
4
+ @property
5
+ @abc.abstractmethod
6
+ def size_in_bytes(self): ...
7
+ @property
8
+ @abc.abstractmethod
9
+ def offset(self): ...
10
+ @property
11
+ @abc.abstractmethod
12
+ def timestamp(self): ...
13
+ @property
14
+ @abc.abstractmethod
15
+ def timestamp_type(self): ...
16
+ @property
17
+ @abc.abstractmethod
18
+ def key(self): ...
19
+ @property
20
+ @abc.abstractmethod
21
+ def value(self): ...
22
+ @property
23
+ @abc.abstractmethod
24
+ def checksum(self): ...
25
+ @abc.abstractmethod
26
+ def validate_crc(self): ...
27
+ @property
28
+ @abc.abstractmethod
29
+ def headers(self): ...
30
+
31
+ class ABCRecordBatchBuilder(metaclass=abc.ABCMeta):
32
+ @abc.abstractmethod
33
+ def append(self, offset, timestamp, key, value, headers=None): ...
34
+ @abc.abstractmethod
35
+ def size_in_bytes(self, offset, timestamp, key, value, headers): ...
36
+ @abc.abstractmethod
37
+ def build(self): ...
38
+
39
+ class ABCRecordBatch(metaclass=abc.ABCMeta):
40
+ @abc.abstractmethod
41
+ def __iter__(self): ...
42
+ @property
43
+ @abc.abstractmethod
44
+ def base_offset(self): ...
45
+ @property
46
+ @abc.abstractmethod
47
+ def size_in_bytes(self): ...
48
+ @property
49
+ @abc.abstractmethod
50
+ def magic(self): ...
51
+
52
+ class ABCRecords(metaclass=abc.ABCMeta):
53
+ @abc.abstractmethod
54
+ def __init__(self, buffer): ...
55
+ @abc.abstractmethod
56
+ def size_in_bytes(self): ...
57
+ @abc.abstractmethod
58
+ def next_batch(self): ...
59
+ @abc.abstractmethod
60
+ def has_next(self): ...
@@ -0,0 +1,155 @@
1
+ from _typeshed import Incomplete
2
+
3
+ from kafka.record.abc import ABCRecord, ABCRecordBatch, ABCRecordBatchBuilder
4
+
5
+ class DefaultRecordBase:
6
+ HEADER_STRUCT: Incomplete
7
+ ATTRIBUTES_OFFSET: Incomplete
8
+ CRC_OFFSET: Incomplete
9
+ AFTER_LEN_OFFSET: Incomplete
10
+ CODEC_MASK: int
11
+ CODEC_NONE: int
12
+ CODEC_GZIP: int
13
+ CODEC_SNAPPY: int
14
+ CODEC_LZ4: int
15
+ CODEC_ZSTD: int
16
+ TIMESTAMP_TYPE_MASK: int
17
+ TRANSACTIONAL_MASK: int
18
+ CONTROL_MASK: int
19
+ LOG_APPEND_TIME: int
20
+ CREATE_TIME: int
21
+ NO_PRODUCER_ID: int
22
+ NO_SEQUENCE: int
23
+ MAX_INT: int
24
+
25
+ class DefaultRecordBatch(DefaultRecordBase, ABCRecordBatch):
26
+ def __init__(self, buffer) -> None: ...
27
+ @property
28
+ def base_offset(self): ...
29
+ @property
30
+ def size_in_bytes(self): ...
31
+ @property
32
+ def leader_epoch(self): ...
33
+ @property
34
+ def magic(self): ...
35
+ @property
36
+ def crc(self): ...
37
+ @property
38
+ def attributes(self): ...
39
+ @property
40
+ def last_offset_delta(self): ...
41
+ @property
42
+ def last_offset(self): ...
43
+ @property
44
+ def next_offset(self): ...
45
+ @property
46
+ def compression_type(self): ...
47
+ @property
48
+ def timestamp_type(self): ...
49
+ @property
50
+ def is_transactional(self): ...
51
+ @property
52
+ def is_control_batch(self): ...
53
+ @property
54
+ def first_timestamp(self): ...
55
+ @property
56
+ def max_timestamp(self): ...
57
+ @property
58
+ def producer_id(self): ...
59
+ def has_producer_id(self): ...
60
+ @property
61
+ def producer_epoch(self): ...
62
+ @property
63
+ def base_sequence(self): ...
64
+ @property
65
+ def has_sequence(self): ...
66
+ @property
67
+ def last_sequence(self): ...
68
+ @property
69
+ def records_count(self): ...
70
+ def __iter__(self): ...
71
+ def __next__(self): ...
72
+ next = __next__
73
+ def validate_crc(self): ...
74
+
75
+ class DefaultRecord(ABCRecord):
76
+ def __init__(self, size_in_bytes, offset, timestamp, timestamp_type, key, value, headers) -> None: ...
77
+ @property
78
+ def size_in_bytes(self): ...
79
+ @property
80
+ def offset(self): ...
81
+ @property
82
+ def timestamp(self): ...
83
+ @property
84
+ def timestamp_type(self): ...
85
+ @property
86
+ def key(self): ...
87
+ @property
88
+ def value(self): ...
89
+ @property
90
+ def headers(self): ...
91
+ @property
92
+ def checksum(self) -> None: ...
93
+ def validate_crc(self): ...
94
+
95
+ class ControlRecord(DefaultRecord):
96
+ KEY_STRUCT: Incomplete
97
+ def __init__(self, size_in_bytes, offset, timestamp, timestamp_type, key, value, headers) -> None: ...
98
+ @property
99
+ def version(self): ...
100
+ @property
101
+ def type(self): ...
102
+ @property
103
+ def abort(self): ...
104
+ @property
105
+ def commit(self): ...
106
+
107
+ class DefaultRecordBatchBuilder(DefaultRecordBase, ABCRecordBatchBuilder):
108
+ MAX_RECORD_OVERHEAD: int
109
+ def __init__(
110
+ self, magic, compression_type, is_transactional, producer_id, producer_epoch, base_sequence, batch_size
111
+ ) -> None: ...
112
+ def set_producer_state(self, producer_id, producer_epoch, base_sequence, is_transactional) -> None: ...
113
+ @property
114
+ def producer_id(self): ...
115
+ @property
116
+ def producer_epoch(self): ...
117
+ def append( # type: ignore[override]
118
+ self,
119
+ offset,
120
+ timestamp,
121
+ key,
122
+ value,
123
+ headers,
124
+ encode_varint=...,
125
+ size_of_varint=...,
126
+ get_type=...,
127
+ type_int=...,
128
+ time_time=...,
129
+ byte_like=...,
130
+ bytearray_type=...,
131
+ len_func=...,
132
+ zero_len_varint: int = 1,
133
+ ): ...
134
+ def write_header(self, use_compression_type: bool = True) -> None: ...
135
+ def build(self): ...
136
+ def size(self): ...
137
+ @classmethod
138
+ def header_size_in_bytes(cls): ...
139
+ @classmethod
140
+ def size_in_bytes(cls, offset_delta, timestamp_delta, key, value, headers): ...
141
+ @classmethod
142
+ def size_of(cls, key, value, headers): ...
143
+ @classmethod
144
+ def estimate_size_in_bytes(cls, key, value, headers): ...
145
+
146
+ class DefaultRecordMetadata:
147
+ def __init__(self, offset, size, timestamp) -> None: ...
148
+ @property
149
+ def offset(self): ...
150
+ @property
151
+ def crc(self) -> None: ...
152
+ @property
153
+ def size(self): ...
154
+ @property
155
+ def timestamp(self): ...
@@ -0,0 +1,86 @@
1
+ from _typeshed import Incomplete
2
+
3
+ from kafka.record.abc import ABCRecord, ABCRecordBatch, ABCRecordBatchBuilder
4
+
5
+ class LegacyRecordBase:
6
+ HEADER_STRUCT_V0: Incomplete
7
+ HEADER_STRUCT_V1: Incomplete
8
+ LOG_OVERHEAD: Incomplete
9
+ CRC_OFFSET: Incomplete
10
+ MAGIC_OFFSET: Incomplete
11
+ RECORD_OVERHEAD_V0: Incomplete
12
+ RECORD_OVERHEAD_V1: Incomplete
13
+ KEY_OFFSET_V0: Incomplete
14
+ KEY_OFFSET_V1: Incomplete
15
+ KEY_LENGTH: Incomplete
16
+ VALUE_LENGTH: Incomplete
17
+ CODEC_MASK: int
18
+ CODEC_NONE: int
19
+ CODEC_GZIP: int
20
+ CODEC_SNAPPY: int
21
+ CODEC_LZ4: int
22
+ TIMESTAMP_TYPE_MASK: int
23
+ LOG_APPEND_TIME: int
24
+ CREATE_TIME: int
25
+ NO_TIMESTAMP: int
26
+
27
+ class LegacyRecordBatch(ABCRecordBatch, LegacyRecordBase):
28
+ def __init__(self, buffer, magic) -> None: ...
29
+ @property
30
+ def base_offset(self): ...
31
+ @property
32
+ def size_in_bytes(self): ...
33
+ @property
34
+ def timestamp_type(self): ...
35
+ @property
36
+ def compression_type(self): ...
37
+ @property
38
+ def magic(self): ...
39
+ def validate_crc(self): ...
40
+ def __iter__(self): ...
41
+
42
+ class LegacyRecord(ABCRecord):
43
+ def __init__(self, magic, offset, timestamp, timestamp_type, key, value, crc, crc_bytes) -> None: ...
44
+ @property
45
+ def magic(self): ...
46
+ @property
47
+ def offset(self): ...
48
+ @property
49
+ def timestamp(self): ...
50
+ @property
51
+ def timestamp_type(self): ...
52
+ @property
53
+ def key(self): ...
54
+ @property
55
+ def value(self): ...
56
+ @property
57
+ def headers(self): ...
58
+ @property
59
+ def checksum(self): ...
60
+ def validate_crc(self): ...
61
+ @property
62
+ def size_in_bytes(self): ...
63
+
64
+ class LegacyRecordBatchBuilder(ABCRecordBatchBuilder, LegacyRecordBase):
65
+ def __init__(self, magic, compression_type, batch_size) -> None: ...
66
+ def append(self, offset, timestamp, key, value, headers=None): ...
67
+ def build(self): ...
68
+ def size(self): ...
69
+ def size_in_bytes(self, offset, timestamp, key, value, headers=None): ...
70
+ @classmethod
71
+ def record_size(cls, magic, key, value): ...
72
+ @classmethod
73
+ def record_overhead(cls, magic): ...
74
+ @classmethod
75
+ def estimate_size_in_bytes(cls, magic, compression_type, key, value): ...
76
+
77
+ class LegacyRecordMetadata:
78
+ def __init__(self, offset, crc, size, timestamp) -> None: ...
79
+ @property
80
+ def offset(self): ...
81
+ @property
82
+ def crc(self): ...
83
+ @property
84
+ def size(self): ...
85
+ @property
86
+ def timestamp(self): ...
@@ -0,0 +1,44 @@
1
+ from _typeshed import Incomplete
2
+
3
+ from kafka.record.abc import ABCRecords
4
+
5
+ class MemoryRecords(ABCRecords):
6
+ LENGTH_OFFSET: Incomplete
7
+ LOG_OVERHEAD: Incomplete
8
+ MAGIC_OFFSET: Incomplete
9
+ MIN_SLICE: Incomplete
10
+ def __init__(self, bytes_data) -> None: ...
11
+ def size_in_bytes(self): ...
12
+ def valid_bytes(self): ...
13
+ def has_next(self): ...
14
+ def next_batch(self, _min_slice=26, _magic_offset=16): ...
15
+ def __iter__(self): ...
16
+ def __next__(self): ...
17
+ next = __next__
18
+
19
+ class MemoryRecordsBuilder:
20
+ def __init__(
21
+ self,
22
+ magic,
23
+ compression_type,
24
+ batch_size,
25
+ offset: int = 0,
26
+ transactional: bool = False,
27
+ producer_id: int = -1,
28
+ producer_epoch: int = -1,
29
+ base_sequence: int = -1,
30
+ ) -> None: ...
31
+ def skip(self, offsets_to_skip) -> None: ...
32
+ def append(self, timestamp, key, value, headers=[]): ...
33
+ def set_producer_state(self, producer_id, producer_epoch, base_sequence, is_transactional) -> None: ...
34
+ @property
35
+ def producer_id(self): ...
36
+ @property
37
+ def producer_epoch(self): ...
38
+ def records(self): ...
39
+ def close(self) -> None: ...
40
+ def size_in_bytes(self): ...
41
+ def compression_rate(self): ...
42
+ def is_full(self): ...
43
+ def next_offset(self): ...
44
+ def buffer(self): ...
@@ -0,0 +1,5 @@
1
+ def encode_varint(value, write): ...
2
+ def size_of_varint(value): ...
3
+ def decode_varint(buffer, pos: int = 0): ...
4
+ def calc_crc32c(memview, _crc32c=...): ...
5
+ def calc_crc32(memview): ...
@@ -0,0 +1,6 @@
1
+ from _typeshed import Incomplete
2
+
3
+ SASL_MECHANISMS: Incomplete
4
+
5
+ def register_sasl_mechanism(name, klass, overwrite: bool = False) -> None: ...
6
+ def get_sasl_mechanism(name): ...
@@ -0,0 +1,14 @@
1
+ import abc
2
+
3
+ class SaslMechanism(metaclass=abc.ABCMeta):
4
+ @abc.abstractmethod
5
+ def __init__(self, **config): ...
6
+ @abc.abstractmethod
7
+ def auth_bytes(self): ...
8
+ @abc.abstractmethod
9
+ def receive(self, auth_bytes): ...
10
+ @abc.abstractmethod
11
+ def is_done(self): ...
12
+ @abc.abstractmethod
13
+ def is_authenticated(self): ...
14
+ def auth_details(self): ...
@@ -0,0 +1,16 @@
1
+ from _typeshed import Incomplete
2
+
3
+ from kafka.sasl.abc import SaslMechanism
4
+
5
+ class SaslMechanismGSSAPI(SaslMechanism):
6
+ SASL_QOP_AUTH: int
7
+ SASL_QOP_AUTH_INT: int
8
+ SASL_QOP_AUTH_CONF: int
9
+ gssapi_name: Incomplete
10
+ auth_id: Incomplete
11
+ def __init__(self, **config) -> None: ...
12
+ def auth_bytes(self): ...
13
+ def receive(self, auth_bytes) -> None: ...
14
+ def is_done(self): ...
15
+ def is_authenticated(self): ...
16
+ def auth_details(self): ...
@@ -0,0 +1,33 @@
1
+ from _typeshed import Incomplete
2
+
3
+ from kafka.sasl.abc import SaslMechanism
4
+
5
+ log: Incomplete
6
+
7
+ class SaslMechanismAwsMskIam(SaslMechanism):
8
+ host: Incomplete
9
+ def __init__(self, **config) -> None: ...
10
+ def auth_bytes(self): ...
11
+ def receive(self, auth_bytes) -> None: ...
12
+ def is_done(self): ...
13
+ def is_authenticated(self): ...
14
+ def auth_details(self): ...
15
+
16
+ class AwsMskIamClient:
17
+ UNRESERVED_CHARS: Incomplete
18
+ algorithm: str
19
+ expires: str
20
+ hashfunc: Incomplete
21
+ headers: Incomplete
22
+ version: str
23
+ service: str
24
+ action: Incomplete
25
+ datestamp: Incomplete
26
+ timestamp: Incomplete
27
+ host: Incomplete
28
+ access_key: Incomplete
29
+ secret_key: Incomplete
30
+ region: Incomplete
31
+ token: Incomplete
32
+ def __init__(self, host, access_key, secret_key, region, token=None) -> None: ...
33
+ def first_message(self): ...
@@ -0,0 +1,23 @@
1
+ import abc
2
+ from _typeshed import Incomplete
3
+
4
+ from kafka.sasl.abc import SaslMechanism
5
+
6
+ log: Incomplete
7
+
8
+ class SaslMechanismOAuth(SaslMechanism):
9
+ token_provider: Incomplete
10
+ def __init__(self, **config) -> None: ...
11
+ def auth_bytes(self): ...
12
+ def receive(self, auth_bytes) -> None: ...
13
+ def is_done(self): ...
14
+ def is_authenticated(self): ...
15
+ def auth_details(self): ...
16
+
17
+ ABC: Incomplete
18
+
19
+ class AbstractTokenProvider(ABC, metaclass=abc.ABCMeta):
20
+ def __init__(self, **config) -> None: ...
21
+ @abc.abstractmethod
22
+ def token(self): ...
23
+ def extensions(self): ...
@@ -0,0 +1,15 @@
1
+ from _typeshed import Incomplete
2
+
3
+ from kafka.sasl.abc import SaslMechanism
4
+
5
+ log: Incomplete
6
+
7
+ class SaslMechanismPlain(SaslMechanism):
8
+ username: Incomplete
9
+ password: Incomplete
10
+ def __init__(self, **config) -> None: ...
11
+ def auth_bytes(self): ...
12
+ def receive(self, auth_bytes) -> None: ...
13
+ def is_done(self): ...
14
+ def is_authenticated(self): ...
15
+ def auth_details(self): ...
@@ -0,0 +1,40 @@
1
+ from _typeshed import Incomplete
2
+
3
+ from kafka.sasl.abc import SaslMechanism
4
+
5
+ log: Incomplete
6
+
7
+ def xor_bytes(left, right): ...
8
+
9
+ class SaslMechanismScram(SaslMechanism):
10
+ username: Incomplete
11
+ mechanism: Incomplete
12
+ def __init__(self, **config) -> None: ...
13
+ def auth_bytes(self): ...
14
+ def receive(self, auth_bytes): ...
15
+ def is_done(self): ...
16
+ def is_authenticated(self): ...
17
+ def auth_details(self): ...
18
+
19
+ class ScramClient:
20
+ MECHANISMS: Incomplete
21
+ nonce: Incomplete
22
+ auth_message: bytes
23
+ salted_password: Incomplete
24
+ user: Incomplete
25
+ password: Incomplete
26
+ hashfunc: Incomplete
27
+ hashname: Incomplete
28
+ stored_key: Incomplete
29
+ client_key: Incomplete
30
+ client_signature: Incomplete
31
+ client_proof: Incomplete
32
+ server_key: Incomplete
33
+ server_signature: Incomplete
34
+ def __init__(self, user, password, mechanism) -> None: ...
35
+ def first_message(self): ...
36
+ def process_server_first_message(self, server_first_message) -> None: ...
37
+ def hmac(self, key, msg): ...
38
+ def create_salted_password(self, salt, iterations) -> None: ...
39
+ def final_message(self): ...
40
+ def process_server_final_message(self, server_final_message) -> None: ...
@@ -0,0 +1,17 @@
1
+ from _typeshed import Incomplete
2
+
3
+ from kafka.sasl.abc import SaslMechanism
4
+
5
+ log: Incomplete
6
+
7
+ class SaslMechanismSSPI(SaslMechanism):
8
+ SASL_QOP_AUTH: int
9
+ SASL_QOP_AUTH_INT: int
10
+ SASL_QOP_AUTH_CONF: int
11
+ auth_id: Incomplete
12
+ def __init__(self, **config) -> None: ...
13
+ def auth_bytes(self): ...
14
+ def receive(self, auth_bytes) -> None: ...
15
+ def is_done(self): ...
16
+ def is_authenticated(self): ...
17
+ def auth_details(self): ...
@@ -0,0 +1 @@
1
+ from kafka.serializer.abstract import Deserializer as Deserializer, Serializer as Serializer
@@ -0,0 +1,15 @@
1
+ import abc
2
+
3
+ class Serializer(metaclass=abc.ABCMeta):
4
+ __meta__ = abc.ABCMeta
5
+ def __init__(self, **config) -> None: ...
6
+ @abc.abstractmethod
7
+ def serialize(self, topic, value): ...
8
+ def close(self) -> None: ...
9
+
10
+ class Deserializer(metaclass=abc.ABCMeta):
11
+ __meta__ = abc.ABCMeta
12
+ def __init__(self, **config) -> None: ...
13
+ @abc.abstractmethod
14
+ def deserialize(self, topic, bytes_): ...
15
+ def close(self) -> None: ...
@@ -0,0 +1,25 @@
1
+ from _typeshed import Incomplete
2
+
3
+ log: Incomplete
4
+
5
+ class ProxyConnectionStates:
6
+ DISCONNECTED: str
7
+ CONNECTING: str
8
+ NEGOTIATE_PROPOSE: str
9
+ NEGOTIATING: str
10
+ AUTHENTICATING: str
11
+ REQUEST_SUBMIT: str
12
+ REQUESTING: str
13
+ READ_ADDRESS: str
14
+ COMPLETE: str
15
+
16
+ class Socks5Wrapper:
17
+ def __init__(self, proxy_url, afi) -> None: ...
18
+ @classmethod
19
+ def is_inet_4_or_6(cls, gai): ...
20
+ @classmethod
21
+ def dns_lookup(cls, host, port, afi=...): ...
22
+ @classmethod
23
+ def use_remote_lookup(cls, proxy_url): ...
24
+ def socket(self, family, sock_type): ...
25
+ def connect_ex(self, addr): ...
@@ -0,0 +1,53 @@
1
+ from _typeshed import Incomplete
2
+ from typing import NamedTuple
3
+
4
+ class TopicPartition(NamedTuple):
5
+ topic: str
6
+ partition: int
7
+
8
+ class BrokerMetadata(NamedTuple):
9
+ nodeId: int
10
+ host: str
11
+ port: int
12
+ rack: str | None
13
+
14
+ class PartitionMetadata(NamedTuple):
15
+ topic: str
16
+ partition: int
17
+ leader: int
18
+ leader_epoch: int | None
19
+ replicas: list[int]
20
+ isr: list[int]
21
+ offline_replicas: list[int]
22
+ error: Incomplete
23
+
24
+ class OffsetAndMetadata(NamedTuple):
25
+ offset: int
26
+ metadata: str
27
+ leader_epoch: int
28
+
29
+ class OffsetAndTimestamp(NamedTuple):
30
+ offset: int
31
+ timestamp: int
32
+ leader_epoch: int
33
+
34
+ class MemberInformation(NamedTuple):
35
+ member_id: str
36
+ client_id: str
37
+ client_host: str
38
+ member_metadata: Incomplete
39
+ member_assignment: Incomplete
40
+
41
+ class GroupInformation(NamedTuple):
42
+ error_code: int
43
+ group: str
44
+ state: str
45
+ protocol_type: str
46
+ protocol: str
47
+ members: list[MemberInformation]
48
+ authorized_operations: list[str]
49
+
50
+ class RetryOptions(NamedTuple):
51
+ limit: int
52
+ backoff_ms: int
53
+ retry_on_timeouts: bool
kafka-stubs/util.pyi ADDED
@@ -0,0 +1,38 @@
1
+ from _typeshed import Incomplete
2
+ from collections.abc import Callable
3
+ from typing import ParamSpec, TypeVar
4
+
5
+ _P = ParamSpec("_P")
6
+ _T = TypeVar("_T")
7
+
8
+ MAX_INT: Incomplete
9
+ TO_SIGNED: Incomplete
10
+
11
+ def crc32(data): ...
12
+
13
+ class Timer:
14
+ def __init__(self, timeout_ms, error_message=None, start_at=None) -> None: ...
15
+ @property
16
+ def expired(self): ...
17
+ @property
18
+ def timeout_ms(self): ...
19
+ @property
20
+ def elapsed_ms(self): ...
21
+ def maybe_raise(self) -> None: ...
22
+
23
+ TOPIC_MAX_LENGTH: int
24
+ TOPIC_LEGAL_CHARS: Incomplete
25
+
26
+ def ensure_valid_topic_name(topic) -> None: ...
27
+
28
+ class WeakMethod:
29
+ target: Incomplete
30
+ method: Incomplete
31
+ def __init__(self, object_dot_method) -> None: ...
32
+ def __call__(self, *args, **kwargs): ...
33
+ def __hash__(self): ...
34
+ def __eq__(self, other): ...
35
+
36
+ class Dict(dict[Incomplete, Incomplete]): ...
37
+
38
+ def synchronized(func: Callable[_P, _T]) -> Callable[_P, _T]: ...
@@ -0,0 +1 @@
1
+ __version__: str