Blazing-work/blazing-examples

Python

0

46 commits

updated Jul 31, 2026

See the code

README

Blazing Examples

License: MIT

The official examples repository for Blazing - demonstrating real-world use cases for Blazing Core and Blazing Flow.

Live Examples: https://blazing.work/docs/examples

About

This repository serves as the single source of truth for all Blazing examples. Examples are automatically:

  • Displayed on the Blazing documentation website
  • Tested in CI to ensure they work
  • Available for the community to run, modify, and contribute

Inspired by modal-examples.

Repository Structure

blazing-examples/
├── 01_getting_started/       # Basic examples to get started
├── 02_web_endpoints/         # Web servers, APIs, HTTP endpoints
├── 03_data_processing/       # ETL, batch processing, data pipelines
├── 04_async_parallel/        # Async patterns and parallel execution
├── 05_integrations/          # Third-party service integrations
├── 06_advanced/              # Advanced patterns and techniques
├── 07_api_patterns/          # API usage patterns and sync helpers
├── 08_runtime_routing/       # Runtime behavior, routing, depth, worker types
├── 09_sandbox_isolation/     # Sandboxed execution and Pyodide patterns
├── 10_web_endpoints_advanced/# Advanced endpoint and ASGI integrations
├── 11_integrations_platform/ # Platform integrations and resilience patterns
├── 12_gpu_ai_agents/         # GPU workflows and agent-style patterns
├── 13_deployment_packaging/  # Packaging and deployment patterns
├── generate_manifest.py      # Generates examples.json manifest
└── examples.json             # Generated manifest (auto-updated)

Categories

01_getting_started

Basic examples to help you get started quickly with Blazing Core and Flow.

02_web_endpoints

Examples of web servers, REST APIs, GraphQL endpoints, and WebSocket servers.

03_data_processing

Data transformation, ETL pipelines, and batch processing examples.

04_async_parallel

Asynchronous programming patterns and parallel execution for maximum throughput.

05_integrations

Integration examples with popular services (databases, APIs, cloud services).

06_advanced

Advanced patterns including CRDT queues, custom runtimes, and zero-trust networking.

07_api_patterns

API usage patterns including wait_result, handle patterns, and sync helpers.

08_runtime_routing

Runtime behavior, routing, depth tracking, worker types, and state machines.

09_sandbox_isolation

Sandboxed execution patterns, Pyodide dependencies, and isolation strategies.

10_web_endpoints_advanced

Advanced HTTP endpoint and ASGI server integration patterns.

11_integrations_platform

Platform integrations, local connectors, and resilience patterns.

12_gpu_ai_agents

GPU workflows and agent-style sandbox patterns.

13_deployment_packaging

Container images and packaging for sandbox/workflow dependencies.

Running Examples

Prerequisites

# Install Blazing
pip install blazing

# Configure credentials
blazing configure

Run Locally

# Navigate to an example directory
cd 01_getting_started/hello_world

# Run the example
python flow.py

Deploy to Production

blazing deploy flow.py

Writing Examples

Example Template

Each example should follow this structure:

"""
# Example Title

Brief description of what this example demonstrates.

## Metadata
- **Product**: Blazing Core | Blazing Flow
- **Difficulty**: Beginner | Intermediate | Advanced | Expert
- **Time**: X min
- **Tags**: tag1, tag2, tag3

## Description

Detailed description of:
- What this example does
- Key concepts demonstrated
- Use cases

## What you'll learn

- Bullet point 1
- Bullet point 2
- Bullet point 3
"""

# Your example code here

Adding a New Example

  1. Choose the appropriate category directory
  2. Create a new folder with a descriptive name (use underscores)
  3. Add flow.py, meta.json, and EXPECTED_OUTPUT.md
  4. Follow the template above in flow.py
  5. Write clear, well-commented code
  6. Test your example locally
  7. Run the manifest generator:
python generate_manifest.py
  1. Commit and push:
git add .
git commit -m "Add: [example name]"
git push

The documentation website will automatically update with your new example!

Manifest System

The generate_manifest.py script scans all example files and creates examples.json, which contains:

  • Example metadata (title, description, difficulty, etc.)
  • Category and product associations
  • GitHub URLs for each example
  • Tags for searchability

This manifest is consumed by the documentation website at build time.

Regenerating the Manifest

python generate_manifest.py

This should be run automatically in CI, but you can run it locally to preview changes.

Contributing

We welcome contributions! To contribute an example:

  1. Fork this repository
  2. Create a new branch (git checkout -b feature/my-example)
  3. Add your example following the guidelines above
  4. Test your example locally
  5. Run python generate_manifest.py
  6. Commit your changes
  7. Push to your fork
  8. Open a Pull Request

Contribution Guidelines

  • Quality over quantity: Examples should be production-ready and well-documented
  • Clear documentation: Every example must have a comprehensive docstring
  • Working code: All examples must run successfully
  • Follow conventions: Use the template structure and naming conventions
  • Test before submitting: Run your example locally and ensure it works

Example Metadata Fields

FieldRequiredDescriptionExample
ProductYesWhich product (Blazing Core or Blazing Flow)Blazing Core
DifficultyYesSkill level requiredBeginner, Intermediate, Advanced, Expert
TimeYesEstimated time to complete10 min
TagsYesComma-separated searchable tagsapi, fastapi, rest

CI/CD

This repository uses GitHub Actions to:

  • Validate all examples compile
  • Run example tests
  • Generate and commit updated examples.json
  • Deploy examples to staging environment

License

MIT License - see LICENSE for details

Resources


Questions? Open an issue or reach out on Discord

Blazing-work/blazing-examples

Python

0

46 commits

updated Jul 31, 2026

See the code

README

Blazing Examples

License: MIT

The official examples repository for Blazing - demonstrating real-world use cases for Blazing Core and Blazing Flow.

Live Examples: https://blazing.work/docs/examples

About

This repository serves as the single source of truth for all Blazing examples. Examples are automatically:

  • Displayed on the Blazing documentation website
  • Tested in CI to ensure they work
  • Available for the community to run, modify, and contribute

Inspired by modal-examples.

Repository Structure

blazing-examples/
├── 01_getting_started/       # Basic examples to get started
├── 02_web_endpoints/         # Web servers, APIs, HTTP endpoints
├── 03_data_processing/       # ETL, batch processing, data pipelines
├── 04_async_parallel/        # Async patterns and parallel execution
├── 05_integrations/          # Third-party service integrations
├── 06_advanced/              # Advanced patterns and techniques
├── 07_api_patterns/          # API usage patterns and sync helpers
├── 08_runtime_routing/       # Runtime behavior, routing, depth, worker types
├── 09_sandbox_isolation/     # Sandboxed execution and Pyodide patterns
├── 10_web_endpoints_advanced/# Advanced endpoint and ASGI integrations
├── 11_integrations_platform/ # Platform integrations and resilience patterns
├── 12_gpu_ai_agents/         # GPU workflows and agent-style patterns
├── 13_deployment_packaging/  # Packaging and deployment patterns
├── generate_manifest.py      # Generates examples.json manifest
└── examples.json             # Generated manifest (auto-updated)

Categories

01_getting_started

Basic examples to help you get started quickly with Blazing Core and Flow.

02_web_endpoints

Examples of web servers, REST APIs, GraphQL endpoints, and WebSocket servers.

03_data_processing

Data transformation, ETL pipelines, and batch processing examples.

04_async_parallel

Asynchronous programming patterns and parallel execution for maximum throughput.

05_integrations

Integration examples with popular services (databases, APIs, cloud services).

06_advanced

Advanced patterns including CRDT queues, custom runtimes, and zero-trust networking.

07_api_patterns

API usage patterns including wait_result, handle patterns, and sync helpers.

08_runtime_routing

Runtime behavior, routing, depth tracking, worker types, and state machines.

09_sandbox_isolation

Sandboxed execution patterns, Pyodide dependencies, and isolation strategies.

10_web_endpoints_advanced

Advanced HTTP endpoint and ASGI server integration patterns.

11_integrations_platform

Platform integrations, local connectors, and resilience patterns.

12_gpu_ai_agents

GPU workflows and agent-style sandbox patterns.

13_deployment_packaging

Container images and packaging for sandbox/workflow dependencies.

Running Examples

Prerequisites

# Install Blazing
pip install blazing

# Configure credentials
blazing configure

Run Locally

# Navigate to an example directory
cd 01_getting_started/hello_world

# Run the example
python flow.py

Deploy to Production

blazing deploy flow.py

Writing Examples

Example Template

Each example should follow this structure:

"""
# Example Title

Brief description of what this example demonstrates.

## Metadata
- **Product**: Blazing Core | Blazing Flow
- **Difficulty**: Beginner | Intermediate | Advanced | Expert
- **Time**: X min
- **Tags**: tag1, tag2, tag3

## Description

Detailed description of:
- What this example does
- Key concepts demonstrated
- Use cases

## What you'll learn

- Bullet point 1
- Bullet point 2
- Bullet point 3
"""

# Your example code here

Adding a New Example

  1. Choose the appropriate category directory
  2. Create a new folder with a descriptive name (use underscores)
  3. Add flow.py, meta.json, and EXPECTED_OUTPUT.md
  4. Follow the template above in flow.py
  5. Write clear, well-commented code
  6. Test your example locally
  7. Run the manifest generator:
python generate_manifest.py
  1. Commit and push:
git add .
git commit -m "Add: [example name]"
git push

The documentation website will automatically update with your new example!

Manifest System

The generate_manifest.py script scans all example files and creates examples.json, which contains:

  • Example metadata (title, description, difficulty, etc.)
  • Category and product associations
  • GitHub URLs for each example
  • Tags for searchability

This manifest is consumed by the documentation website at build time.

Regenerating the Manifest

python generate_manifest.py

This should be run automatically in CI, but you can run it locally to preview changes.

Contributing

We welcome contributions! To contribute an example:

  1. Fork this repository
  2. Create a new branch (git checkout -b feature/my-example)
  3. Add your example following the guidelines above
  4. Test your example locally
  5. Run python generate_manifest.py
  6. Commit your changes
  7. Push to your fork
  8. Open a Pull Request

Contribution Guidelines

  • Quality over quantity: Examples should be production-ready and well-documented
  • Clear documentation: Every example must have a comprehensive docstring
  • Working code: All examples must run successfully
  • Follow conventions: Use the template structure and naming conventions
  • Test before submitting: Run your example locally and ensure it works

Example Metadata Fields

FieldRequiredDescriptionExample
ProductYesWhich product (Blazing Core or Blazing Flow)Blazing Core
DifficultyYesSkill level requiredBeginner, Intermediate, Advanced, Expert
TimeYesEstimated time to complete10 min
TagsYesComma-separated searchable tagsapi, fastapi, rest

CI/CD

This repository uses GitHub Actions to:

  • Validate all examples compile
  • Run example tests
  • Generate and commit updated examples.json
  • Deploy examples to staging environment

License

MIT License - see LICENSE for details

Resources


Questions? Open an issue or reach out on Discord