Intermediate   Chapter 194 · 30 min read · Module 15: Career and Interview Preparation

Python Portfolio Development

Learning objectives
  • After this chapter you can choose portfolio projects that show a range of skills.
  • You can structure a project folder with source code, tests, a README and a requirements file.
  • You can write a README that explains what a project does and how to run it.
  • You can check your portfolio with a simple quality checklist written in Python.

A portfolio is a small collection of projects that proves what you can do. A certificate says that you finished a course, but a project shows that you can build something real. For people who are starting a career, a good portfolio is often more convincing than a long list of skills.

A reader, such as a hiring manager, may spend only a few minutes looking at your work. This means each project must be easy to find, easy to understand and easy to run. Clean code, a clear README and a few tests make a strong first impression.

In this chapter you will learn which projects to choose, how to organise them, how to write the documentation and how to present everything online. We will also write small Python helpers that check a project folder, so you can see how a portfolio can be reviewed automatically.

What makes a good portfolio

Quality is more important than quantity. Three to five well-finished projects are better than twenty half-finished ones. Each project should solve a real or realistic problem, work when someone downloads it, and show a different skill. Variety also helps: for example, one command-line tool, one data project, one web application and one automation script.

Portfolio: a public collection of your best projects, usually hosted on GitHub, with notes that explain what each project does

Choosing projects

  • Solve your own problem: a budget tracker, a file organiser, a study timer.
  • Use real data: analyse a public dataset and show clear charts and conclusions.
  • Build a small web app or API with a database and simple login.
  • Automate a boring task: renaming files, sending reports, cleaning spreadsheets.
  • Contribute to an open-source project, even with a small documentation fix.
  • Avoid copying a tutorial exactly. Change the idea, add your own features and explain what you changed.

A clean project structure

A tidy folder tells the reader that you care about quality. Keep source code in one place, tests in another, and put the explanation at the top level. A common layout looks like this:

Example 1: typical project layout
expense_tracker/
  README.md
  requirements.txt
  .gitignore
  src/
    expense_tracker/
      __init__.py
      main.py
      storage.py
  tests/
    test_storage.py
(folder structure, not run)

The requirements.txt file lists the packages the project needs, so others can install them with pip install -r requirements.txt. The .gitignore file keeps clutter such as virtual environments and cache folders out of Git.

Write a README that helps

The README is the front door of your project. It should answer five questions in this order: What is this? Why does it exist? How do I install it? How do I use it? How do I run the tests? Add a screenshot or a short sample output when possible. Keep the sentences short and avoid hype.

Example 2: build a README text from project data
project = {
    'name': 'Expense Tracker',
    'summary': 'Track daily spending from the command line.',
    'install': 'pip install -r requirements.txt',
    'run': 'python -m expense_tracker',
    'tests': 'python -m pytest',
}
lines = ['# ' + project['name'], '', project['summary'], '', '## Install', project['install'], '', '## Run', project['run'], '', '## Test', project['tests']]
print('\n'.join(lines))
# Expense Tracker Track daily spending from the command line. ## Install pip install -r requirements.txt ## Run python -m expense_tracker ## Test python -m pytest

Quality signals reviewers look for

SignalWhy it matters
Readable names and small functionsShows you can write maintainable code
Tests that passShows you care about correctness
Type hints and docstringsShows professional habits
Regular, meaningful Git commitsShows how you work and think
Clear README with run stepsShows you respect the reader's time
No secrets in the codeShows security awareness
Never commit passwords, API keys or tokens. Put them in environment variables or a .env file that is listed in .gitignore.

Check your own portfolio automatically

You can turn a quality checklist into code. The function below receives a list of file names found in a project and reports which important files are missing. A real script could read the names from the disk with pathlib, but here we pass a list so the result is predictable.

Example 3: find missing files in a project
REQUIRED = ['README.md', 'requirements.txt', '.gitignore']

