Whatβs in This Template Project?ο
π This project is designed for a Python-based code repository. It includes features to help you manage, test, document, and share your code.
Below is an overview of the files and folders youβll find in the template-project, along with what they do and why theyβre useful. If youβre new to GitHub or Python packaging, this is your orientation.
π Project Structure Overviewο
π· This is what the template looks like when you clone or fork it:
π template-project File Structureο
A minimal, modular Python project structure for collaborative research and reproducible workflows.
template-project/
βββ template_project # [core] Main Python package with scientific code
β βββ __init__.py # [core] Makes this a Python package
β βββ plotters.py # [core] Functions to plot data
β βββ readers.py # [core] Functions to read raw data into xarray datasets
β βββ read_rapid.py # [core] Example for a separate module for a specific dataset
β βββ writers.py # [core] Functions to write data (e.g., to NetCDF)
β βββ tools.py # [core] Utilities for unit conversion, calculations, etc.
β βββ logger.py # [core] Structured logging configuration for reproducible runs
β βββ template_project.mplstyle # [core] Default plotting parameters
β βββ utilities.py # [core] Helper functions (e.g., file download or parsing)
β
βββ tests/ # [test] Unit tests using pytest
β βββ test_readers.py # [test] Test functions in readers.py
β βββ test_tools.py # [test] Test functions in tools.py
β βββ test_utilities.py # [test] Test functions in utilities.py
β βββ ...
β
βββ docs/ # [docs]
β βββ source/ # [docs] Sphinx documentation source files
β β βββ conf.py # [docs] Setup for documentation
β β βββ index.rst # [docs] Main page with menus in *.rst
β β βββ setup.md # [docs] One of the documentation pages in *.md
β β βββ template_project.rst # [docs] The file to create the API based on docstrings
β β βββ ... # [docs] More *.md or *.rst linked in index.rst
β β βββ _static # [docs] Figures
β β βββ css/custom.css # [docs, style] Custom style sheet for docs
β β βββ logo.png # [docs] logo for top left of docs/
β βββ Makefile # [docs] Build the docs
β
βββ notebooks/ # [demo] Example notebooks
β βββ demo.ipynb # [demo] Also run in docs.yml to appear in docs
β βββ ...
β
βββ data/ # [data]
β βββ moc_transports.nc # [data] Example data file used for the template.
β
βββ logs/ # [core] Log output from structured logging
β βββ amocarray_*.log # [core]
β
βββ .github/ # [ci] GitHub-specific workflows (e.g., Actions)
β βββ workflows/
β β βββ docs.yml # [ci] Test build documents on *pull-request*
β β βββ docs_deploy.yml # [ci] Build and deploy documents on "merge"
β β βββ pypi.yml # [ci] Package and release on GitHub.com "release"
β β βββ test.yml # [ci] Run pytest on tests/test_<name>.py on *pull-request*
β βββ ISSUE_TEMPLATE.md # [ci, meta] Template for issues on Github
β βββ PULL_REQUEST_TEMPLATE.md # [ci, meta] Template for pull requests on Github
β
βββ .gitignore # [meta] Exclude build files, logs, data, etc.
βββ requirements.txt # [meta] Pip requirements
βββ requirements-dev.txt # [meta] Pip requirements for development (docs, tests, linting)
βββ .pre-commit-config.yaml # [style] Instructions for pre-commits to run (linting)
βββ pyproject.toml # [ci, meta, style] Build system and config linters
βββ CITATION.cff # [meta] So Github can populate the "cite" button
βββ README.md # [meta] Project overview and getting started
βββ LICENSE # [meta] Open source license (e.g., MIT as default)
The tags above give an indication of what parts of this template project are used for what purposes, where:
# [core]β Scientific core logic or core functions used across the project.
# [docs]β Documentation sources, configs, and assets for building project docs.# [test]β Automated tests for validating functionality.# [demo]β Notebooks and minimal working examples for demos or tutorials.# [data]β Sample or test data files.# [ci]β Continuous integration setup (GitHub Actions).# [style]β Configuration for code style, linting, and formatting.# [meta]β Project metadata (e.g., citation info, license, README).
Note: There are also files that you may end up generating but which donβt necessarily appear in the project on GitHub.com (due to being ignored by your .gitignore). These may include your environment (venv/, if you use pip and virtual environments), distribution files dist/ for building packages to deploy on http://pypi.org, htmlcov/ for coverage reports for tests, template_project_efw.egg-info for editable installs (e.g., pip install -e .).
π Notesο
Modularity: Code is split by function (reading, writing, tools).
Logging: All major functions support structured logging to
logs/.Tests: Pytest-compatible tests are in
tests/, with one file per module.Docs: Sphinx documentation is in
docs/.
π° The Basics (Always Included)ο
README.mdβ The first thing people see when they visit your GitHub repo. Use this to explain what your project is, how to install it, and how to get started.LICENSEβ Explains what others are allowed to do with your code. This template uses the MIT License:β Very permissive β allows commercial and private use, modification, and distribution.
π More license info: choosealicense.com
.gitignoreβ Tells Git which files/folders to ignore (e.g., system files, data outputs).requirements.txtβ Lists the Python packages your project needs to run.
π§° Python Packaging and Developmentο
pyproject.tomlβ A modern configuration file for building, installing, and describing your package (e.g. name, author, dependencies).requirements-dev.txtβ Additional tools for developers (testing, linting, formatting, etc.).template_project/β Your main code lives here. Python will treat this as an importable module.pip install -e .β Lets you install your project locally in a way that updates as you edit files.
π§ͺ Testing and Continuous Integrationο
tests/β Folder for test files. Use these to make sure your code works as expected..github/workflows/β GitHub Actions automation:tests.ymlβ Runs your tests automatically when you push changes.docs.ymlβ Builds your documentation to check for errors.docs_deploy.ymlβ Publishes documentation to GitHub Pages.pypi.ymlβ Builds and uploads a release to PyPI when you tag a new version.
π Documentationο
docs/β Contains Sphinx and Markdown files to build your documentation site.Run
make htmlor use GitHub Actions to generate a website.
.vscode/β Optional settings for Visual Studio Code (e.g., interpreter paths).notebooks/β A place to keep example Jupyter notebooks.
π§Ύ Metadata and Communityο
CITATION.cffβ Machine-readable citation info. Lets GitHub generate a βCite this repositoryβ button.CONTRIBUTING.mdβ Guidelines for contributing to the project. Useful if you welcome outside help..pre-commit-config.yamlβ Configuration for running automated checks (e.g., code formatting) before each commit.
β Summaryο
This template is a starting point for research or open-source Python projects. It supports:
Clean project structure
Reproducible environments
Easy testing
Auto-publishing documentation
Optional packaging for PyPI
π‘ Use what you need. Delete what you donβt. This is your scaffold for doing good, shareable science/code.