zsh: no matches found: xsdata[cli]# SmartGridready Specification
The specification library contains the classes generated from the SGr XML schema.
The actual XML schema files reside in the separate SGrSpecifications repository .
pyproject.tomlis the main project configuration file.setup.pyis used to build the library package using setuptools.src/sgr_specificationcontains the generated sources of the specification, with sgr_specification being the root of the namespace. The directory is empty, unless the sources are generated from the XML schema.
Install xsdata CLI:
pip install -r requirements-dev.txtCheck out both the SGrPython and
the SGrSpecifications repositories alongside each other,
e.g. in SGrSpecifications and SGrPython.
Generate specification source code from XML schema:
cd SGrPython/specification/src
rm -rf ./sgr_specification/v0
xsdata generate ../../../SGrSpecifications/SchemaDatabase/SGr -r --package sgr_specification.v0Create and activate virtual environment:
cd SGrPython
python -m venv .venv
# On Linux call this:
source ./.venv/bin/activate
# On Windows call this:
.\.venv\Scripts\Activate.ps1Build package and install in virtual environment:
cd SGrPython/specification
pip install -e .You can use the package sgr-specification from within the virtual environment now.
Note:
The designated package name sgr-specification must not be used until the PyPI administrators have
approved a SmartGridready organization account.
Deactivate the virtual environment after use:
cd SGrPython
deactivate