Python module to query the Smithsonian's internal Enterprise Digital Asset Network (EDAN).
Project description
edan
Python module to query the Smithsonian's Enterprise Digital Asset Network (EDAN).
This package is only for the SI internal EDAN system. For the public version, we are working on a separate package.
Install edan
You can install the package using pip:
pip install -i edan
Using venv
If you are using venv
to separate the environment, you can use these commands:
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install --upgrade edan
Load the package
import edan
Search EDAN
To use the package, you need to get an ID and Key using ServiceNow.
Set your credentials and use edan.searchEDAN()
:
# EDAN creds
AppID = "[Your APP_ID]"
AppKey = "[YOUR APP_KEY]"
# Search example: 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 edan
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
Built Distribution
File details
Details for the file edan-0.2.tar.gz
.
File metadata
- Download URL: edan-0.2.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/25.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.45.0 importlib-metadata/4.6.1 keyring/21.2.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2246d3825919cc2b08eb682800241d319f4da8a832110baba3cf0904a958766b |
|
MD5 | f2333ad1f8e9dc14000847e3887552dc |
|
BLAKE2b-256 | aaa48011218abde8541d16331b5633eec238f2c526786c2408030ab9de0fb8a3 |
File details
Details for the file edan-0.2-py3-none-any.whl
.
File metadata
- Download URL: edan-0.2-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/25.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.6 tqdm/4.45.0 importlib-metadata/4.6.1 keyring/21.2.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c3b343f5d6be5093d9781f8073d26066669c6d191aa9385ab44cfde78a7034b |
|
MD5 | 4a70c606396237738316c667f01e2ccd |
|
BLAKE2b-256 | ba52bb097d007d9ab3be69673ccaef121687a9f5d4f8138e50176740e14826a0 |