Knowledgebase

Organising a Python Project Print

  • python, password, guide, howto, solution, zillionkinghost, hosting, support
  • 0

Structure.

WHAT A SIMPLE PROJECT CONTAINS

Your code files A requirements file listing dependencies A readme explaining what it does and how to run it Configuration, separate from code

WHAT TO SEPARATE

Code from configuration Code from data Code from credentials

THE CREDENTIALS POINT

Never place passwords or keys in code.

Read them from the environment or a configuration file excluded from version control.

WHAT TO EXCLUDE FROM VERSION CONTROL

The virtual environment Configuration containing secrets Generated files Data files, usually

WHAT TO NAME CLEARLY

Files, by what they do.

WHEN TO SPLIT INTO SEVERAL FILES

When one file becomes hard to navigate, or when parts are reusable.

WHAT TO PUT IN THE README

What it does What it needs How to set it up How to run it

WHY

For the person maintaining it later, who is frequently you.

WHAT TO ADD EARLY

Version control, even for a small project.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot