Skip to main content

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

Project description

EDAN python

Basic python3 module to query the Smithsonian's Enterprise Digital Asset Network (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.searchEDAN("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 searchEDAN() 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.getContentEDAN(results['rows'][0]['url'], AppID, AppKey)

The function getContentEDAN() takes these arguments:

  • edan_id = ID of the item (e.g. "edanmdm:ofeo-sg_2012-1080A")
  • AppID = Your AppID
  • AppKey = Your AppKey

To see the details of the item:

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

This returns:

{
    "content": {
        "descriptiveNonRepeating": {
            "data_source": "Smithsonian Gardens",
            "online_media": {
                "media": [
                    {
                        "caption": "Photographed by: Creekside Digital",
                        "content": "http://ids.si.edu/ids/deliveryService?id=OFEO-SG-2012-1080A-101",
                        "idsId": "OFEO-SG-2012-1080A-101",
                        "thumbnail": "http://ids.si.edu/ids/deliveryService?id=OFEO-SG-2012-1080A-101",
                        "type": "Images"
                    },
                    {
                        "caption": "Photographed by: Creekside Digital",
                        "content": "http://ids.si.edu/ids/deliveryService?id=OFEO-SG-2012-1080A-102",
                        "idsId": "OFEO-SG-2012-1080A-102",
                        "thumbnail": "http://ids.si.edu/ids/deliveryService?id=OFEO-SG-2012-1080A-102",
                        "type": "Images"
                    }
                ],
                "mediaCount": "2"
            },
            "record_ID": "ofeo-sg_2012-1080A",
            "title": {
                "content": "Rhyncholaeliocattleya Lise Calov 'Exotic Orchids'",
                "label": "Title"
            },
            "title_sort": "RHYNCHOLAELIOCATTLEYA LISE CALOV 'EXOTIC ORCHIDS'",
            "unit_code": "OFEO-SG"
        },
        "freetext": {
            "dataSource": [
                {
                    "content": "Smithsonian Gardens",
                    "label": "Data Source"
                }
            ],
            "identifier": [
                {
                    "content": "2012-1080A",
                    "label": "Accession Number"
                }
            ],
            "notes": [
                {
                    "content": "Rhyncholaeliocattleya Memoria Seichi Iwasaki x Cattleya Beaufort",
                    "label": "Parentage"
                },
                {
                    "content": "From a cultivated plant not of known wild origin",
                    "label": "Provenance"
                }
            ],
            "physicalDescription": [
                {
                    "content": "Orange; Red center",
                    "label": "Flower Color"
                }
            ],
            "setName": [
                {
                    "content": "Smithsonian Gardens Orchid Collection",
                    "label": "See more items in"
                }
            ],
            "taxonomicName": [
                {
                    "content": "[vascular plants]",
                    "label": "Group"
                },
                {
                    "content": "Equisetopsida",
                    "label": "Class"
                },
                {
                    "content": "Magnoliidae",
                    "label": "Subclass"
                },
                {
                    "content": "Lilianae",
                    "label": "Superorder"
                },
                {
                    "content": "Asparagales",
                    "label": "Order"
                },
                {
                    "content": "Orchidaceae",
                    "label": "Family"
                },
                {
                    "content": "Rhyncholaeliocattleya",
                    "label": "Genus"
                }
            ],
            "topic": [
                {
                    "content": "Orchids",
                    "label": "Topic"
                }
            ]
        },
        "indexedStructured": {
            "object_type": [
                "Living botanical specimens"
            ],
            "online_media_type": [
                "Images"
            ],
            "scientific_name": [
                "Rhyncholaeliocattleya"
            ],
            "tax_class": [
                "Equisetopsida"
            ],
            "tax_family": [
                "Orchidaceae"
            ],
            "tax_order": [
                "Asparagales"
            ],
            "topic": [
                "Orchids",
                "Plants"
            ]
        }
    },
    "docSignature": "99c4fa09ec3f8e8d82ba161049cb1fc5780e8868_671f3a7646fc99059836c5767ce99aa1",
    "hash": "99c4fa09ec3f8e8d82ba161049cb1fc5780e8868",
    "id": "edanmdm-ofeo-sg_2012-1080A",
    "lastTimeUpdated": "Fri May 25 04:22:36 EDT 2018",
    "linkedContent": [],
    "linkedId": "0",
    "publicSearch": true,
    "status": 0,
    "timestamp": "Fri May 25 04:22:36 EDT 2018",
    "title": "Rhyncholaeliocattleya Lise Calov 'Exotic Orchids'",
    "type": "edanmdm",
    "unitCode": "OFEO-SG",
    "url": "edanmdm:ofeo-sg_2012-1080A",
    "version": ""
}

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.2.1.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

edan-0.2.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: edan-0.2.1.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.16 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for edan-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e0ca93f219cad714e543ec0f2fad53d30745a6b47cbeb01cfc923e5400e3fb37
MD5 c781f36d13bbe93858ceaddcfc9b1447
BLAKE2b-256 2df25a08a237e2c6443927aafc6006969fcd383f4361118ae351746f3f785fe0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edan-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.16 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for edan-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 143ada62dafb1a89b9aa982243aa966c9d339abbcf6b18805242ebc31e1ec9e8
MD5 8fc737387cb80b83437244398ae9e25c
BLAKE2b-256 82d25d29611b058142c3f7f0b4022c880ed2ada4fa2bf7aedb0f4265a07ea121

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