Public API Exports
Relevant source files
The following files were used as context for generating this wiki page:
The flext-tap-ldap package utilizes a centralized and lazy-loading architecture for its Public API exports. This design ensures that heavy dependencies or modules are only loaded when accessed, optimizing the startup time of the Singer Tap. The public surface is primarily exposed through the root __init__.py file, which aggregates core services, models, utilities, and metadata.
Sources: src/flext_tap_ldap/__init__.py:7-50, src/flext_tap_ldap/_exports_lazy_part_01.py:10-40
Export Architecture and Lazy Loading
The project employs flext_core.lazy to manage its internal and external visibility. Modules such as constants, models, protocols, and the main tap implementation are mapped in a lazy import structure. This prevents unnecessary overhead during package initialization.
Lazy Import Mapping
The system uses a build_lazy_import_map to define how internal modules are exposed as part of the public namespace.
The diagram shows how the root package installs lazy exports by referencing a generated import map.
Sources: src/flext_tap_ldap/_exports_lazy_part_01.py:10-38, src/flext_tap_ldap/_exports.py:10-41
Publicly Accessible Members
The package defines a strict list of _PUBLIC_EXPORTS that determines what is available when importing from flext_tap_ldap. This list includes full class names and their common aliases (shorthands).
| Export Name | Description | Suffix / Alias |
|---|---|---|
FlextTapLdapTap | Main Singer Tap implementation class | - |
FlextTapLdapSettings | Configuration and settings management | - |
FlextTapLdapConstants | Constant definitions and search scopes | c |
FlextTapLdapModels | Data models and Pydantic schemas | m |
FlextTapLdapProtocols | Protocol and interface definitions | p |
FlextTapLdapUtilities | Shared helper functions and processors | u |
FlextTapLdapTypes | Typing and annotation helpers | t |
tap_ldap | Functional entry point for the tap | - |
Sources: src/flext_tap_ldap/__init__.py:53-100, src/flext_tap_ldap/_exports_lazy_part_01.py:10-38
Metadata and Versioning
Package metadata is exported eagerly to ensure tools can query version information without triggering the lazy loading of the entire LDAP logic. This information is derived from FlextTapLdapVersion, which inherits from the core FlextVersion class.
_EAGER_EXPORTS = (
__author__,
__author_email__,
__description__,
__license__,
__title__,
__url__,
__version__,
__version_info__,
)
Sources: src/flext_tap_ldap/__init__.py:33-42, src/flext_tap_ldap/__version__.py:19-45
Utility Exports
Utilities are organized within the _utilities sub-package and exposed through a similar lazy-loading mechanism. This includes processors for LDIF files and client support helpers.
The diagram represents the structural composition of the utility namespace, which provides the underlying logic for the public u alias.
Sources: src/flext_tap_ldap/_utilities/__init__.py:20-28, src/flext_tap_ldap/_exports_lazy_part_01.py:35-37
Core Tap Entry Point
The FlextTapLdapTap class is the primary architectural component exported. It handles stream discovery and execution within the Meltano/Singer ecosystem.
| Component | Responsibility |
|---|---|
discover_streams | Identifies available LDAP streams (Users, Groups, etc.) |
execute | Triggers the tap logic and returns execution state |
config_class | References FlextTapLdapSettings for validation |
main | Entry point for CLI execution |
Sources: src/flext_tap_ldap/tap.py:30-45, src/flext_tap_ldap/tap.py:155-165, src/flext_tap_ldap/tap.py:230-240
Conclusion
Public API Exports in flext-tap-ldap are designed for efficiency and developer ergonomics. By combining lazy loading with standardized aliases (c, m, p, u, t), the library provides a consistent interface while minimizing the runtime footprint until specific LDAP or LDIF processing capabilities are required.