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 (defaults to my-model). The name must not conflict with an existing file or directory.
  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 from GitHub and creates a new directory with your project name.

Available templates

There are two templates to choose from:

python-demo

A complete working example with sample configuration, test data, and a Python forecasting script. Choose this template if you want to see a fully configured model that you can run and publish immediately.

python-barebones

A minimal skeleton with just the essential files. Choose this template if you want to start from scratch and configure everything yourself.

Project structure

After running pd4castr init with the python-demo template, your project directory looks like this:

my-price-model/
├── .pd4castrrc.json    # Model configuration
├── Dockerfile          # Container definition
├── model.py            # Your forecasting logic
├── requirements.txt    # Python dependencies
└── test_input/         # Local test data files

Here is what each file does:

  • .pd4castrrc.json — the model configuration file. It defines your model’s name, inputs, outputs, time horizon, and other settings. See Configuration File for a full reference.
  • Dockerfile — defines the Docker image that runs your model. The CLI uses this to build and test your model locally, and to push the image when you publish.
  • model.py — your forecasting logic. This is the entry point that Docker runs. It reads input data, performs calculations, and writes output.
  • test_input/ — a directory for local test data. When you run pd4castr fetch, data is downloaded here. When you run pd4castr test, the CLI serves files from this directory to your model container.

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.