zyra.connectors package
Subpackages
Module contents
Connectors package: ingest and egress submodules and shared backends.
Primary usage favors functional backends under zyra.connectors.backends.
For flows that benefit from a light OO wrapper (e.g., persisting bucket/host
config), thin connector classes are available in zyra.connectors.clients.
- class zyra.connectors.Connector[source]
Bases:
objectMinimal abstract base for connector wrappers.
Provides only introspection helpers and context manager convenience. It does not impose a lifecycle or specific methods on subclasses. Concrete wrapper classes are free to delegate to functional backends.
- property capabilities: set[str]
- class zyra.connectors.FTPConnector(host: str, port: int = 21, username: str = 'anonymous', password: str = 'test@test.com', timeout: int = 30)[source]
Bases:
ConnectorThin OO wrapper around the FTP backend for convenience.
Stores host/credentials and exposes methods that accept path-only inputs. All methods delegate to functional backends.
- CAPABILITIES = {'fetch', 'list', 'upload'}
- list_files(remote_dir: str, pattern: str | None = None, *, since: str | None = None, until: str | None = None, date_format: str | None = None) list[str] | None[source]
List files under a remote directory with optional filters.
- sync_directory(remote_dir: str, local_dir: str, *, pattern: str | None = None, since: str | None = None, until: str | None = None, date_format: str | None = None, sync_options: SyncOptions | None = None) None[source]
Mirror a remote directory on this FTP host to a local directory.
- Args:
remote_dir: Remote FTP directory path. local_dir: Local directory to sync files to. pattern: Optional regex pattern to filter filenames. since: ISO date string for start of date range filter. until: ISO date string for end of date range filter. date_format: Custom date format for parsing dates in filenames. sync_options: Configuration for file replacement behavior.
- class zyra.connectors.S3Connector(bucket: str, *, unsigned: bool = False)[source]
Bases:
ConnectorThin OO wrapper around the S3 backend for convenience.
Stores bucket configuration and exposes familiar object operations.
- CAPABILITIES = {'fetch', 'list', 'upload'}
- download_byteranges(key: str, byte_ranges: Iterable[str], *, max_workers: int = 10) bytes[source]
Download multiple byte ranges and concatenate them in order.
- get_idx_lines(key: str) list[str][source]
Fetch and parse the GRIB
.idxfor an object in the bucket.