# A Report Script That Finds the Newest Data

A report script runs with one command instead of a person running notebook cells, finds the newest week's file with sorted and glob (which works because the file names start with the year), stacks every week into one table with concat, and takes its folder as an option through a main(argv) function, so running it again next week builds next week's report.

![Cheat sheet: A Report Script That Finds the Newest Data](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/926d05bd45d047a7bfd89b5102106b58.webp)

- Category: Data Analysis
- Level: Journeyman
- Tags: argparse, Command-Line Argument (python), concat(), glob, pathlib, python
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/data-report-script-cheat-sheet
