python-avro-generator 1.1.3__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.
@@ -0,0 +1 @@
1
+ graft src
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.1
2
+ Name: python_avro_generator
3
+ Version: 1.1.3
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
+
12
+ Python Avro generator for Le Comptoir Des Pharmacies
13
+
@@ -0,0 +1 @@
1
+ # Avro Generator for the python-avro-codegen library
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.1
2
+ Name: python-avro-generator
3
+ Version: 1.1.3
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
+
12
+ Python Avro generator for Le Comptoir Des Pharmacies
13
+
@@ -0,0 +1,11 @@
1
+ MANIFEST.in
2
+ README.md
3
+ setup.cfg
4
+ setup.py
5
+ python_avro_generator.egg-info/PKG-INFO
6
+ python_avro_generator.egg-info/SOURCES.txt
7
+ python_avro_generator.egg-info/dependency_links.txt
8
+ python_avro_generator.egg-info/requires.txt
9
+ python_avro_generator.egg-info/top_level.txt
10
+ src/__init__.py
11
+ src/codegen.py
@@ -0,0 +1,2 @@
1
+ lcdp-api
2
+ lcdp-avro-to-python==0.3.3.post8
@@ -0,0 +1 @@
1
+ python_avro_generator
@@ -0,0 +1,7 @@
1
+ [metadata]
2
+ description-file = README.md
3
+
4
+ [egg_info]
5
+ tag_build =
6
+ tag_date = 0
7
+
@@ -0,0 +1,32 @@
1
+ import subprocess
2
+ import re
3
+ import glob
4
+ import shutil
5
+ import os
6
+ from setuptools import setup
7
+ from setuptools.command.build_py import build_py
8
+
9
+ TOP_LEVEL_PACKAGE_NAME = "python_avro_generator"
10
+
11
+ setup(
12
+ name="python_avro_generator",
13
+ setuptools_git_versioning={
14
+ "enabled": True,
15
+ "template": "{tag}",
16
+ "dirty_template": "{tag}.post{ccount}+git.{sha}",
17
+ },
18
+ install_requires=[
19
+ 'lcdp-avro-to-python==0.3.3.post8',
20
+ "lcdp-api"
21
+ ],
22
+ setup_requires=['setuptools-git-versioning==1.9.2'],
23
+ packages=[TOP_LEVEL_PACKAGE_NAME],
24
+ package_dir={TOP_LEVEL_PACKAGE_NAME: "src"},
25
+ license='Apache-2.0',
26
+ description='Python Avro codegen for Le Comptoir Des Pharmacies',
27
+ long_description='Python Avro generator for Le Comptoir Des Pharmacies',
28
+ author='Le Comptoir Des Pharmacies',
29
+ author_email='g.thrasibule@lecomptoirdespharmacies.fr',
30
+ url='https://bitbucket.org/lecomptoirdespharmacies/lcdp-openapi-codegen',
31
+ keywords=['openapi', 'python-avro-generator', 'openapi3'],
32
+ )
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
+