Skip to content

feat: re-export ModelProvider from anonymizer public API #115

@lipikaramaswamy

Description

@lipikaramaswamy

Summary

Users currently have to import ModelProvider directly from the Data Designer internals:

from data_designer.config.models import ModelProvider

This leaks a dependency implementation detail into user code. ModelProvider should be re-exported from the anonymizer package so the full setup is self-contained:

from anonymizer import Anonymizer, AnonymizerConfig, AnonymizerInput, Redact, Substitute, ModelProvider, configure_logging

Current state

Configuring model providers programmatically (rather than via YAML) requires a data_designer import. This means users need to know about and directly depend on an internal Data Designer type, even though they are only configuring the Anonymizer.

Proposed change

Add ModelProvider (and any other Data Designer types that surface in the public Anonymizer API) to src/anonymizer/__init__.py as explicit re-exports:

from data_designer.config.models import ModelProvider as ModelProvider

This keeps the internal dependency on Data Designer but hides it behind the Anonymizer public surface. Users never need to know where ModelProvider comes from.

Acceptance criteria

  • from anonymizer import ModelProvider works
  • All example notebooks updated to remove data_designer imports
  • Any other Data Designer types currently imported directly by users are audited and re-exported if needed
  • Public API surface documented in __init__.py with explicit as re-exports (PEP 484 __all__ or explicit aliases) so the re-export is visible to type checkers

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions