qgis_deployment_toolbelt.profiles.rules_context module

Rules context.

Author: Julien Moura (https://github.com/guts)

class qgis_deployment_toolbelt.profiles.rules_context.QdtRulesContext

Bases: object

to_dict() dict

Convert object into dictionary.

Returns:

object as dictionary

Return type:

dict

to_json(**kwargs) str

Supersedes json.dumps using the dictionary returned by to_dict(). kwargs are passed to json.dumps.

Returns:

object serialized as JSON string

Return type:

str

Example

from pathlib import Path

rules_context = QdtRulesContext()

# write into the file passing extra parameters to json.dumps
with Path("qdt_rules_context.json").open("w", encoding="UTF8") as wf:
    wf.write(rules_context.to_json(indent=4, sort_keys=True))