Skip to content
Python for Quantitative Finance / Data access and delivery

Packaging a Quantitative Model

A batch job and a test suite need a stable way to import the pricing engine. This lesson installs the supplied teaching package, traces its public API and runs it from a configuration file. The package keeps the pricing formula separate from file handling and reporting.

Learning objectives. By the end of this note you should be able to:
  • draw a minimal src/mypkg/ layout with __init__.py and focused modules;
  • import a pricing function from a separate runner script;
  • state what belongs in the package versus scripts versus notebooks;
  • explain "ship the model" as an installable, testable API.

In this lesson

  1. Install and inspect a real package
  2. What "ship the model" means
  3. Imports and the name clash lesson
  4. The package metadata
  5. Composition with earlier design
  6. A runner that only orchestrates
  7. Versioning and compatibility

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or browse the Python for Quantitative Finance syllabus.