diff --git a/docs/codegen.rst b/docs/codegen.rst index 4c4028b27..64ee0fe16 100644 --- a/docs/codegen.rst +++ b/docs/codegen.rst @@ -62,6 +62,18 @@ by the schema location they are defined. This works well for schemas that avoid imports. If you get import errors you should try one of the alternative structure styles. +**clusters** + +This style will identify the strongly connected classes and will group them together, +creating as many modules as possible. The modules are named after the the main class +of the group. + +.. code-block:: console + + $ xsdata schema.xsd --package models --structure-style clusters + +.. versionadded:: 20.7 + **namespaces** diff --git a/xsdata/cli.py b/xsdata/cli.py index a8426feeb..9d6ced760 100644 --- a/xsdata/cli.py +++ b/xsdata/cli.py @@ -138,6 +138,8 @@ def download(source: str, output: str): "\n\n" "namespaces: group classes by the target namespace" "\n\n" + "clusters: group by strong connected dependencies" + "\n\n" "single-package: group all classes together" ), default="filenames", diff --git a/xsdata/models/config.py b/xsdata/models/config.py index 8185ecec1..a5d9788b4 100644 --- a/xsdata/models/config.py +++ b/xsdata/models/config.py @@ -28,13 +28,14 @@ class StructureStyle(Enum): :cvar FILENAMES: filenames :cvar NAMESPACES: namespaces - :cvar SINGLE_PACKAGE: package + :cvar CLUSTERS: clusters + :cvar SINGLE_PACKAGE: single-package """ FILENAMES = "filenames" NAMESPACES = "namespaces" - SINGLE_PACKAGE = "single-package" CLUSTERS = "clusters" + SINGLE_PACKAGE = "single-package" class NameCase(Enum):