Skip to content

API Reference

This page is auto-generated from Python docstrings.


cintel.pipeline

pipeline.py - Project script (example).

Author: Your Name Here Date: 2026-mm-dd

Purpose

Confirm your project environment is set up correctly. Run this script to see a log message in the terminal.

Run as a Module

uv run python -m cintel.pipeline

DESIGN:

Use this file to first learn and then apply your skills.

Reusable functions that do the work are kept in a external files. We import functions and pass in what they need through their parentheses. Shared utility functions can be imported into a Python module or a reactive marimo notebook app.

SKILLS:

  • Setting up a professional Python project.
  • Managing a project environment using uv.
  • Editing project code using VS Code editor.
  • Tracking project source code using git version control system.
  • Storing and sharing projects using GitHub.
  • Writing a professional Python file, often called a script.
  • Providing this opening docstring with your name and date.
  • Providing an opening docstring with important information about the file.
  • Importing freely available code into a Python file.
  • Configuring a logger to record information as the file runs.
  • Declaring and using global constants for folder paths.
  • Defining a main function that "orchestrates" the project logic.
  • Using a conditional execution block to trigger main().

main

main() -> None

This function is where the execution begins.

In this course, we will use this function to "orchestrate" the main steps of the project.

In this first module, this function demonstrates logging (a way of recording what the project is doing) and path management.

Both are important and will be used throughout the course.

The first function we call is the log_header() function which we imported up above.

Can you tell what package it comes from?

It comes from the datafun_toolkit.logger package.

You can find it listed in pyproject.toml in the [dependencies] section. That's where we list free code packages that others write and maintain. We use them for free. Knowing how to use free code packages is a valuable skill.

Once we have imported the log_header function above, we can call it here in main.

Calling log_header() logs an opening. Call it at the beginning of the main function to provide a clear visual separation of pipeline runs. When calling the function, we must provide 2 arguments that we "pass in" through the parentheses: - the logger instance (LOG) and - a string with a project name, e.g., "CINTEL".

We'll also call log_path(). Calling log_path() logs a path to a file or folder in the project without revealing sensitive information. When calling the function, we must provide 3 arguments that we "pass in" through the parentheses: - the logger instance, - a descriptive name for the path, and - the path itself.

Source code in src/cintel/pipeline.py
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
def main() -> None:
    """This function is where the execution begins.

    In this course, we will use this function to "orchestrate"
    the main steps of the project.

    In this first module, this function demonstrates logging
    (a way of recording what the project is doing) and
    path management.

    Both are important and will be used throughout the course.

    The first function we call is the log_header() function
    which we imported up above.

    Can you tell what package it comes from?

    It comes from the `datafun_toolkit.logger` package.

    You can find it listed in `pyproject.toml`
    in the `[dependencies]` section.
    That's where we list free code packages
    that others write and maintain.
    We use them for free.
    Knowing how to use free code packages is a valuable skill.

    Once we have imported the log_header function above,
    we can call it here in main.

    Calling log_header() logs an opening.
    Call it at the beginning of the main function
    to provide a clear visual separation of pipeline runs.
    When calling the function, we must provide 2 arguments
    that we "pass in" through the parentheses:
    - the logger instance (LOG) and
    - a string with a project name, e.g., "CINTEL".

    We'll also call log_path().
    Calling log_path() logs a path to a file or folder in the project
    without revealing sensitive information.
    When calling the function, we must provide 3 arguments
    that we "pass in" through the parentheses:
    - the logger instance,
    - a descriptive name for the path, and
    - the path itself.
    """
    log_header(LOG, "CINTEL")

    LOG.info("========================")
    LOG.info("START main()")
    LOG.info("========================")

    # Always use the the imported log_path() function
    # It will log only relative paths and not reveal sensitive information.
    # First, log the root project folder (ROOT_DIR)
    # Then, log other interesting paths to explore.
    log_path(LOG, "ROOT_DIR", ROOT_DIR)
    log_path(LOG, "DOCS_DIR", DOCS_DIR)
    log_path(LOG, "SOURCE_DIR", SOURCE_DIR)
    log_path(LOG, "CINTEL_DIR", CINTEL_DIR)

    # Log a custom message (change this to something meaningful for your project)
    LOG.info("Hello World from Dr. Case!")

    LOG.info("========================")
    LOG.info("Pipeline executed successfully!")
    LOG.info("========================")
    LOG.info("END main()")

◄ Back to 🏠 Home