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). Requires Python 3.11 or higher.

Installation

Install using pip:

pip install edan

Then, load the module:

import edan

Search EDAN

Set your credentials and use edan.edan_metadata_search():

#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=AppID, AppKey=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
  • fqs = JSON array of filter query parameters
  • 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=AppID, AppKey=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.4.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

edan-0.4-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file edan-0.4.tar.gz.

File metadata

  • Download URL: edan-0.4.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0rc1

File hashes

Hashes for edan-0.4.tar.gz
Algorithm Hash digest
SHA256 8a812e2114c5bbed738364cd9a36d919140869bc113f201babf231699655ddab
MD5 657c628c574fd3831662e03bdb3c9c5a
BLAKE2b-256 6ffae8490fd9e1782a007a7cf2039934ca86e3a57e22ba659d63495b1055fbd9

See more details on using hashes here.

File details

Details for the file edan-0.4-py3-none-any.whl.

File metadata

  • Download URL: edan-0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0rc1

File hashes

Hashes for edan-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5b3ace8191981c9421342b88767f8521266162c7f8fbb53311e3a17625597ad6
MD5 8dcbe090a5b9ba345e4ed006cfa14a99
BLAKE2b-256 26dce4ecbc188ec2bf104364feb4294d026248559e5339fab80011eb616a3c5c

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