Skip to main content

projorg: Python project organization and management

Project description

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 diffs
  • datadir(), plotsdir(), checkpointsdir(), logsdir(): Get organized paths
  • query_arguments(): Generate hyperparameter combinations for grid search
  • upload_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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

projorg-1.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

projorg-1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file projorg-1.1.tar.gz.

File metadata

  • Download URL: projorg-1.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for projorg-1.1.tar.gz
Algorithm Hash digest
SHA256 a7b4b3188c0b3a10bf01c2e78d7e1e426f480d189fb2ea26c621b9ee625fde92
MD5 cdc65d57510384e2155c1012eeb47d20
BLAKE2b-256 8bd4048ddacbdd591f6ecd2eaeeff5e980d1829cfb3c6f05276a4b791024f500

See more details on using hashes here.

File details

Details for the file projorg-1.1-py3-none-any.whl.

File metadata

  • Download URL: projorg-1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.23

File hashes

Hashes for projorg-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f50e041d3024b07564e9b4e2af3028809134afe98d6e5a0f285de101be1fbd2
MD5 e40e664f8ec6cce1304a7a4fc5e2dafb
BLAKE2b-256 ab739e0383e02bd86fe03688ffcabafa1078edc0d50ba44cd6788b663df021c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page