Scaffold a Project

The pd4castr init command creates a new model project from a template. It sets up the directory structure, configuration file, and starter code so you can begin building your model right away.

Run the Command

From any directory, run:

pd4castr init

The CLI prompts you for two things:

  1. Project name — the name of the directory to create.
  2. Template — the starter template to use.
? Name your new model project: my-price-model
? Select a template: python-demo
✔ Template fetched successfully

The CLI fetches the template and creates a new directory with your project name.

Available Templates

Two templates ship with the CLI: python-barebones and python-demo. Both follow the same IO contract: your container reads inputs from INPUT_<KEY>_URL environment variables and uploads its result to OUTPUT_URL with an HTTP PUT request. The difference is how much starter code each one includes. See Model Inputs and Model Outputs for the full IO contract.

python-barebones

Choose python-barebones if you want to start from scratch. The config has empty inputs and outputs arrays, and model.py is a single file with a run_model() stub for you to implement.

my-price-model/
├── .pd4castrrc.json   # Model config (empty inputs and outputs)
├── Dockerfile         # Runs `python model.py`
├── model.py           # Stub `run_model()` to implement
├── requirements.txt
└── test_input/        # Local fixtures served by `pd4castr test`

python-demo

Choose python-demo if you want a complete working example you can run and publish immediately. The config defines a full set of output series and AEMO MMS fetched inputs, and the forecasting code is split across focused modules under model/.

my-price-model/
├── .pd4castrrc.json          # Model config with sample inputs and outputs
├── Dockerfile                # Runs `python model/main.py`
├── model/
│   ├── main.py               # Orchestrator, entry point
│   ├── load_input_data.py    # Reads INPUT_*_URL env vars and downloads inputs
│   ├── run_model.py          # The forecasting logic
│   └── upload_output_data.py # PUTs the result to OUTPUT_URL
├── queries/                  # SQL for the AEMO MMS fetchers
├── requirements.txt
├── test_input/               # Sample input files for `pd4castr test`
└── test_output/              # Where `pd4castr test` writes output

The load, run, and upload split mirrors how a real model tends to grow. Keep this structure as your model evolves, or collapse it back into a single file if that suits you better.

Next Steps

After scaffolding your project:

  1. Log in if you haven’t already.
  2. Review and customise the Configuration File to match your model’s requirements.
  3. Configure your Model Inputs and Model Outputs.
  4. Test your model locally, then publish it to the platform.