Skip to main content

Examples

Runnable example sources live in the repo under examples/sources.

Readers​

ExampleWhat it shows
readers/files_demoRuns offline on local JSONL/CSV/Parquet — the full fetch → shape → write flow with no credentials
readers/s3_demoReading objects from Amazon S3
readers/gcs_demoReading objects from Google Cloud Storage
readers/azure_blob_demoReading objects from Azure Blob Storage
readers/postgres_demoRead-only SELECT queries on PostgreSQL
readers/mysql_demoRead-only SELECT queries on MySQL
readers/mongodb_demoReading collections and aggregations from MongoDB
readers/deltalake_demoQuerying Delta Lake tables via DuckDB

Ads APIs​

Every advertising source maps to the shared vocabulary so one cross-network pipeline spans all platforms:

ExampleTransportWhat it shows
ads/google_adsSDKGoogle Ads GAQL queries, search_stream batches, and performance reporting
ads/microsoft_adsSDKMicrosoft Advertising SOAP services and CampaignPerformance reports
ads/meta_adsSDKMeta Marketing API campaigns, ad sets, and daily campaign insights
ads/linkedin_adsHTTPLinkedIn Marketing Rest.li endpoints, dotted query parameter encoding, and offset pagination
ads/amazon_adsHTTPAmazon Sponsored Products and profiles via OAuth2 refresh token grant and regional endpoints
ads/apple_adsHTTPApple Ads campaigns and reporting using POST body-based pagination and account header scoping
ads/openai_adsHTTPOpenAI Ads bearer auth, cursor pagination (last_id → after), and delivery insights

Running examples​

Offline files (no credentials needed)​

streamwright run examples/sources/readers/files_demo \
--output jsonl:out

Reads sample files in the example's data/ folder and writes JSONL exports to out/ with zero credentials or network access.

Running with credentials​

To run API connectors or database sources, supply credentials via a secrets file:

streamwright run examples/sources/ads/<network> \
--secrets secrets.yaml \
--set account_ids=123456,789012 \
--output jsonl:out
  • Secrets: Provide credentials through --secrets FILE (or STREAMWRIGHT_SECRET_<NAME> environment variables). StreamWright redacts all secrets automatically in logs.
  • Config: Pass configuration parameters via --set KEY=VALUE (or --config FILE). List parameters accept clean comma-separated values (e.g. --set account_ids=123456,789012).
  • Output: Choose an output format and destination with --output (e.g. jsonl:out, parquet:out, or duckdb:analytics.duckdb).