Skip to content

Module

A Python-exposed wrapper for a module version.

This class is just the base class of all published modules in your platform and is not intended to be used directly. This allows interaction with a specific version of a module from the configured cloud provider via the Python SDK. The name of the module is the logical name of the module (e.g., "S3Bucket").

Example

from infraweave import S3Bucket

bucket_module = S3Bucket(
    version='0.0.11-dev',
    track="dev"
)

Properties

name

Gets the module name.

track

Gets the module track.

version

Gets the module version.

Methods

__new__(args, kwargs)

Create and return a new object. See help(type) for accurate signature.

get_latest_version(track)

Gets the latest version of this module for a given track.

Fetches the most recent version of the module from the configured cloud provider. If no track is specified, defaults to "stable".

Arguments

  • track - Optional release track (e.g., "stable", "beta", "dev"). Defaults to "stable" if not provided.

Returns

A new Module instance with the latest version for the specified track.

Errors

Panics if the module is not found or if there's an error communicating with the cloud provider.

Example

from infraweave import S3Bucket

# Get latest stable version
latest_module = S3Bucket.get_latest_version()

# Get latest dev version
latest_dev = S3Bucket.get_latest_version(track="dev")

get_latest_version_by_name(name, track)

Static method to get the latest version by module name.

This is used internally by dynamic wrapper classes.