Skip to main content

API library for the cultural heritage K-Samsök (SOCH) UGC API.

Project description

SOCH UGC

SOCH UGC is a Python library for accessing and writing data to the User Generated Content API that is a part of the Swedish Open Cultural Heritage (SOCH/K-Samsök) API.

Install SOCH UGC

pip install sochugc

Usage Examples

from sochugc import UGC

# the endpoint defaults to https://ugc.kulturarvsdata.se/
# the key parameter is only needed for write actions
ugc = UGC(endpoint='http://localhost:8080/', key='<API-KEY>')

# get the total number of user generated items
ugc.get_total_items_count()

# return an user generated content item by its id
ugc.get_item(679)

# Searching all items or items tied to a specific URI
# to search all items and not only ones connected to a specific URI omit the uri parameter
ugc.search_items(uri='http://kulturarvsdata.se/raa/bbr/21400000440954', offset=0, limit=100)

# deleting an item using its id
ugc.delete_item(679)

# creating a new relation, see below for possible relations
ugc.create_item_relation('http://kulturarvsdata.se/raa/kmb/16001000004075', 'isPartOf', 'http://kulturarvsdata.se/pm/photo/POST036605', 'Albin Larsson')

Supported Item Relations

  • sameAs
  • isDescribedBy
  • visualizes
  • hasPart
  • isPartOf
  • isVisualizedBy
  • isContainedIn
  • author
  • authorOf
  • hasBeenUsedIn
  • isRelatedTo
  • architectOf
  • architect
  • user
  • userOf
  • child
  • mother
  • father
  • photographerOf
  • photographer
  • isMentionedBy
  • mentions

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

sochugc-1.3.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

sochugc-1.3.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file sochugc-1.3.0.tar.gz.

File metadata

  • Download URL: sochugc-1.3.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for sochugc-1.3.0.tar.gz
Algorithm Hash digest
SHA256 0420d7da0018600bba744fb15d3f555b43c43cd5a4f6638989369bc60c3a7a04
MD5 ac7f42676fb5d49176dbb8376344e13c
BLAKE2b-256 5a150add32a5eed945bdad74f2a88bd127c7821159ce9b3cc9b6f2d1b52e90cd

See more details on using hashes here.

File details

Details for the file sochugc-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: sochugc-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for sochugc-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dafc3ee360eee89ba5aded87428ab809211b26b7796c143f24962905493e364d
MD5 3cf98cc1b4531f6f6634a139bcec850b
BLAKE2b-256 bfdbd6c20052da414dd2ead4052d583dbdaa2eba7bf80c6818bcc8050abc82e5

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