tomfoolery


Nametomfoolery JSON
Version 1.1.1 PyPI version JSON
download
home_page
SummaryCLI to generate Python dataclasses that model and load toml files (or other can-representated-as-a-dict files)
upload_time2024-02-17 02:10:49
maintainer
docs_urlNone
author
requires_python>=3.10
license
keywords dataclass dataclasses json toml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tomfoolery

Tool to generate Python dataclasses that model and load toml files (or other can-representated-as-a-dict files).<br>
Primarily aimed at configuration type files.

## Installation

Install with:

<pre>
pip install tomfoolery
</pre>


## Usage

Given the following file (`venue.toml`):<br><br>
![](imgs/toml.png)

Running the command
<pre>
tomfoolery venue.toml
</pre>

will produce this file (`venue.py`):<br><br>
![](imgs/dataclass.png)

which can then be used:
<pre>
>from venue import Venue
>venue = Venue.load()
>print(venue.address.city)
'Chicago'
>venue.calendar.start_month = "March"
>venue.dump()
</pre>

### Current Caveats

* Only works with `.toml` and `.json` files.
* All keys must be valid Python variable names.
            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tomfoolery",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "dataclass,dataclasses,json,toml",
    "author": "",
    "author_email": "Matt Manes <mattmanes@pm.me>",
    "download_url": "https://files.pythonhosted.org/packages/1c/93/ea2b0d01a4da0db21d0e04574e8ad5eef8c345da3c11413613171759f35f/tomfoolery-1.1.1.tar.gz",
    "platform": null,
    "description": "# tomfoolery\n\nTool to generate Python dataclasses that model and load toml files (or other can-representated-as-a-dict files).<br>\nPrimarily aimed at configuration type files.\n\n## Installation\n\nInstall with:\n\n<pre>\npip install tomfoolery\n</pre>\n\n\n## Usage\n\nGiven the following file (`venue.toml`):<br><br>\n![](imgs/toml.png)\n\nRunning the command\n<pre>\ntomfoolery venue.toml\n</pre>\n\nwill produce this file (`venue.py`):<br><br>\n![](imgs/dataclass.png)\n\nwhich can then be used:\n<pre>\n>from venue import Venue\n>venue = Venue.load()\n>print(venue.address.city)\n'Chicago'\n>venue.calendar.start_month = \"March\"\n>venue.dump()\n</pre>\n\n### Current Caveats\n\n* Only works with `.toml` and `.json` files.\n* All keys must be valid Python variable names.",
    "bugtrack_url": null,
    "license": "",
    "summary": "CLI to generate Python dataclasses that model and load toml files (or other can-representated-as-a-dict files)",
    "version": "1.1.1",
    "project_urls": {
        "Documentation": "https://github.com/matt-manes/tomfoolery/tree/main/docs",
        "Homepage": "https://github.com/matt-manes/tomfoolery",
        "Source code": "https://github.com/matt-manes/tomfoolery/tree/main/src/tomfoolery"
    },
    "split_keywords": [
        "dataclass",
        "dataclasses",
        "json",
        "toml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "caaea3dbd1865dc15d2559161db8aa3f63c32a808e792afe0d885a5b340a0d6d",
                "md5": "588c5e63492c3e8c5e198e0434ac9456",
                "sha256": "cf42279c5ae0260db3fc0fe4a10ae42232d6a1004635755b3c05079f120b6c0a"
            },
            "downloads": -1,
            "filename": "tomfoolery-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "588c5e63492c3e8c5e198e0434ac9456",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 8073,
            "upload_time": "2024-02-17T02:10:47",
            "upload_time_iso_8601": "2024-02-17T02:10:47.545842Z",
            "url": "https://files.pythonhosted.org/packages/ca/ae/a3dbd1865dc15d2559161db8aa3f63c32a808e792afe0d885a5b340a0d6d/tomfoolery-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c93ea2b0d01a4da0db21d0e04574e8ad5eef8c345da3c11413613171759f35f",
                "md5": "b7efb22a77d3c32f88e24ac5ea926d56",
                "sha256": "0646ac8940994f08958e2b1c2e863d824f09e445285209b9fc60179fb1d396c8"
            },
            "downloads": -1,
            "filename": "tomfoolery-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b7efb22a77d3c32f88e24ac5ea926d56",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 6076,
            "upload_time": "2024-02-17T02:10:49",
            "upload_time_iso_8601": "2024-02-17T02:10:49.090488Z",
            "url": "https://files.pythonhosted.org/packages/1c/93/ea2b0d01a4da0db21d0e04574e8ad5eef8c345da3c11413613171759f35f/tomfoolery-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-17 02:10:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "matt-manes",
    "github_project": "tomfoolery",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "tomfoolery"
}
        
Elapsed time: 0.26145s