Skip to content

Commit

Permalink
Zyp: Export main symbols via zyp namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Sep 22, 2024
1 parent aeea33c commit 518110a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 10 deletions.
17 changes: 7 additions & 10 deletions doc/zyp/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = [
{
Expand Down Expand Up @@ -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 = [
{
Expand Down Expand Up @@ -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",
Expand Down
17 changes: 17 additions & 0 deletions src/zyp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from zyp.model import (
BucketTransformation,
CollectionTransformation,
FieldRenamer,
MokshaTransformation,
TransonTransformation,
ValueConverter,
)

__all__ = [
"CollectionTransformation",
"BucketTransformation",
"FieldRenamer",
"MokshaTransformation",
"TransonTransformation",
"ValueConverter",
]
12 changes: 12 additions & 0 deletions src/zyp/model/__init__.py
Original file line number Diff line number Diff line change
@@ -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",
]

0 comments on commit 518110a

Please sign in to comment.