Skip to main content

Python module to query the Smithsonian Institution Open Access API.

Project description

Smithsonian Open Access

Python module to query the Smithsonian Institution Open Access API.

A project of the Digitization Program Office, OCIO, Smithsonian.

https://dpo.si.edu/

For details of the developer tools for the Open Access API: https://www.si.edu/openaccess/devtools

For details about Smithsonian Open Access: https://www.si.edu/openaccess

Installation

To install using pip:

pip install si_openaccess

Or:

python3 -m pip install si_openaccess

Requirements

  • The module requires Python 3.11 or higher.
  • The API requires you to provide your own 'api_key' value. Please register with https://api.data.gov/signup/ to get a key.

Usage

Get Content

To fetch content based on id/url of an object (docs):

content(id=[ITEM ID], api_key=[YOUR API KEY])

Fetch statistics

To fetch stats for CC0 objects/media (docs):

metrics_stats(api_key=[YOUR API KEY])

Search contents based on category

To fetch content based on a query against a category. art_design, history_culture or science_technology (docs):

def category_search(q=[SEARCH TERMS], category=[CATEGORY], start=0, rows=10, sort=[SORT], api_key=[YOUR API KEY])

Values for category are:

  • art_design
  • history_culture
  • science_technology

Values for sort are:

  • relevancy
  • id
  • newest
  • updated
  • random

Search

To fetch content based on a query (docs):

search(q=[SEARCH TERMS], start=0, rows=10, sort=[SORT], type=[TYPE], row_group=[ROW_GROUP], api_key=[YOUR API KEY])

Values for sort are:

  • relevancy
  • id
  • newest
  • updated
  • random

Values for type are:

  • edanmdm
  • ead_collection
  • ead_component
  • all

Values for row_group are:

  • objects
  • archives

Search Terms

To Fetches an array of terms based term category (docs):

search_terms(category=[CATEGORY], starts_with=None, api_key=[YOUR API KEY])

Values for category are:

  • culture
  • data_source
  • date
  • object_type
  • online_media_type
  • place
  • topic
  • unit_code

The value for starts_with is optional.

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

si_openaccess-0.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

si_openaccess-0.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file si_openaccess-0.1.tar.gz.

File metadata

  • Download URL: si_openaccess-0.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for si_openaccess-0.1.tar.gz
Algorithm Hash digest
SHA256 14a939d071b8cd5ac07048cc1a68aa90efb97579259afa60a4686f8cadfc87f7
MD5 68a9eb0469edcf82c46f70decf39ee13
BLAKE2b-256 7bbdd7d8258a725ca96f512b96f2a3fcb07086bf58e3245602f9be007b26fdc9

See more details on using hashes here.

File details

Details for the file si_openaccess-0.1-py3-none-any.whl.

File metadata

  • Download URL: si_openaccess-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for si_openaccess-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5a21093fa8990cbd9d3dbb8bb1abe9c5bb74c645d47a1244734461047e7d3d8
MD5 c4888414a7d735364a9f83267bc56059
BLAKE2b-256 c8f350762b1561e93e850515b1c8ca260a3267edb97ffbc192abfa8d02e60f74

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