dgkafka 1.0.0a1__tar.gz → 1.0.0a3__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dgkafka
3
- Version: 1.0.0a1
3
+ Version: 1.0.0a3
4
4
  Summary: Kafka clients
5
5
  Home-page: https://gitlab.com/gng-group/dgkafka.git
6
6
  Author: Malanris
@@ -31,6 +31,9 @@ Requires-Dist: attrs; extra == "avro"
31
31
  Requires-Dist: cachetools; extra == "avro"
32
32
  Requires-Dist: httpx>=0.26; extra == "avro"
33
33
  Requires-Dist: authlib; extra == "avro"
34
+ Provides-Extra: json
35
+ Requires-Dist: pyrsistent; extra == "json"
36
+ Requires-Dist: jsonschema; extra == "json"
34
37
  Dynamic: author
35
38
  Dynamic: home-page
36
39
  Dynamic: license-file
@@ -51,6 +54,12 @@ For Avro support (requires additional dependencies):
51
54
  pip install dgkafka[avro]
52
55
  ```
53
56
 
57
+ For Json support (requires additional dependencies):
58
+
59
+ ```bash
60
+ pip install dgkafka[json]
61
+ ```
62
+
54
63
  ## Features
55
64
 
56
65
  - Producers and consumers for different data formats:
@@ -14,6 +14,12 @@ For Avro support (requires additional dependencies):
14
14
  pip install dgkafka[avro]
15
15
  ```
16
16
 
17
+ For Json support (requires additional dependencies):
18
+
19
+ ```bash
20
+ pip install dgkafka[json]
21
+ ```
22
+
17
23
  ## Features
18
24
 
19
25
  - Producers and consumers for different data formats:
@@ -0,0 +1,11 @@
1
+ from .consumer import KafkaConsumer
2
+ from .producer import KafkaProducer
3
+ try:
4
+ from .avro_consumer import AvroKafkaConsumer
5
+ from .avro_producer import AvroKafkaProducer
6
+ except ImportError:
7
+ pass
8
+ try:
9
+ from .json_consumer import JsonKafkaConsumer
10
+ except ImportError:
11
+ pass
@@ -24,14 +24,14 @@ class AvroKafkaConsumer(KafkaConsumer):
24
24
  configs: Kafka consumer configuration
25
25
  """
26
26
  self.schema_registry_url = configs.get('schema.registry.url')
27
- self.schema_registry_client = CachedSchemaRegistryClient({'url': self.schema_registry_url})
27
+ assert self.schema_registry_url is not None, "schema.registry.url is required"
28
+
29
+ self.schema_registry_client = CachedSchemaRegistryClient(url=self.schema_registry_url)
28
30
  super().__init__(logger_=logger_, **configs)
29
31
 
30
32
  def _init_consumer(self, **configs: Any) -> None:
31
33
  """Initialize AvroConsumer instance."""
32
34
  try:
33
- # AvroConsumer requires schema registry in config
34
- configs['schema.registry.url'] = self.schema_registry_url
35
35
  self.consumer = AvroConsumer(configs)
36
36
  self.logger.info("[*] Avro consumer initialized successfully")
37
37
  except Exception as ex:
@@ -34,7 +34,7 @@ class AvroKafkaProducer(KafkaProducer):
34
34
 
35
35
  self.default_key_schema = default_key_schema
36
36
  self.default_value_schema = default_value_schema
37
- self.schema_registry_client = CachedSchemaRegistryClient({'url': self.schema_registry_url})
37
+ self.schema_registry_client = CachedSchemaRegistryClient(url=self.schema_registry_url)
38
38
  super().__init__(logger_=logger_, **configs)
39
39
 
40
40
  def _init_producer(self, **configs: Any) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dgkafka
3
- Version: 1.0.0a1
3
+ Version: 1.0.0a3
4
4
  Summary: Kafka clients
5
5
  Home-page: https://gitlab.com/gng-group/dgkafka.git
6
6
  Author: Malanris
@@ -31,6 +31,9 @@ Requires-Dist: attrs; extra == "avro"
31
31
  Requires-Dist: cachetools; extra == "avro"
32
32
  Requires-Dist: httpx>=0.26; extra == "avro"
33
33
  Requires-Dist: authlib; extra == "avro"
34
+ Provides-Extra: json
35
+ Requires-Dist: pyrsistent; extra == "json"
36
+ Requires-Dist: jsonschema; extra == "json"
34
37
  Dynamic: author
35
38
  Dynamic: home-page
36
39
  Dynamic: license-file
@@ -51,6 +54,12 @@ For Avro support (requires additional dependencies):
51
54
  pip install dgkafka[avro]
52
55
  ```
53
56
 
57
+ For Json support (requires additional dependencies):
58
+
59
+ ```bash
60
+ pip install dgkafka[json]
61
+ ```
62
+
54
63
  ## Features
55
64
 
56
65
  - Producers and consumers for different data formats:
@@ -9,3 +9,7 @@ attrs
9
9
  cachetools
10
10
  httpx>=0.26
11
11
  authlib
12
+
13
+ [json]
14
+ pyrsistent
15
+ jsonschema
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dgkafka"
7
- version = "1.0.0a1"
7
+ version = "1.0.0a3"
8
8
  authors = [
9
9
  {name = "Roman Rasputin", email = "admin@roro.su"},
10
10
  ]
@@ -39,6 +39,10 @@ avro = [
39
39
  "httpx>=0.26",
40
40
  "authlib"
41
41
  ]
42
+ json = [
43
+ "pyrsistent",
44
+ "jsonschema"
45
+ ]
42
46
 
43
47
  [project.urls]
44
48
  Homepage = "https://gitlab.com/gng-group/dgkafka"
@@ -1,5 +0,0 @@
1
- from .consumer import KafkaConsumer
2
- from .avro_consumer import AvroKafkaConsumer
3
- from .producer import KafkaProducer
4
- from .avro_producer import AvroKafkaProducer
5
- from .json_consumer import JsonKafkaConsumer
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes