Skip to content

Abbe98/bbr-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

pip install bbr

Usage

BBR items can be of five possible types:

  • Building (b)
  • Facility (a)
  • Person (p)
  • Organization (o)
  • Environment (m)
import bbr

# returns 'b', 'a', or 'm'
bbr.get_item_type('<URI>')

#returns True or False
bbr.validate_uri('<URI>')

# returns an Kulturarvsdata compatible URI as a string
bbr.get_full_uri_from_local_id('<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.

About

Python package to work with URIs from Bebyggelseregistret.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages