projorg: Python project organization and management
A lightweight package for managing Python project structure, experiment tracking, and reproducibility.
Features
- Consistent project directory structure (data, plots, checkpoints, logs)
- Automatic experiment naming based on input arguments
- Configuration management with JSON files and command-line overrides
- Comprehensive experiment logging (git hashes, timestamps, diffs)
- Cloud backup integration via rclone
- Hyperparameter grid search utilities
Requirements
Your project must be in a git repository for the logging and path resolution features to work properly. The package uses git to track code versions, generate experiment logs, and locate the project root directory.
Installation
pip install projorg
Development installation
git clone https://github.com/alisiahkoohi/projorg
cd projorg/
pip install -e .
Quick Start
Create a configuration file in configs/my_config.json with your
experiment parameters:
{
"experiment_name": "my_experiment",
"learning_rate": 0.001,
"batch_size": 32,
"seed": 42
}
Use in your script:
from projorg import setup_environment, datadir, plotsdir
# Setup with automatic logging
args = setup_environment(
"my_config.json",
ignore_arg_list=["experiment_name"],
sequence_args_and_types=[("batch_size", int)]
)
# Access organized directories
data_path = datadir(args.experiment)
plots_path = plotsdir(args.experiment)
Override config values from command line:
python scripts/my_script.py --learning_rate 0.01 --batch_size 64
Example
See scripts/example_script.py for a complete working example:
python scripts/example_script.py
Core Functions
setup_environment(): Initialize experiment with automatic logging of git commit hash, timestamp, configuration, and code diffsdatadir(),plotsdir(),checkpointsdir(),logsdir(): Get organized pathsquery_arguments(): Generate hyperparameter combinations for grid searchupload_to_cloud(): Backup experiments to cloud storage
Logging
The setup_environment() function automatically creates detailed logs in the logs/ directory for each experiment, including:
- Current git commit hash and branch
- Execution timestamp
- Full configuration file used
- Git diff showing uncommitted changes
- Any additional metadata you provide
This ensures complete reproducibility by capturing the exact code state for every experiment run.
Questions
Contact alisk@ucf.edu
Author
Ali Siahkoohi
Metadata
Release files for projorg 1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| projorg-1.1.tar.gz | 9.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| projorg-1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / projorg-1.1.tar.gz
| Download URL | projorg-1.1.tar.gz |
|---|---|
| Size | 9.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7b4b3188c0b3a10bf01c2e78d7e1e426f480d189fb2ea26c621b9ee625fde92
|
|
BLAKE2b-256 checksum How to use checksums |
8bd4048ddacbdd591f6ecd2eaeeff5e980d1829cfb3c6f05276a4b791024f500
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.23
|
Release files / projorg-1.1-py3-none-any.whl
| Download URL | projorg-1.1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f50e041d3024b07564e9b4e2af3028809134afe98d6e5a0f285de101be1fbd2
|
|
BLAKE2b-256 checksum How to use checksums |
ab739e0383e02bd86fe03688ffcabafa1078edc0d50ba44cd6788b663df021c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.23
|