kraken-thing


Namekraken-thing JSON
Version 0.0.55 PyPI version JSON
download
home_pagehttps://github.com/tactik8/krakcn_class_thing_v4
SummaryKraken thing
upload_time2023-12-13 12:43:57
maintainer
docs_urlNone
authorTactik8
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # kraken datatype

## Overview
Library to extract, validate and normalize datatypes. 

datatypes:
- email
- url
- date
- country
- address
- telephone
- bool
- currency
- domain


## github
https://github.com/tactik8/krakcn_class_thing_v4

## pypi
https://pypi.org/project/kraken-thing/


## classes:
- Thing: representation of a schema.org thing
- Things: a collection of Thing
- Observation: Data points making up a thing


## How to use:

### Basics
```
from kraken_thing.kraken_class_thing.kraken_class_thing import Thing
from kraken_thing import Thing

t = Thing()
t.url = 'https://www.test.com'
print(t.url)

print(t.record)

```
### Metadata

Metadata can be provided in json record using @metadata

```
{ 
    "@type": "person",
    "@id": "abc123",
    "name": "Bob Smith",
    "@metadata": {
        "measuredPropertyContext": "",
        "language": "EN",
        "observationCredibility": 0.5,
        "observationDate": "2023-03-01",
        "validFrom": "2023-03-01",
        "validThrough": "",
        "observationAbout": "",
        "source": {
                    "@type": "WebAPI",
                    "url": "https://someapi.com",
                    "name": "data scraper"
                    },
        "instrument": "",
        "agent": ""
    }
}

```




### HTML

thing.html.xxx return html formats of the thing

print(thing.html.__doc__) for full list

- record() : returns dict with enhanced values (link, etc)
- full() : Returns a 2 column table with key / values
- card() : returns a card
- media() : returns the media (video or pic)
- video() : returns video
- image() : returns image
- link () : returns link with internal value
- record_ref(): returns link with record_ref


### Using api

```
# Set url for the api (only has to do it once)
t = Thing()
t.set_api_url('https://api_url.com')

# Save record tp api
t = Thing('test', 'abc1234')
t.url = 'https://www.test.com'
t.api_post()


# Load record from api
t.api_get()

print(t)

```


## Attributes



## Methods



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tactik8/krakcn_class_thing_v4",
    "name": "kraken-thing",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Tactik8",
    "author_email": "info@tactik8.com",
    "download_url": "https://files.pythonhosted.org/packages/04/e8/ff7d90f977a7570dae3460a600f50ca3b11b711df38548565d258895f1cb/kraken-thing-0.0.55.tar.gz",
    "platform": null,
    "description": "# kraken datatype\n\n## Overview\nLibrary to extract, validate and normalize datatypes. \n\ndatatypes:\n- email\n- url\n- date\n- country\n- address\n- telephone\n- bool\n- currency\n- domain\n\n\n## github\nhttps://github.com/tactik8/krakcn_class_thing_v4\n\n## pypi\nhttps://pypi.org/project/kraken-thing/\n\n\n## classes:\n- Thing: representation of a schema.org thing\n- Things: a collection of Thing\n- Observation: Data points making up a thing\n\n\n## How to use:\n\n### Basics\n```\nfrom kraken_thing.kraken_class_thing.kraken_class_thing import Thing\nfrom kraken_thing import Thing\n\nt = Thing()\nt.url = 'https://www.test.com'\nprint(t.url)\n\nprint(t.record)\n\n```\n### Metadata\n\nMetadata can be provided in json record using @metadata\n\n```\n{ \n    \"@type\": \"person\",\n    \"@id\": \"abc123\",\n    \"name\": \"Bob Smith\",\n    \"@metadata\": {\n        \"measuredPropertyContext\": \"\",\n        \"language\": \"EN\",\n        \"observationCredibility\": 0.5,\n        \"observationDate\": \"2023-03-01\",\n        \"validFrom\": \"2023-03-01\",\n        \"validThrough\": \"\",\n        \"observationAbout\": \"\",\n        \"source\": {\n                    \"@type\": \"WebAPI\",\n                    \"url\": \"https://someapi.com\",\n                    \"name\": \"data scraper\"\n                    },\n        \"instrument\": \"\",\n        \"agent\": \"\"\n    }\n}\n\n```\n\n\n\n\n### HTML\n\nthing.html.xxx return html formats of the thing\n\nprint(thing.html.__doc__) for full list\n\n- record() : returns dict with enhanced values (link, etc)\n- full() : Returns a 2 column table with key / values\n- card() : returns a card\n- media() : returns the media (video or pic)\n- video() : returns video\n- image() : returns image\n- link () : returns link with internal value\n- record_ref(): returns link with record_ref\n\n\n### Using api\n\n```\n# Set url for the api (only has to do it once)\nt = Thing()\nt.set_api_url('https://api_url.com')\n\n# Save record tp api\nt = Thing('test', 'abc1234')\nt.url = 'https://www.test.com'\nt.api_post()\n\n\n# Load record from api\nt.api_get()\n\nprint(t)\n\n```\n\n\n## Attributes\n\n\n\n## Methods\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Kraken thing",
    "version": "0.0.55",
    "project_urls": {
        "Homepage": "https://github.com/tactik8/krakcn_class_thing_v4"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ed775b7a371fe72d72c93c3fe44a7979d2278b6635778e4493f2ee3372ae6473",
                "md5": "ac213f204b4c08183228166a971e9f76",
                "sha256": "2a62ae6f13188a9f0876bceb91b98b98e10af158c2dacb97f893d035f3c11efd"
            },
            "downloads": -1,
            "filename": "kraken_thing-0.0.55-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ac213f204b4c08183228166a971e9f76",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 75745,
            "upload_time": "2023-12-13T12:43:55",
            "upload_time_iso_8601": "2023-12-13T12:43:55.868839Z",
            "url": "https://files.pythonhosted.org/packages/ed/77/5b7a371fe72d72c93c3fe44a7979d2278b6635778e4493f2ee3372ae6473/kraken_thing-0.0.55-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "04e8ff7d90f977a7570dae3460a600f50ca3b11b711df38548565d258895f1cb",
                "md5": "43b0d74936fa85cd97c25843b84fd1f5",
                "sha256": "b8dc8d3070d8448ea8451e138d0e73874f72df1903845c3db8f9dd57d6e8c30a"
            },
            "downloads": -1,
            "filename": "kraken-thing-0.0.55.tar.gz",
            "has_sig": false,
            "md5_digest": "43b0d74936fa85cd97c25843b84fd1f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 47131,
            "upload_time": "2023-12-13T12:43:57",
            "upload_time_iso_8601": "2023-12-13T12:43:57.668555Z",
            "url": "https://files.pythonhosted.org/packages/04/e8/ff7d90f977a7570dae3460a600f50ca3b11b711df38548565d258895f1cb/kraken-thing-0.0.55.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-13 12:43:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tactik8",
    "github_project": "krakcn_class_thing_v4",
    "github_not_found": true,
    "lcname": "kraken-thing"
}
        
Elapsed time: 2.62032s