Skip to main content

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

Metadata

Release files for kraken-thing 0.0.55

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kraken-thing 0.0.55
File Size Uploaded
kraken-thing-0.0.55.tar.gz 47.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kraken-thing 0.0.55
File Interpreter ABI Platform
kraken_thing-0.0.55-py3-none-any.whl Python 3 none any Details

Total release size: 122.9 kB

Release files / kraken-thing-0.0.55.tar.gz

Download URL kraken-thing-0.0.55.tar.gz
Size 47.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b8dc8d3070d8448ea8451e138d0e73874f72df1903845c3db8f9dd57d6e8c30a
BLAKE2b-256 checksum
How to use checksums
04e8ff7d90f977a7570dae3460a600f50ca3b11b711df38548565d258895f1cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / kraken_thing-0.0.55-py3-none-any.whl

Download URL kraken_thing-0.0.55-py3-none-any.whl
Size 75.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a62ae6f13188a9f0876bceb91b98b98e10af158c2dacb97f893d035f3c11efd
BLAKE2b-256 checksum
How to use checksums
ed775b7a371fe72d72c93c3fe44a7979d2278b6635778e4493f2ee3372ae6473
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.55 This release

2 release files

0.0.54

2 release files

0.0.48

2 release files

0.0.47

2 release files

0.0.46

2 release files

0.0.45

2 release files

0.0.44

2 release files

0.0.43

2 release files

0.0.42

2 release files

0.0.41

2 release files

0.0.40

2 release files

0.0.39

2 release files

0.0.38

2 release files

0.0.37

2 release files

0.0.36

2 release files

0.0.35

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.31

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.21

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page