minihydra-leviathan


Nameminihydra-leviathan JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/Cave-Dwellers-Tree-People/minihydra
SummaryA lightweight sys-arg manager.
upload_time2024-03-07 02:17:27
maintainer
docs_urlNone
authorSam Lerman
requires_python>=3.10.8
license
keywords sys args hyperparams command line artificial intelligence machine learning deep learning reinforcement learning image classification
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img width="50%" alt="logo" src="https://github.com/Cave-Dwellers-Tree-People/minihydra/assets/153214101/8907d6da-e65b-4ca6-a1a9-4f154a4b719b">

```console
pip install minihydra-leviathan
```

[//]: # (:fleur_de_lis:)

[//]: # ()
[//]: # (I left most of the documentation ambiguous, but to my knowledge, *minihydra / leviathan* supports everything you could need. It's ~400 lines of code if you wish to figure it out. Generally speaking, I ask that you put the equal effort that I did into integrating with **[Hydra]&#40;https://www.github.com/facebookresearch/hydra&#41;** before blatantly copying or ripping off this work. See if **[Hydra]&#40;https://www.github.com/facebookresearch/hydra&#41;** or this suits your needs. If not, and you really make sure, then go ahead. But be careful, hydras and leviathans are beautiful beasts and they are not to mess with.)

[//]: # ()
[//]: # (:fleur_de_lis:)

### Reading in args

```python
# run.py

from minihydra import just_args

args = just_args()

print(args, '\n')
print(args.hello)
print(args.number)
print(args.goodbye.cruel)
```

```
> python run.py hello=world number=42 goodbye.cruel='[world]'

{'hello': 'world', 'number': 42, {'goodbye': {'cruel': ['world']}}}

world
42
[world]
```

### Via yaml

```yaml
# path/to/args.yaml

hello: world
number: 42
goodbye:
  cruel:
    - world
```

```python
# run.py

from minihydra import just_args

args = just_args(source='path/to/args.yaml')

print(args, '\n')
print(args.hello)
print(args.number)
print(args.goodbye.cruel)
```

```
> python run.py number=43

{'hello': 'world', 'number': 43, {'goodbye': {'cruel': ['world']}}}

world
43
[world]
```

### As a decorator

```python
# run.py

from minihydra import get_args

@get_args(source='path/to/args.yaml')
def main(args):
    print(args)

if __name__ == '__main__':
    main()
```

```
> python run.py

{'hello': 'world', 'number': 42, {'goodbye': {'cruel': ['world']}}}
```

### Advanced

**Further features include literals, function calls, instantiation, imports, interpolation, custom grammars, expanding module and yaml search paths, project directory inference, instantiation tinkering-syntax inference, portals, and pseudonyms.**

For deeper documentation, please consider [sponsoring](https://github.com/sponsors/Cave-Dwellers-Tree-People).

[//]: # (:fleur_de_lis:)

[//]: # (### Literals: )

[//]: # (lists, dicts, floats, ints, booleans, null, inf, strings; put lists and dicts in quotes)

[//]: # ()
[//]: # (### imports)

[//]: # (Or via reserved task= keyword argument)

[//]: # ()
[//]: # (### instantiate)

[//]: # (Path/To.py -> Cow "Moo")

[//]: # (signature matching)

[//]: # ()
[//]: # (### interpolation)

[//]: # ()
[//]: # (### grammars)

[//]: # ()
[//]: # (### yaml search paths)

[//]: # (project directory inference, instantiation tinkering inference, portals, pseudonyms)

<img width="60%" alt="logo" src="https://github.com/Cave-Dwellers-Tree-People/minihydra/assets/153214101/0ba65a1c-fa62-41a2-bfe3-77358146f18e">

[Licensed under the MIT license.](MIT_LICENSE)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Cave-Dwellers-Tree-People/minihydra",
    "name": "minihydra-leviathan",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10.8",
    "maintainer_email": "",
    "keywords": "sys args,hyperparams,command line,artificial intelligence,machine learning,deep learning,reinforcement learning,image classification",
    "author": "Sam Lerman",
    "author_email": "cave.dwellers.tree.people@gmail.com",
    "download_url": "",
    "platform": null,
    "description": "<img width=\"50%\" alt=\"logo\" src=\"https://github.com/Cave-Dwellers-Tree-People/minihydra/assets/153214101/8907d6da-e65b-4ca6-a1a9-4f154a4b719b\">\n\n```console\npip install minihydra-leviathan\n```\n\n[//]: # (:fleur_de_lis:)\n\n[//]: # ()\n[//]: # (I left most of the documentation ambiguous, but to my knowledge, *minihydra / leviathan* supports everything you could need. It's ~400 lines of code if you wish to figure it out. Generally speaking, I ask that you put the equal effort that I did into integrating with **[Hydra]&#40;https://www.github.com/facebookresearch/hydra&#41;** before blatantly copying or ripping off this work. See if **[Hydra]&#40;https://www.github.com/facebookresearch/hydra&#41;** or this suits your needs. If not, and you really make sure, then go ahead. But be careful, hydras and leviathans are beautiful beasts and they are not to mess with.)\n\n[//]: # ()\n[//]: # (:fleur_de_lis:)\n\n### Reading in args\n\n```python\n# run.py\n\nfrom minihydra import just_args\n\nargs = just_args()\n\nprint(args, '\\n')\nprint(args.hello)\nprint(args.number)\nprint(args.goodbye.cruel)\n```\n\n```\n> python run.py hello=world number=42 goodbye.cruel='[world]'\n\n{'hello': 'world', 'number': 42, {'goodbye': {'cruel': ['world']}}}\n\nworld\n42\n[world]\n```\n\n### Via yaml\n\n```yaml\n# path/to/args.yaml\n\nhello: world\nnumber: 42\ngoodbye:\n  cruel:\n    - world\n```\n\n```python\n# run.py\n\nfrom minihydra import just_args\n\nargs = just_args(source='path/to/args.yaml')\n\nprint(args, '\\n')\nprint(args.hello)\nprint(args.number)\nprint(args.goodbye.cruel)\n```\n\n```\n> python run.py number=43\n\n{'hello': 'world', 'number': 43, {'goodbye': {'cruel': ['world']}}}\n\nworld\n43\n[world]\n```\n\n### As a decorator\n\n```python\n# run.py\n\nfrom minihydra import get_args\n\n@get_args(source='path/to/args.yaml')\ndef main(args):\n    print(args)\n\nif __name__ == '__main__':\n    main()\n```\n\n```\n> python run.py\n\n{'hello': 'world', 'number': 42, {'goodbye': {'cruel': ['world']}}}\n```\n\n### Advanced\n\n**Further features include literals, function calls, instantiation, imports, interpolation, custom grammars, expanding module and yaml search paths, project directory inference, instantiation tinkering-syntax inference, portals, and pseudonyms.**\n\nFor deeper documentation, please consider [sponsoring](https://github.com/sponsors/Cave-Dwellers-Tree-People).\n\n[//]: # (:fleur_de_lis:)\n\n[//]: # (### Literals: )\n\n[//]: # (lists, dicts, floats, ints, booleans, null, inf, strings; put lists and dicts in quotes)\n\n[//]: # ()\n[//]: # (### imports)\n\n[//]: # (Or via reserved task= keyword argument)\n\n[//]: # ()\n[//]: # (### instantiate)\n\n[//]: # (Path/To.py -> Cow \"Moo\")\n\n[//]: # (signature matching)\n\n[//]: # ()\n[//]: # (### interpolation)\n\n[//]: # ()\n[//]: # (### grammars)\n\n[//]: # ()\n[//]: # (### yaml search paths)\n\n[//]: # (project directory inference, instantiation tinkering inference, portals, pseudonyms)\n\n<img width=\"60%\" alt=\"logo\" src=\"https://github.com/Cave-Dwellers-Tree-People/minihydra/assets/153214101/0ba65a1c-fa62-41a2-bfe3-77358146f18e\">\n\n[Licensed under the MIT license.](MIT_LICENSE)\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A lightweight sys-arg manager.",
    "version": "1.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/Cave-Dwellers-Tree-People/minihydra/issues",
        "Homepage": "https://github.com/Cave-Dwellers-Tree-People/minihydra"
    },
    "split_keywords": [
        "sys args",
        "hyperparams",
        "command line",
        "artificial intelligence",
        "machine learning",
        "deep learning",
        "reinforcement learning",
        "image classification"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4159bfe0e278433fc35dcd76b1bb3e722a23d626b527f96b23b9a67114a863d2",
                "md5": "23f715ff282b0c3938302f046c4c8560",
                "sha256": "a9e5aad3a365601c623ffff8deaae31ed187f7a941d93f777931ff1460a980eb"
            },
            "downloads": -1,
            "filename": "minihydra_leviathan-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "23f715ff282b0c3938302f046c4c8560",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10.8",
            "size": 11101,
            "upload_time": "2024-03-07T02:17:27",
            "upload_time_iso_8601": "2024-03-07T02:17:27.205909Z",
            "url": "https://files.pythonhosted.org/packages/41/59/bfe0e278433fc35dcd76b1bb3e722a23d626b527f96b23b9a67114a863d2/minihydra_leviathan-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-07 02:17:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Cave-Dwellers-Tree-People",
    "github_project": "minihydra",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "minihydra-leviathan"
}
        
Elapsed time: 0.36479s