Skip to content

File structure and data dictionary

Folders and files, file formats and every field's definition.

What it explains and when it is useful

A file structure diagram shows how the project's files are organised. A file format specification describes the exact layout of any file the program reads or writes. A data dictionary defines every stored field.

When to use it: File structure: multi-file projects. File format: any program that reads or writes files (CSV, JSON, text). Data dictionary: any solution that stores data, in files or a database.

Worked example

Illustrative: PracticePal is a fictional project used throughout this guide.

File structure of the PracticePal project: Python modules, templates, static files, a data folder with the SQLite database and CSV import, an exports folder for reports and a tests folderpracticepal/project folder (whole folder goes in the appendix as source code)app.pystarts Flask and the schedulerviews.pyroutes: one function per URLauth.pypassword hashing, login, rolesrules.pyclash, weekly cap and adjacency checkswaitlist.pyqueue operations and offersscheduler.pytimed jobs: no-shows, expired offersreports.pyweekly usage CSVdb.pyevery SQL query lives hereschema.sqlCREATE TABLE statementstemplates/Jinja HTML: base, week, mine, admin …static/week.js (fetch calls), style.cssdata/not served to browserspracticepal.dbSQLite database filestudents.csvimport file from the school officeexports/generated reportsusage_2026-W45.csvone file per ISO weektests/pytest unit tests for rules.py and waitlist.py
PracticePal's project folder.

Scroll sideways to see the whole diagram.

File format specification: usage report CSV

File name exports/usage_YYYY-Www.csv (ISO week), UTF-8, comma-separated, one header row, one row per room, rooms in code order.

ColumnTypeExampleRule
roomtext (2)P5room code from ROOM
bookingsinteger31confirmed + completed + no-show
minutes_usedinteger78030 × completed bookings
usage_pctdecimal (1 dp)39.0minutes_used ÷ 2,000 available minutes × 100
no_showsinteger4status = no_show

Data dictionary (extract)

Table.fieldTypeSize / rangeValidationExample
STUDENT.emailTEXT≤ 80 charsends @school.org; uniquem.l@school.org
STUDENT.password_hashTEXT≈ 100 charsnever the plain passwordscrypt:32768:8:1$…
STUDENT.roleTEXTstudent | headone of two valuesstudent
ROOM.room_codeTEXT2 charsP1–P6; primary keyP5
BOOKING.start_timeTEXT (ISO datetime)07:30–17:00 starton :00 or :30; Mon–Fri; not in the past2026-11-03T12:30
BOOKING.loudINTEGER0 or 11 only if ROOM.loud_allowed = 11
BOOKING.statusTEXT5 valuesconfirmed, checked_in, completed, cancelled, no_showconfirmed
WAITLIST_ENTRY.stateTEXT5 valueswaiting, offered, accepted, expired, withdrawnwaiting

Notation and legend

Symbol or partMeaning
Folder iconDirectory
Page iconFile
Indent and linesWhat is inside which folder
Italic noteThe responsibility of the file

Design decisions it communicates

A diagram earns marks when you explain the decisions it shows. In PracticePal's documentation these would each be one sentence:

  • Data files sit outside the static folder so the web server never serves the database.
  • Reports have one file per ISO week, so re-running a report for the same week replaces it.
  • The status and state fields have fixed value lists, which the state diagrams explain.

Common mistakes

  • A screenshot of a file explorer with no explanation.
  • No format given for files the program reads, so a third party could not recreate them.
  • A data dictionary without validation rules.

Checklist for your own version

Ticks are saved in this browser only, so you can use the list while you draft.