tomlguard


Nametomlguard JSON
Version 0.4.0 PyPI version JSON
download
home_page
Summary
upload_time2024-03-17 21:20:31
maintainer
docs_urlNone
authorJohn Grey
requires_python>=3.10
licenseACAB License © 2022-12-06 John Grey To the maximum extent applicable by law, and any licenses of components of this work: ** Permissions: Except as prohibited below, any individual, group, organization, charity, business entity or university may use, modify, and distribute source code and software utilising this work. Users may extend this license, so long as these initial conditions remain in force. ** Obligations: Users of this work are obligated to freely provide public access to AI scripts written to be used by this work. ** Prohibitions: No Law Enforcement, Carceral Institutions, Immigration enforcement entities, or entities affiliated with the State of Israel, may use the work or products of the work. For any reason, be it for simulation, production of propaganda, or otherwise. No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits) between the highest and lowest individual in the entity is greater than 50 : 1 may use the work for any reason. Business entities with boards/management comprising less than 1/2 POC may not use the work for any reason. No individual or entity may use this work for racist or bigoted purposes. Users must not remove this license from the work. ** Sanction Users recognise breach of the above terms may be sanctioned to the maximum extent applicable by law. ** Warranty No warranty, liability, or fitness for purpose is implied.
keywords toml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TomlGuard
Author: John Grey
Date  : 2022-12-06

## Overview

A Python Toml wrapper to make things a bit less annoying.


## Examples

With some toml:

``` toml
[person]
name    = "bob"
age     = 26
friends = ["bill", "jill", "jim"]

```



``` python
import pathlib as pl
import tomlguard as TG

data = TG.load("basic.toml")
# Or load all tomls concatenated together:
# data = TG.load_dir(pl.Path())

print(data.person.name)    # -> bob
print(data.person.age)     # -> 26
print(data.person.friends) # -> ["bill", "jill", "jim"]

print(data.on_fail("Fallback", str).this.doesnt.exist()) # -> "Fallback"
print(data.on_fail("bill?").person.name()) # -> bob

try:
    print(data.on_fail("a string", str).person.age())
except TypeError:
    print("Type Mismatch")

print(TG.TomlGuard.report_defaulted()) # -> ['this.doesnt.exist = "Fallback" # <str>']

# TODO: explain all_of, any_of, match_on for multi-tables
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "tomlguard",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "toml",
    "author": "John Grey",
    "author_email": "jgrey.n.plus.one@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ef/9f/3c542820a4cacc3e132cbc3b409b324216f0bfa9806babd7166cbb9327d0/tomlguard-0.4.0.tar.gz",
    "platform": null,
    "description": "# TomlGuard\nAuthor: John Grey\nDate  : 2022-12-06\n\n## Overview\n\nA Python Toml wrapper to make things a bit less annoying.\n\n\n## Examples\n\nWith some toml:\n\n``` toml\n[person]\nname    = \"bob\"\nage     = 26\nfriends = [\"bill\", \"jill\", \"jim\"]\n\n```\n\n\n\n``` python\nimport pathlib as pl\nimport tomlguard as TG\n\ndata = TG.load(\"basic.toml\")\n# Or load all tomls concatenated together:\n# data = TG.load_dir(pl.Path())\n\nprint(data.person.name)    # -> bob\nprint(data.person.age)     # -> 26\nprint(data.person.friends) # -> [\"bill\", \"jill\", \"jim\"]\n\nprint(data.on_fail(\"Fallback\", str).this.doesnt.exist()) # -> \"Fallback\"\nprint(data.on_fail(\"bill?\").person.name()) # -> bob\n\ntry:\n    print(data.on_fail(\"a string\", str).person.age())\nexcept TypeError:\n    print(\"Type Mismatch\")\n\nprint(TG.TomlGuard.report_defaulted()) # -> ['this.doesnt.exist = \"Fallback\" # <str>']\n\n# TODO: explain all_of, any_of, match_on for multi-tables\n```\n",
    "bugtrack_url": null,
    "license": "ACAB License \u00a9 2022-12-06 John Grey  To the maximum extent applicable by law, and any licenses of components of this work:  ** Permissions: Except as prohibited below, any individual, group, organization, charity, business entity or university may use, modify, and distribute source code and software utilising this work.  Users may extend this license, so long as these initial conditions remain in force.  ** Obligations: Users of this work are obligated to freely provide public access to AI scripts written to be used by this work.   ** Prohibitions: No Law Enforcement, Carceral Institutions, Immigration enforcement entities, or entities affiliated with the State of Israel, may use the work or products of the work. For any reason, be it for simulation, production of propaganda, or otherwise.  No business entity where the ratio of pay (salaried, freelance, stocks, or other benefits) between the highest and lowest individual in the entity is greater than 50 : 1 may use the work for any reason.  Business entities with boards/management comprising less than 1/2 POC may not use the work for any reason.  No individual or entity may use this work for racist or bigoted purposes.  Users must not remove this license from the work.   ** Sanction Users recognise breach of the above terms may be sanctioned to the maximum extent applicable by law.  ** Warranty No warranty, liability, or fitness for purpose is implied. ",
    "summary": "",
    "version": "0.4.0",
    "project_urls": {
        "changelog": "https://github.com//jgrey4296/tomlguard/blob/master/CHANGELOG.md",
        "documentation": "https://github.com/jgrey4296/tomlguard/wiki",
        "homepage": "https://github.com/jgrey4296/tomlguard",
        "repository": "https://github.com/jgrey4296/tomlguard"
    },
    "split_keywords": [
        "toml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da6f2e6d3dab0e21f2de55a73ff7148aa4b93192a9dab42c07c5069406a51642",
                "md5": "17e6538d020d7ff756dc3c511627b3bb",
                "sha256": "8c16c5b5ed57ac409e8af3680119ebbae6b3a730cf6a4e0448a29a5f44f2ed17"
            },
            "downloads": -1,
            "filename": "tomlguard-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "17e6538d020d7ff756dc3c511627b3bb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 22360,
            "upload_time": "2024-03-17T21:20:28",
            "upload_time_iso_8601": "2024-03-17T21:20:28.928904Z",
            "url": "https://files.pythonhosted.org/packages/da/6f/2e6d3dab0e21f2de55a73ff7148aa4b93192a9dab42c07c5069406a51642/tomlguard-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef9f3c542820a4cacc3e132cbc3b409b324216f0bfa9806babd7166cbb9327d0",
                "md5": "d04d840e8a2e7028e7b07a5567455ce8",
                "sha256": "eed7978580fad40a449bdaf0f0a41d5f3ab28f0d259dbf16751831d1ff83e02d"
            },
            "downloads": -1,
            "filename": "tomlguard-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d04d840e8a2e7028e7b07a5567455ce8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 15911,
            "upload_time": "2024-03-17T21:20:31",
            "upload_time_iso_8601": "2024-03-17T21:20:31.461989Z",
            "url": "https://files.pythonhosted.org/packages/ef/9f/3c542820a4cacc3e132cbc3b409b324216f0bfa9806babd7166cbb9327d0/tomlguard-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-17 21:20:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jgrey4296",
    "github_project": "tomlguard",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tomlguard"
}
        
Elapsed time: 0.47440s