opengrowth-privacy-preservi.../opengrowth_privacy_preservi.../schema_registry.py

24 lines
728 B
Python

class SchemaRegistry:
def __init__(self):
self._schemas = {}
self._templates = {}
def register_schema(self, name: str, schema: dict) -> None:
self._schemas[name] = schema
def get_schema(self, name: str) -> dict:
return self._schemas.get(name, {})
def register_template(self, template_id: str, definition: dict) -> None:
self._templates[template_id] = definition
def get_template(self, template_id: str) -> dict:
return self._templates.get(template_id, {})
class ExperimentTemplate:
def __init__(self, template_id: str, name: str, definition: dict):
self.template_id = template_id
self.name = name
self.definition = definition