xsdata.utils.downloader module¶
-
class
xsdata.utils.downloader.
Downloader
(output)[source]¶ Bases:
object
Helper class to download a schema or a definitions with all their imports locally. The imports paths will be adjusted if necessary.
- Parameters
output (
Path
) – Output path
-
output
: pathlib.Path¶
-
base_path
: Optional[pathlib.Path] = None¶
-
downloaded
: Dict¶
-
parse_schema
(uri, content)[source]¶ Convert content to a schema instance and process all sub imports.
-
parse_definitions
(uri, content)[source]¶ Convert content to a definitions instance and process all sub imports.
-
wget_included
(definition)[source]¶ - Parameters
definition (
Union
[Schema
,Definitions
]) –
-
adjust_base_path
(uri)[source]¶ Adjust base path for every new uri loaded.
- Example runs:
- Parameters
uri (
str
) –
-
adjust_imports
(path, content)[source]¶ Try to adjust the import locations for external locations that are not relative to the first requested uri.