The no-brainer package for setting up python experiments
Project description
Arggo
The no-brainer Python package for experiment management
:warning: This library is still in early development. We welcome contributors and early feedback :construction:
Arggo is a Python library for managing experiment runs in a clean and elegant manner.
Core features:
- Dataclass-powered automatic argument parsing
- Automatic directory creation for different runs
Arggo is largely inspired by
Hydra and the HfArgumentParser
utility from
🤗 Transformers.
Table of Contents
Installation
To install Arggo, run
pip install arggo
Getting Started
The simplest use case of Arggo is to setup arguments for a script. Start by defining arguments in a data class:
from dataclasses import dataclass
from arggo.dataclass_utils import parser_field
@dataclass
class Arguments:
name: str = parser_field(help="The user's name.")
should_greet: bool = parser_field(help="Whether or not I should greet the user")
Then, annotate your main function to magically receive an arguments class :
from arggo import arggo
@arggo()
def main(args: Arguments):
if args.should_greet:
print(f"Greetings, {args.name}!")
Test by running
python main.py --name John --should_greet
Outputs
Greetings, John!
That's it!
Features
:construction: To-do list:
- Proof-of-concept for dataclass arguments
- Automatic working directory management
- Service integration
Contributing
We welcome early adopters and contributors to this project! See the Contributing section for details.
License
This project is open-sourced under the MIT license. See LICENSE for details.
Attributions
Icons made by Freepik from www.flaticon.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.