python-avro-generator 1.1.2__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.
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from lcdp_api import event
|
|
2
|
+
|
|
3
|
+
from avro_to_python.reader import AvscReader
|
|
4
|
+
from avro_to_python.writer import AvroWriter
|
|
5
|
+
|
|
6
|
+
try:
|
|
7
|
+
import importlib.resources as pkg_resources
|
|
8
|
+
except ImportError:
|
|
9
|
+
# Try backported to PY<37 `importlib_resources`.
|
|
10
|
+
import importlib_resources as pkg_resources
|
|
11
|
+
|
|
12
|
+
def generate_event_classes(event_spec_directory_name, out_dir):
|
|
13
|
+
with pkg_resources.path(event, event_spec_directory_name) as event_directory:
|
|
14
|
+
# initialize the reader object
|
|
15
|
+
reader = AvscReader(directory=event_directory)
|
|
16
|
+
|
|
17
|
+
# generate the acyclic tree object
|
|
18
|
+
reader.read()
|
|
19
|
+
|
|
20
|
+
# initialize the writer object
|
|
21
|
+
writer = AvroWriter(reader.file_tree, top_level_package="api.event.gen")
|
|
22
|
+
|
|
23
|
+
# compile python files using 'tests/test_records as the namespace root'
|
|
24
|
+
writer.write(root_dir=out_dir)
|
|
25
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: python-avro-generator
|
|
3
|
+
Version: 1.1.2
|
|
4
|
+
Summary: Python Avro codegen for Le Comptoir Des Pharmacies
|
|
5
|
+
Home-page: https://bitbucket.org/lecomptoirdespharmacies/lcdp-openapi-codegen
|
|
6
|
+
Author: Le Comptoir Des Pharmacies
|
|
7
|
+
Author-email: g.thrasibule@lecomptoirdespharmacies.fr
|
|
8
|
+
License: Apache-2.0
|
|
9
|
+
Keywords: openapi,python-avro-generator,openapi3
|
|
10
|
+
Platform: UNKNOWN
|
|
11
|
+
Requires-Dist: lcdp-api
|
|
12
|
+
Requires-Dist: lcdp-avro-to-python (==0.3.3.post8)
|
|
13
|
+
|
|
14
|
+
Python Avro generator for Le Comptoir Des Pharmacies
|
|
15
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
python_avro_generator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
python_avro_generator/codegen.py,sha256=hLaQgdENtTRxN2tmYhLInrWnfl4byow4udNaoCq1sYo,827
|
|
3
|
+
python_avro_generator-1.1.2.dist-info/METADATA,sha256=kNISCyMUC4HgcbN2juK6_60Qnh8ojfgVlIktw2fnc9s,509
|
|
4
|
+
python_avro_generator-1.1.2.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
5
|
+
python_avro_generator-1.1.2.dist-info/top_level.txt,sha256=a17BTmOq4TwHzuKwdr9LgHbAM9Ybr5s8FR_LbWjW108,22
|
|
6
|
+
python_avro_generator-1.1.2.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
python_avro_generator
|