Skip to main content

Kraken thing

Project description

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

Project details


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.33.tar.gz (38.3 kB view details)

Uploaded Source

Built Distribution

kraken_thing-0.0.33-py3-none-any.whl (58.1 kB view details)

Uploaded Python 3

File details

Details for the file kraken-thing-0.0.33.tar.gz.

File metadata

  • Download URL: kraken-thing-0.0.33.tar.gz
  • Upload date:
  • Size: 38.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for kraken-thing-0.0.33.tar.gz
Algorithm Hash digest
SHA256 182796605ff0102d5f8147b6e2cf589c95b648b6d517341a2e5e482fc3d0bc80
MD5 b4fa66468d97d41b31fe3c90880965ae
BLAKE2b-256 e0330a00eb5f1179193335d84315000dd06dd95f8f845a7c4d3c4427411d7aef

See more details on using hashes here.

File details

Details for the file kraken_thing-0.0.33-py3-none-any.whl.

File metadata

File hashes

Hashes for kraken_thing-0.0.33-py3-none-any.whl
Algorithm Hash digest
SHA256 455ce0a41a28c4de94d4c502c83090f28e22d0527da3e4408dc6c39916188004
MD5 eaf5afbde53efe33e8ec1af548db78e8
BLAKE2b-256 31f7e199a8f02d72ab06676b43c1dd39c3737d9884593a513c362fba4f4455d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page