From 518110a6ee168cc436a9f7fc20796cbfa2067c4c Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Sun, 22 Sep 2024 10:44:05 +0200 Subject: [PATCH] Zyp: Export main symbols via `zyp` namespace --- doc/zyp/examples.md | 17 +++++++---------- src/zyp/__init__.py | 17 +++++++++++++++++ src/zyp/model/__init__.py | 12 ++++++++++++ 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/doc/zyp/examples.md b/doc/zyp/examples.md index 94c5f26..3b33e5b 100644 --- a/doc/zyp/examples.md +++ b/doc/zyp/examples.md @@ -62,7 +62,7 @@ no tutorial yet: Please look at the source and software tests. # Includes column renaming and applying Python converter functions. from pprint import pprint -from zyp.model.bucket import BucketTransformation, FieldRenamer, ValueConverter +from zyp import BucketTransformation, FieldRenamer, ValueConverter # Consider a slightly messy collection of records. data_in = [ @@ -191,9 +191,9 @@ no tutorial yet: Please look at the source and software tests. # Uses all of JMES, jq, and JSON Pointer technologies for demonstration purposes. from pprint import pprint -from zyp.model.bucket import BucketTransformation, FieldRenamer, ValueConverter -from zyp.model.collection import CollectionTransformation -from zyp.model.moksha import MokshaTransformation +from zyp import \ + BucketTransformation, CollectionTransformation, \ + FieldRenamer, MokshaTransformation, ValueConverter # Consider a slightly messy collection of records. data_in = { @@ -322,8 +322,7 @@ no tutorial yet: Please look at the source and software tests. # Includes a Moksha/jq transformation rule for including elements. from pprint import pprint -from zyp.model.collection import CollectionTransformation -from zyp.model.moksha import MokshaTransformation +from zyp import CollectionTransformation, MokshaTransformation data_in = [ { @@ -413,8 +412,7 @@ no tutorial yet: Please look at the source and software tests. # Includes a Moksha/jq transformation rule for excluding elements. from pprint import pprint -from zyp.model.collection import CollectionTransformation -from zyp.model.moksha import MokshaTransformation +from zyp import CollectionTransformation, MokshaTransformation data_in = [ { @@ -504,8 +502,7 @@ no tutorial yet: Please look at the source and software tests. # Includes two Moksha/jq transformation rules for unwrapping and flattening. from pprint import pprint -from zyp.model.collection import CollectionTransformation -from zyp.model.moksha import MokshaTransformation +from zyp import CollectionTransformation, MokshaTransformation data_in = { "message-source": "community", diff --git a/src/zyp/__init__.py b/src/zyp/__init__.py index e69de29..81a83d8 100644 --- a/src/zyp/__init__.py +++ b/src/zyp/__init__.py @@ -0,0 +1,17 @@ +from zyp.model import ( + BucketTransformation, + CollectionTransformation, + FieldRenamer, + MokshaTransformation, + TransonTransformation, + ValueConverter, +) + +__all__ = [ + "CollectionTransformation", + "BucketTransformation", + "FieldRenamer", + "MokshaTransformation", + "TransonTransformation", + "ValueConverter", +] diff --git a/src/zyp/model/__init__.py b/src/zyp/model/__init__.py index e69de29..27ab8cf 100644 --- a/src/zyp/model/__init__.py +++ b/src/zyp/model/__init__.py @@ -0,0 +1,12 @@ +from zyp.model.bucket import BucketTransformation, FieldRenamer, TransonTransformation, ValueConverter +from zyp.model.collection import CollectionTransformation +from zyp.model.moksha import MokshaTransformation + +__all__ = [ + "CollectionTransformation", + "BucketTransformation", + "FieldRenamer", + "MokshaTransformation", + "TransonTransformation", + "ValueConverter", +]