tag-uri


Nametag-uri JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://git.sr.ht/~cellofellow/tag_uri
SummaryRFC 4151 Tag URI taguri.org parser and generator
upload_time2024-03-29 22:14:32
maintainerNone
docs_urlNone
authorJosh Gardner
requires_python<4.0,>=3.11
licenseMIT
keywords rfc4151 uri parser taguri.org
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Parser and Generator For Tag URIs

Tag URIs are a format of URI with the schema `tag:` and are used for globally namespaced identifiers. These can be more useful than for example naked UUIDs because they have namespacing based on domain names and dates as well as can have URL-like paths and fragments.

See taguri.org for details and [RFC 4151](https://datatracker.ietf.org/doc/html/rfc4151).

## Usage

**Installation** `pip install tag_uri`, and add `pip install tag_uri[cli]` to include dependencies needed for the `tag-uri` command.

### Example

``` python
from datetime import date

from tag_uri import TagURI

parsed = TagURI.parse("tag:example.com,2018-01:example/112233")
assert str(parsed) == "tag:example.com,2018-01:example/112233"

maker = TagURI.maker("josh@example.com")
made = maker("example/5432", "test")
assert str(made) == "tag:josh@example.com,2024-01-19:example/5432#test"
assert made.tagging_entity.authority_name == "josh@example.com"
assert made.tagging_entity.date == date(2024, 1, 19)
```

### Command line use

With `pyyaml` installed, you can parse any number of tag URIs by passing them
either as command line arguments or as lines via stdin. The parsed results will be output to stdout as YAML.

``` sh
tag-uri tag:example.com,2018-01-02:example/223344
echo tag:example.com,2019-02-03:example/334455 | tag-uri
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://git.sr.ht/~cellofellow/tag_uri",
    "name": "tag-uri",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": null,
    "keywords": "rfc4151, uri, parser, taguri.org",
    "author": "Josh Gardner",
    "author_email": "jdg@jgardner.tech",
    "download_url": "https://files.pythonhosted.org/packages/e7/7b/989e4300c2c3207f81aed356cf20fe7b6d047310d81550681486535909b3/tag_uri-0.1.1.tar.gz",
    "platform": null,
    "description": "# Parser and Generator For Tag URIs\n\nTag URIs are a format of URI with the schema `tag:` and are used for globally namespaced identifiers. These can be more useful than for example naked UUIDs because they have namespacing based on domain names and dates as well as can have URL-like paths and fragments.\n\nSee taguri.org for details and [RFC 4151](https://datatracker.ietf.org/doc/html/rfc4151).\n\n## Usage\n\n**Installation** `pip install tag_uri`, and add `pip install tag_uri[cli]` to include dependencies needed for the `tag-uri` command.\n\n### Example\n\n``` python\nfrom datetime import date\n\nfrom tag_uri import TagURI\n\nparsed = TagURI.parse(\"tag:example.com,2018-01:example/112233\")\nassert str(parsed) == \"tag:example.com,2018-01:example/112233\"\n\nmaker = TagURI.maker(\"josh@example.com\")\nmade = maker(\"example/5432\", \"test\")\nassert str(made) == \"tag:josh@example.com,2024-01-19:example/5432#test\"\nassert made.tagging_entity.authority_name == \"josh@example.com\"\nassert made.tagging_entity.date == date(2024, 1, 19)\n```\n\n### Command line use\n\nWith `pyyaml` installed, you can parse any number of tag URIs by passing them\neither as command line arguments or as lines via stdin. The parsed results will be output to stdout as YAML.\n\n``` sh\ntag-uri tag:example.com,2018-01-02:example/223344\necho tag:example.com,2019-02-03:example/334455 | tag-uri\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "RFC 4151 Tag URI taguri.org parser and generator",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://git.sr.ht/~cellofellow/tag_uri",
        "Repository": "https://git.sr.ht/~cellofellow/tag_uri"
    },
    "split_keywords": [
        "rfc4151",
        " uri",
        " parser",
        " taguri.org"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1c3068daa845107d22266cefddd6db5dddb06f7ed2ee428dcc4b45e74cfeb178",
                "md5": "6f60fa462918a9c589671a73c5591002",
                "sha256": "2cf0cf4ee728e700f7b6609876234c5e4204cd1bb27d71049111f3413baa8e82"
            },
            "downloads": -1,
            "filename": "tag_uri-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6f60fa462918a9c589671a73c5591002",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 6688,
            "upload_time": "2024-03-29T22:14:30",
            "upload_time_iso_8601": "2024-03-29T22:14:30.518659Z",
            "url": "https://files.pythonhosted.org/packages/1c/30/68daa845107d22266cefddd6db5dddb06f7ed2ee428dcc4b45e74cfeb178/tag_uri-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e77b989e4300c2c3207f81aed356cf20fe7b6d047310d81550681486535909b3",
                "md5": "1f7426b77120151e1402db5c69c1a3aa",
                "sha256": "53c83e2b671257c75783d9b072200ca47297d9ac138f2a73680d5e3ecb78acf4"
            },
            "downloads": -1,
            "filename": "tag_uri-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1f7426b77120151e1402db5c69c1a3aa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 6252,
            "upload_time": "2024-03-29T22:14:32",
            "upload_time_iso_8601": "2024-03-29T22:14:32.045867Z",
            "url": "https://files.pythonhosted.org/packages/e7/7b/989e4300c2c3207f81aed356cf20fe7b6d047310d81550681486535909b3/tag_uri-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-29 22:14:32",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "tag-uri"
}
        
Elapsed time: 0.20244s