Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abbe98/bbr-py
Python package to work with URIs from Bebyggelseregistret.
https://github.com/abbe98/bbr-py
k-samsok raa-collection soch
Last synced: 7 days ago
JSON representation
Python package to work with URIs from Bebyggelseregistret.
- Host: GitHub
- URL: https://github.com/abbe98/bbr-py
- Owner: Abbe98
- License: mit
- Created: 2017-09-11T09:25:41.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-06T14:39:14.000Z (almost 7 years ago)
- Last Synced: 2024-09-24T09:19:18.528Z (about 1 month ago)
- Topics: k-samsok, raa-collection, soch
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BBR-PY
A Python library to work with URIs from Bebyggelseregistret.
BBR-PY can determine the item type using only its URI in 95% of all cases for the other 5% it falls back to making a HTTP lookup. BBR-PY can also get turn a local id into an Kulturarvsdata compatible URI as well as validate such.
## Installation
```bash
pip install bbr
```## Usage
BBR items can be of five possible types:
- Building (`b`)
- Facility (`a`)
- Person (`p`)
- Organization (`o`)
- Environment (`m`)```python
import bbr# returns 'b', 'a', or 'm'
bbr.get_item_type('')#returns True or False
bbr.validate_uri('')# returns an Kulturarvsdata compatible URI as a string
bbr.get_full_uri_from_local_id('')
```BBR-PY can handle all types of URIs and URLs used by kulturarvsdata.se:
- `http://kulturarvsdata.se/raa/bbr/xml/16000300020896`
- `http://kulturarvsdata.se/raa/bbr/rdf/16000300020896`
- `http://kulturarvsdata.se/raa/bbr/html/16000300020896`
- `http://kulturarvsdata.se/raa/bbr/jsonld/16000300020896`
- `raa/bbr/xml/16000300020896`
- `raa/bbr/rdf/16000300020896`
- `raa/bbr/html/16000300020896`
- `raa/bbr/jsonld/16000300020896`Note that MuseumDAT resource URIs/URLs isn't supported by Bebyggelseregistret.