def missing_files(found):
    return [name for name in REQUIRED if name not in found]

print(missing_files(['README.md', 'main.py']))
print(missing_files(['README.md', 'requirements.txt', '.gitignore', 'main.py']))
['requirements.txt', '.gitignore'] []
Example 4: score a project with a checklist
checks = {
    'has readme': True,
    'has tests': True,
    'has requirements': False,
    'has screenshot': False,
}
score = sum(checks.values())
print(f'{score}/{len(checks)} checks passed')
for name, ok in checks.items():
    print('[x]' if ok else '[ ]', name)
2/4 checks passed [x] has readme [x] has tests [ ] has requirements [ ] has screenshot

Showing your work online

Create a GitHub profile with a photo, a short bio and your best repositories pinned at the top. Give each repository a short description and topics such as python or flask. If you can, deploy a web project so that people can open it with one click. A simple personal page that lists your projects, your skills and your contact details also helps. Write about what you learned in short posts; explaining a problem in your own words proves that you understand it.

Keep growing the portfolio

A portfolio is never finished. Revisit your oldest project every few months: fix style problems, add tests, improve the README. Remove projects that you are no longer proud of. Add new work that shows the skills you want to use in your next role. When you talk to an interviewer, be ready to explain every design choice, the hardest bug you fixed, and what you would do differently today.

Python syntax

Syntax
pip freeze > requirements.txt
pip install -r requirements.txt
Syntax
git add .
git commit -m 'Add storage module'
git push origin main
Syntax
if __name__ == '__main__':
    main()

Real-world applications

  • Applying for internships and junior developer jobs.
  • Showing freelance clients examples of your work.
  • Tracking your own growth over time.
  • Sharing tools with a community as open source.

Common mistakes

Mistake: Publishing many unfinished projects
Fix: Finish and polish three to five projects before adding more.
Mistake: Having no README or a README without run steps
Fix: Describe what the project is, how to install it, how to run it and how to test it.
Mistake: Committing passwords or API keys
Fix: Use environment variables and add secret files to .gitignore.
Mistake: Copying a tutorial project without changes
Fix: Add your own features, tests and an explanation of what you changed.
Mistake: Leaving code that does not run on a fresh computer
Fix: Test in a new virtual environment and keep requirements.txt up to date.

Important tips

  • Pin your best repositories on your GitHub profile.
  • Write commit messages in the present tense, like 'Add search feature'.
  • Add a short GIF or screenshot to the README.
  • Include a section called 'What I learned'.
  • Ask a friend to follow your README from scratch and note where they get stuck.

Key points summary

  • A portfolio proves your skills with working projects.
  • Three to five polished projects beat many unfinished ones.
  • A clear README and a tidy folder structure are essential.
  • Tests, type hints and clean Git history show professional habits.
  • Never publish secrets; keep the portfolio updated.

Exam and interview points

  • README and requirements.txt are the minimum documentation for a Python project.
  • pip freeze lists installed packages with versions.
  • if __name__ == '__main__' lets a file act as a script and a module.
  • Secrets belong in environment variables, not in source code.
  • Tests live in a separate tests folder and can be run with pytest.

Quick revision

  • Pick three to five varied projects.
  • Structure: README, requirements, src, tests.
  • README: what, why, install, run, test.
  • No secrets in Git.
  • Pin projects and keep improving them.

Frequently asked questions

How many projects do I need?

Three to five good projects are enough for most junior roles. Choose different types, such as a command-line tool, a data analysis and a web application.

Can I use ideas from tutorials?

Yes, as a starting point. Then extend the idea with your own features and write about your changes, so it is clear that the work is yours.

Do I need a personal website?

It helps but is not required. A well-organised GitHub profile with a good README on each repository is already strong.

What if my code is not perfect?

No code is perfect. Show that you can improve it: keep a list of known issues, add tests and refactor over time.

Practise this chapter

16 practice questions Take the chapter quiz

Related chapters