נבנה על ידיBuilt by Ariel Yohimovich

חזרה למפגשBack
PythonPython

פרויקט אמצעMidterm project

מפגש 31: מחברים הכול לגרסה 1.0, עם תכנון, בדיקות והצגה.Session 31: Put it all together into version 1.0, with planning, tests and a demo.

מה נעשה היוםToday's plan

  • תכנוןPlanning
  • מבנהStructure
  • ממשקInterface
  • בדיקותTests
  • READMEREADME
  • הגשהSubmit
נושאTopic 1

תכנוןPlanning

לתכנן לפני שכותביםPlan before you code

  • משפט אחד: מה הכלי עושהOne sentence: what the tool does
  • MVP: שלוש פקודותMVP: three commands
  • רשימת "אחר כך"A "later" list

אנלוגיהAnalogy

MVP הוא כמו אופניים לפני מכונית: גם האופניים לוקחים אתכם ממקום למקום, ומהם לומדים מה באמת צריך.An MVP is like a bicycle before a car: the bike also gets you from A to B, and teaches you what you really need.
נושאTopic 2

מבנהStructure

מבנה הפרויקטProject structure

  • models.py: הנתוניםmodels.py: the data
  • storage.py: שמירה וטעינהstorage.py: saving and loading
  • cli.py: המשתמש; test_shelf.py: הבדיקותcli.py: the user; test_shelf.py: the tests

אנלוגיהAnalogy

פרויקט מחולק לקבצים הוא כמו מטבח של מסעדה: עמדת סלטים, עמדת גריל, עמדת קינוחים. כל אחד יודע את העבודה שלו, ויחד יוצאת ארוחה.A project split into files is like a restaurant kitchen: a salad station, a grill station, a dessert station. Each knows its job, and together a meal comes out.
נושאTopic 3

ממשקInterface

הממשק: cli.pyThe interface: cli.py

  • argparse עם שלוש פקודותargparse with three commands
  • main(argv=None) לבדיקותmain(argv=None) for tests
  • קוד יציאה 1 כשספר לא נמצאExit code 1 when a book isn't found

אנלוגיהAnalogy

cli.py הוא כמו פקיד קבלה: הוא לא מבשל ולא מנקה, רק מקבל בקשות ומעביר אותן למי שאחראי.cli.py is like a receptionist: doesn't cook or clean, just takes requests and passes them to whoever is responsible.
נושאTopic 4

בדיקותTests

בדיקות לכל הפרויקטTests for the whole project

  • tmp_path: תיקייה זמנית לכל בדיקהtmp_path: a temp folder per test
  • monkeypatch מחליף את נתיב הקובץmonkeypatch swaps the file path
  • capsys תופס את הפלטcapsys captures the output

אנלוגיהAnalogy

monkeypatch הוא כמו להחליף את המים בבקבוק במים צבועים לניסוי: אותו בקבוק, אותה תנועה, אבל רואים בדיוק לאן הכול זורם, ובסוף מחזירים.monkeypatch is like swapping a bottle's water for dyed water in an experiment: same bottle, same flow, but you see exactly where it goes, and then put it back.
נושאTopic 5

READMEREADME

READMEREADME

  • מה, איך מתקינים, איך משתמשיםWhat, how to install, how to use
  • דוגמת הרצה אמיתיתA real example run
  • Markdown: #, רשימות, בלוקי קודMarkdown: #, lists, code blocks

אנלוגיהAnalogy

README הוא כמו הכריכה האחורית של ספר: בכמה שורות מבינים אם זה בשבילכם ואיך מתחילים.A README is like a book's back cover: in a few lines you know whether it's for you and how to start.
נושאTopic 6

הגשהSubmit

הגשה ומחווןSubmission and rubric

  • מחוון של 100 נקודותA 100-point rubric
  • בודקים את עצמכם לפני הגשהCheck yourself before submitting
  • מעלים ל-GitHub (מפגש 20)Push to GitHub (session 20)

אנלוגיהAnalogy

מחוון הוא כמו רשימת ציוד לטיול: עוברים עליה לפני היציאה, ולא מגלים בשטח ששכחתם את המים.A rubric is like a hiking packing list: check it before leaving, rather than discovering on the trail that you forgot water.

משפט אחד: מה הכלי עושהOne sentence: what the tool does

MVP: שלוש פקודותMVP: three commands

רשימת "אחר כך"A "later" list

models.py: הנתוניםmodels.py: the data

storage.py: שמירה וטעינהstorage.py: saving and loading

cli.py: המשתמש; test_shelf.py: הבדיקותcli.py: the user; test_shelf.py: the tests

argparse עם שלוש פקודותargparse with three commands

main(argv=None) לבדיקותmain(argv=None) for tests

קוד יציאה 1 כשספר לא נמצאExit code 1 when a book isn't found

tmp_path: תיקייה זמנית לכל בדיקהtmp_path: a temp folder per test

monkeypatch מחליף את נתיב הקובץmonkeypatch swaps the file path

capsys תופס את הפלטcapsys captures the output

מה, איך מתקינים, איך משתמשיםWhat, how to install, how to use

דוגמת הרצה אמיתיתA real example run

Markdown: #, רשימות, בלוקי קודMarkdown: #, lists, code blocks

מחוון של 100 נקודותA 100-point rubric

בודקים את עצמכם לפני הגשהCheck yourself before submitting

מעלים ל-GitHub (מפגש 20)Push to GitHub (session 20)

מה למדנוWhat we learned

  • משפט אחד: מה הכלי עושהOne sentence: what the tool does
  • models.py: הנתוניםmodels.py: the data
  • argparse עם שלוש פקודותargparse with three commands
  • tmp_path: תיקייה זמנית לכל בדיקהtmp_path: a temp folder per test
  • מה, איך מתקינים, איך משתמשיםWhat, how to install, how to use
  • מחוון של 100 נקודותA 100-point rubric

עכשיו לתרגולNow, practice

5 תרגילים ו-2 אתגרים, עם בדיקה אוטומטית5 exercises and 2 challenges, auto-checked
הערות מרצהSpeaker notes

נבנה על ידיBuilt by Ariel Yohimovich