Skip to content

CloudCruise/cloudcruise-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cloudcruise-python

MIT License PyPI - Version PyPI - Downloads GitHub Repo stars Discord YC W24

The official CloudCruise Python SDK for automated browser workflows, encrypted credential management, realtime run monitoring, and webhook verification.


Installation

pip install cloudcruise

Python 3.10 or newer is required. The package ships with type hints (py.typed).


Quick Start

from cloudcruise import CloudCruise, StartRunRequest

client = CloudCruise(
    api_key="<CLOUDCRUISE_API_KEY>",
    encryption_key="<CLOUDCRUISE_ENCRYPTION_KEY>",
)
# Alternatively, set CLOUDCRUISE_API_KEY and CLOUDCRUISE_ENCRYPTION_KEY
# environment variables and instantiate with `client = CloudCruise()`.

run = client.runs.start(
    StartRunRequest(
        workflow_id="105b7ae1-ce62-4a5c-b782-b4b0aec5175a",
        run_input_variables={"email": "test@example.com"},
    )
)

# Listen to specific event types (recommended - clean and type-safe)
run.on("execution.start", lambda e: print(f"Workflow started: {e['payload']['workflow_id']}"))
run.on("execution.step", lambda e: print(f"Step: {e['payload']['current_step']}"))
run.on("execution.success", lambda e: print(f"Success! Output: {e['payload'].get('data')}"))
run.on("end", lambda info: print(f"Run completed: {info['type']}"))

# Or use generic listener for all events (flattened structure)
# run.on("run.event", lambda event: print(f"{event['type']}: {event['payload']}"))

# Block until the run finishes and fetch final results
result = run.wait()
print(result.status, result.data)

Environment variables CLOUDCRUISE_API_KEY, CLOUDCRUISE_ENCRYPTION_KEY are also supported via lazy cloudcruise.client().


Clients

Client Description Module Docs
Vault AES-256-GCM credential storage and retrieval utilities cloudcruise.vault
Workflows Workflow definitions, metadata, and input validation cloudcruise.workflows
Runs Workflow execution with SSE-based realtime streaming cloudcruise.runs
Webhook Webhook payload verification and helpers cloudcruise.webhook

All clients are accessible via CloudCruise or the convenience cloudcruise.client() singleton.


Development

This project uses standard Python tooling with setuptools. See CONTRIBUTING.md for comprehensive instructions.

Quick start:

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -e ".[dev]"  # installs package + dev dependencies

# Run the unit test suite
python -m unittest discover -s tests -p "test_*.py" -v

For live staging tests, export CLOUDCRUISE_API_KEY and CLOUDCRUISE_ENCRYPTION_KEY, then run python -m unittest tests/test_live_staging.py -v.


Documentation & Resources


License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages