Skip to content

Instantly share code, notes, and snippets.

@decagondev
Created April 29, 2025 16:16
Show Gist options
  • Select an option

  • Save decagondev/2c6959168da838921988b7b0e28bea20 to your computer and use it in GitHub Desktop.

Select an option

Save decagondev/2c6959168da838921988b7b0e28bea20 to your computer and use it in GitHub Desktop.

Utility Profit Workflow Scripts

  • initial_curls.sh (script to perform a flow of curls to get the initial json data from the api)

  • merge_forms.py (script to merge the json data files in to one that can be sent to ombiform)

    Merge Process

flowchart TD
  A(Start) --> B[Find files matching form_*.json]
  B --> C{Files found?}
  C -- No --> D[Print error and exit]
  C -- Yes --> E[Initialize merged and seen_defs]
  E --> F[For each file form_<provider>.json]
  F --> G[Read JSON data]
  G --> H[Extract provider_id from filename]
  H --> I{For each field name, meta}
  I --> J{Is name in merged?}
  J -- No --> K[Add name→meta to merged<br/>Record its definition]
  J -- Yes --> L{Is meta identical?}
  L -- Yes --> M[Skip this field]
  L -- No --> N[Rename to name_providerID<br/>Add renamed field to merged]
  K --> O[Next field]
  M --> O
  N --> O
  O --> P[Next file]
  P --> Q[Write merged → omniform.json]
  Q --> R[Print success & exit]
Loading

A fully self‑contained Python script (utility_setup.py) that:

  • Searches for your address

  • Fetches the mapped providers

  • Downloads each provider’s form schema

  • Merges the schemas into omniform_schema.json

  • Loads your answers from a JSON file and builds omniform.json

  • Submits the order and handles optional 2FA

  • Polls for completion and writes the final result to activation_result.json

Usage:

export API_KEY=your_api_key_here
python utility_setup.py \
  --address "123 Main St, Springfield" \
  --answers answers.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment