Kraken thing
Project description
kraken datatype
Overview
Library to extract, validate and normalize datatypes.
datatypes:
- 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
kraken-thing-0.0.51.tar.gz
(46.4 kB
view details)
Built Distribution
File details
Details for the file kraken-thing-0.0.51.tar.gz
.
File metadata
- Download URL: kraken-thing-0.0.51.tar.gz
- Upload date:
- Size: 46.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0326829d7fa2925d08da962ff7d1e7d07f83c3c29bca965ad5c447cea829b63 |
|
MD5 | 4f729ee045cdb2fceb27c1438985b20c |
|
BLAKE2b-256 | 7a2f49ac09af8b08f0792111e44c9ef5c688feb5245fa001d5f0c057b4f333a1 |
File details
Details for the file kraken_thing-0.0.51-py3-none-any.whl
.
File metadata
- Download URL: kraken_thing-0.0.51-py3-none-any.whl
- Upload date:
- Size: 72.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7e240705ccd712c244776b08966885df7ed49079ec1bce17a4db2186e76bf25 |
|
MD5 | ee918676da47aa5ee5f17786bf8cdf29 |
|
BLAKE2b-256 | d407ebd905ac352edd9c263f21e34aad16c6f6c11251c4c34a8b54ccce9bc73c |