Skip to main content

Python module to query the Smithsonian's internal Enterprise Digital Asset Network (EDAN).

Project description

EDAN API

EDAN python

Basic python3 module to query the Smithsonian's Enterprise Digital Asset Network (EDAN).

Installation

Install using pip:

pip install edan

Load the module

Save the file edan.py and load it as a module:

import edan

Search EDAN

Set your credentials and use edan.searchEDAN():

#EDAN creds
AppID = "APP_ID"
AppKey = "verylong_key"

#Search for images of orchids from Smithsonian Gardens
results = edan.edan_metadata_search("orchids smithsonian gardens images", AppID, AppKey)

#Number of results available for this search
results['rowCount']

#To get the rows of results
results_rows = results['rows']

The function edan_metadata_search() takes these arguments:

  • edan_query = Search items
  • AppID = Your AppID
  • AppKey = Your AppKey
  • rows = How many rows to return, max is 100, default is 10
  • start = Which row to start the results, default is 0

Get details of a single item using the item ID

import json

item = edan.edan_content_getcontent(results['rows'][0]['url'], AppID, AppKey)

The function edan_content_getcontent() takes these arguments (must provide id or url):

  • id = ID of the item
  • id = URL of the item
  • AppID = Your AppID
  • AppKey = Your AppKey

To see the details of the item:

print(json.dumps(item, sort_keys = True, indent = 4))

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

edan-0.3.tar.gz (8.0 kB view hashes)

Uploaded Source

Built Distribution

edan-0.3-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

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