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](https://www.raa.se/hitta-information/k-samsok/anvandargenererat-innehall-ugc-hubben/) that is a part of the Swedish Open Cultural Heritage (SOCH/K-Samsök) API.
## Install SOCH UGC
```bash
pip install sochugc
```
## Usage Examples
```python
from sochugc import UGC
# the endpoint defaults to http://ugc.kulturarvsdata.se/
ugc = UGC('<API-KEY>', endpoint='http://lx-ra-ugchubtest:8080/')
# 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 an specific URI omit the uri parameter
ugc.search_items(uri='http://kulturarvsdata.se/raa/bbr/21400000440954', offset=0, limit=100)
#
# Writing data is not available for everyone
#
# 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
SOCH UGC is a Python library for accessing and writing data to the [User Generated Content API](https://www.raa.se/hitta-information/k-samsok/anvandargenererat-innehall-ugc-hubben/) that is a part of the Swedish Open Cultural Heritage (SOCH/K-Samsök) API.
## Install SOCH UGC
```bash
pip install sochugc
```
## Usage Examples
```python
from sochugc import UGC
# the endpoint defaults to http://ugc.kulturarvsdata.se/
ugc = UGC('<API-KEY>', endpoint='http://lx-ra-ugchubtest:8080/')
# 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 an specific URI omit the uri parameter
ugc.search_items(uri='http://kulturarvsdata.se/raa/bbr/21400000440954', offset=0, limit=100)
#
# Writing data is not available for everyone
#
# 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.0.0.tar.gz
(3.3 kB
view details)
File details
Details for the file sochugc-1.0.0.tar.gz
.
File metadata
- Download URL: sochugc-1.0.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Python-urllib/3.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b511db632f9c4b4aad4d31abfd06d0103d2a0e77e4528560502154d7b9df63d1 |
|
MD5 | ef04ee3c8be99d261fde68d8727e4a53 |
|
BLAKE2b-256 | 25f2cc86233d341697ca1413e9ddac5e7ffe7b4e1266d56c54c008cdf3b48e96 |