The purpose of this work is to create a language agnostic project template for data analysis.
I work with Julia, Python, and R. While the language-specific conventions are different the projects are usually structured similarly.
Usually, I start with what I want to accomplish before I pick what language to work with. So, I decided that it would helpful to automate and standardize the steps prior to picking a language.
- Linux (shell)
- Windows (powershell)
- uses Pgk to manage dependencies
- tests are housed under ./test
- uses virtual environments or other software such as poetry, virtualenv, etc. to manage dependencies
- tests are housed under ./tests
- uses the renv package to manage dependencies
- tests are housed under ./tests
There are many existing works that create language-specific project structures. Below are some examples.
- Julia:
- Python
- R
-
git clone repo
-
Open a terminal and navigate to ^
-
select the appropriate file based on your OS
- Linux:
- choose the
.shextension - within the terminal run
chmod +x create-project.sh
- choose the
- Windows
- choose the
.ps1extension
- choose the
- Linux:
-l: Programming language flag- Only affects the testing directory
- If no language is specified, then both the ./test and ./tests directories are created
- Simply delete the unused testing directory when a language for the project is chosen
- Takes the following args (case insensitive)
rpypythonjljulia
- WARNING only one language should be specified, there is no guardrail if more than one option is passed
-p: Project directory (required)- Takes any existing path
Get the script.
mkdir git
cd git
git clone https://github.com/SaintRod/multi-lang-project-template.git
cd multi-lang-project-template
chmod +x create-project.sh #linux only
A) No clue what language will be used, and the project hasn't been started
Create the project structure in the current directory
create-project.sh -p . #linux
multi-lang-project-template\create-project.ps1 -p . #windows
B) No clue what language will be used, and the project root directory exists
./create-project.sh -p ~/.../project-root #linux
.\create-project.ps1 -p ~\...\project-root #windows
C) You know what language will be used, and the project root directory exists
# R
./create-project.sh -l r -p ~/.../project-root
./create-project.sh -l R -p ~/.../project-root
.\create-project.ps1 -l r -p ~\...\project-root
.\create-project.ps1 -l R -p ~\...\project-root
# Python
./create-project.sh -l py -p ~/.../project-root
./create-project.sh -l python -p ~/.../project-root
./create-project.sh -l PY -p ~/.../project-root
./create-project.sh -l PYTHON -p ~/.../project-root
./create-project.sh -l pYtHoN -p ~/.../project-root
.\create-project.ps1 -l py -p ~\...\project-root
.\create-project.ps1 -l python -p ~\...\project-root
.\create-project.ps1 -l PY -p ~\...\project-root
.\create-project.ps1 -l PYTHON -p ~\...\project-root
.\create-project.ps1 -l pYtHoN -p ~\...\project-root
# Julia
./create-project.sh -l jl -p ~/.../project-root
./create-project.sh -l julia -p ~/.../project-root
./create-project.sh -l JL -p ~/.../project-root
./create-project.sh -l jL -p ~/.../project-root
.\create-project.ps1 -l jl -p ~\...\project-root
.\create-project.ps1 -l julia -p ~\...\project-root
.\create-project.ps1 -l JL -p ~\...\project-root
.\create-project.ps1 -l jL -p ~\...\project-root
project-root/
├── config
├── data
│ ├── input
│ └── output
├── documentation # technical documentation
├── LICENSE
├── notebooks # literate programming medium
├── README.md
├── scripts # files that import from ./src
├── src # functions or modules
├── test # for Julia
└── tests # for R and Python
Additional details:
- documentation - Technical documentation created programmatically or manually by users
- notebooks - Any literate programming medium such as Jupyter Labs, Quarto markdown, RMarkdown, or Pluto notebooks
- test and tests - If both testing directories are present, it implies no language was specified
Contributors welcome!
Fork the repo, make changes, and submit a PR :)


