Spock is a framework designed to help manage complex parameter configurations for Python applications
Project description
Managing complex configurations any other way would be highly illogical...
About
spock is a framework that helps manage complex parameter configurations during research and development of Python
applications. spock lets you focus on the code you need to write instead of re-implementing boilerplate code like
creating ArgParsers, reading configuration files, implementing traceability etc.
In short, spock configurations are defined by simple and familiar class-based structures. This allows spock to
support inheritance, read from multiple markdown formats, automatically generate cmd-line arguments, and allow
hierarchical configuration by composition.
Key Features
- Simple Declaration: Type checked parameters are
defined within a
@spockdecorated class. Supports required/optional and automatic defaults. - Easily Managed Parameter Groups: Each class automatically generates its own object within a single namespace.
- Parameter Inheritance: Classes support inheritance allowing for complex configurations derived from a common base set of parameters.
- Complex Types: Nested Lists/Tuples,
List/Tuples of Enum of
@spockclasses, List of repeated@spockclasses - Multiple Configuration File Types: Configurations are specified from YAML, TOML, or JSON files.
- Hierarchical Configuration: Compose from multiple configuration files via simple include statements.
- Command-Line Overrides: Quickly experiment by overriding a value with automatically generated command line arguments.
- Immutable: All classes are frozen preventing any misuse or accidental overwrites (to the extent they can be in Python).
- Tractability and Reproducibility: Save runtime parameter configuration to YAML, TOML, or JSON with a single chained command (with extra runtime info such as Git info, Python version, machine FQDN, etc). The saved markdown file can be used as the configuration input to reproduce prior runtime configurations.
- Hyper-Parameter Tuner Addon: Provides a unified
interface for defining hyper-parameters (via
@spockTunerdecorator) that supports various tuning/algorithm backends (currently: Optuna, Ax) - S3 Addon: Automatically detects
s3://URI(s) and handles loading and savingspockconfiguration files when an activeboto3.Sessionis passed in (plus any additionalS3Transferconfigurations)
Quick Install
The basic install and [s3] extension require Python 3.6+ while the [tune] extension requires Python 3.7+
| Base | w/ S3 Extension | w/ Hyper-Parameter Tuner |
|---|---|---|
pip install spock-config |
pip install spock-config[s3] |
pip install spock-config[tune] |
Quick Start & Documentation
Refer to the quick-start guide here.
Current documentation and more information can be found here.
Example spock usage is located here.
News/Releases
See Releases for more information.
August 17, 2021
- Added hyper-parameter tuning backend support for Ax via Service API
July 21, 2021
- Added hyper-parameter tuning support with
pip install spock-config[tune] - Hyper-parameter tuning backend support for Optuna define-and-run API (WIP for Ax)
May 6th, 2021
- Added S3 support with
pip install spock-config[s3] - S3 addon supports automatically handling loading/saving from paths defined with
s3://URI(s) by passing in an activeboto3.Session
Original Implementation
Nicholas Cilfone, Siddharth Narayanan
spock is developed and maintained by the Artificial Intelligence Center of Excellence at Fidelity Investments.
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.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spock-config-2.2.4.tar.gz.
File metadata
- Download URL: spock-config-2.2.4.tar.gz
- Upload date:
- Size: 65.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2641fd9c0801fe84452f3728897d697d8346fb0caf14e0e5fd5b9168be2e7997
|
|
| MD5 |
14dcd0566e8125b1f2be753b3fdf6432
|
|
| BLAKE2b-256 |
33d125836def7d8a3a50d2276d8f202384eed5f862a08d5ab34a8c0683dc2137
|
File details
Details for the file spock_config-2.2.4-py3-none-any.whl.
File metadata
- Download URL: spock_config-2.2.4-py3-none-any.whl
- Upload date:
- Size: 59.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a8421753641b81d70c4894868b265714969ec79392281406ea477811e12fe55
|
|
| MD5 |
bde72bfc1a3b4eca4501d8534d405e3c
|
|
| BLAKE2b-256 |
102506e500d15a5ae80c321b62e2b4915ddb6401b2a72aa58a78234584c3fa5f
|