Skip to content
/ CMA Public

Python wrapper for Cleveland Museum of Art Open Access API

License

Notifications You must be signed in to change notification settings

WTFender/CMA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMA

Python wrapper for the Cleveland Museum of Art API.

Install

pip install ClevelandMuseumArt

CLI Examples

Get random artwork preview
cma artwork get --random --preview

Title: Nataraja, Shiva as the Lord of Dance
Type: Sculpture
Creator:
Culture: South India, Tamil Nadu, Chola period (900-1200s)
Link: https://openaccess-cdn.clevelandart.org/1930.331/1930.331_web.jpg
Preview:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@@@@@@@@
@@@@@@@@@@@@@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@@@@@@
@@@@@@@@@@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@@
@@@@@@@%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%###%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@@@%%%%%%%%%%%%%%%%%%%%%%%%#%%%##%%%%###%%%#**%%###%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@%%%%%%%%%%%%%%%%%%%%%%#%%%**%##***************###*%%%%*#%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%####*+++*##%%########%%####******##%%%##%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%**#%#+++*#%%%%%%%*++*#%%%%%%%%%%%%###****##*##%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%##%%#++=+*%%%%%%%%%%+++++**%%%%%%%%%%######*****########%%%%%%%%%%%
%%%%%%%%%%%%%**#*=+*%%%%%%%%%%%%%#*+++*##%###################****##########%%%%%
%%%%%%%%%%#%%#+=+#%%%%%%%%%%%%%%%%#*+++**#######################**#############%
%%%%%%%%%#***=+#%%%%%%%%%%%%%%%%%##+*+++#%%####################**#***###########
%%%%%%%#%%#++*#%%%%%%%%%%%%%%#####*+**++#%%%####******************#####**#######
%%%%%%#***=+++*%%#*#%%%%%#########*+###*%%@%#***************************###**###
%%%%%%%%#++***++**#%%%#########*+++===*###*+*++++*****************##***#********
%%%%#**#++*#%%%#*#%#########*+===++++++++===++*#%#*+++++++++++**++####*#*+*#****
%%%%%%%*++##%%%##%%%%%%###***=-+*#%#++++++*#%%%%@@%++++++++++##*+++**%*##*******
%%%%##%++*##%######%%%%%#++**+#%#*****##%%%@@@#+**#%**++==+*%*+++++++*@@%#++++++
%%%###*++#############%%*#*%%***#%%%%#%#*+%@@@#+++==+*****##+========+@@%%%##+++
%%%%%%#++###########*****##*++#***+++++*##%@@@%#*+======+*+===========*%@@*+++++
%%%##**+*########*************+++++++==+*+***#**+**========-==========+*#%#*#+==
%%%####**######*********++##*++++====-+****########*------------------+**%***===
%######**###*********++++++++=======+*%%%%%%%%%%%%#=------------------++#%=+=--=
########*##*******++++++++========+*%%#+=+*%%#+----::::::::::::::::---+*%#**+---
#####*****#****++++++++========+*#%#**++*#%%=::::::::::::::::::::::::=+#%=------
#########*##**++++++=========+##*=-=++*#%%+-::::::::::::::::::::::::-+*%****=---
####*******#**++++===+++==+*#%*---=+*#%#=::::::::::...:::::::::::::-++##--------
##*****######**+======+*+++=-=-:-==+##=::::::..:::::::::::::-------++##***+=----
#*******+++*###*+===---------::::+**##-:::::::::---::::::::::::::-+*##==+=--::::
******+++*##*###*+=-=-----::::::::=**##+:::-----::::...........:=+*%#++*=--:::::
*****+++++++++#####*#---:::::::::::=####+--:::.............-.:==*%%+=+*+---:::::
****+++++===*#*+*#####=-::::::::::--=**##-:...............:+=**#%#++--------::::
***++++++======--+######+-::::---==--:+###:::::::::::::-==++*#%#=+*+-----=------
**++++++======-----+######*+==+++=::.:=*#%%=--------===++*###+=---------========
**+++++======---------+####**+*+*#**#%%@@@%#+*********##%#+-:-----=========---::
**+++++======-----------=*##**+*###%@%#%%##*#%%*+*###**+=--====--========--::...
*++++++=======------====+++++++++*####*##**++##*+*#*=------------=====--::....::
**++++++=======------====+++*+*************#*#######-----====----------:::------
******++++++++========---=+**++*****#*++++++*#**#####*=-------::::::::::::::::::
####*********+++++++++++==++++********+++++++*++++++=----:::::------------------
######****************+++++++++=================================================

List artwork with filters
cma artwork list --female_artists --created_after 1998 --limit 1

[
    {
        "id": 172524,
        "accession_number": "2015.30",
        "share_license_status": "Copyrighted",
        "tombstone": "Wild Things, 2011. Haim Steinbach (American, 1944-). Plastic laminated wood shelf, plastic Massimo Giancon \"Mr. Cold\" soap dispenser, vinyl \"Mega Munny,\" vinyl bull \"Where the Wild Things Are\" figure, rubber dog chew; overall: 102.9 x 184.8 x 48.3 cm (40 1/2 x 72 3/4 x 19 in.). The Cleveland Museum of Art, Purchased with funds donated by Scott Mueller 2015.30",
        "current_location": "ArtLens Exhibition A",
        "title": "Wild Things",
        "title_in_original_language": null,
        "series": null,
        "series_in_original_language": null,
        "creation_date": "2011",
        ...snip...
    }
]

Python Examples

from CMA.api import Handler

artwork_id = 1953.424
creator_id = 7978
exhibit_id = 206339

cma = Handler()

# get artwork, creator, or exhibition by ID
artwork = cma.get_artwork(rid=artwork_id, preview=True)
creator = cma.get_creator(rid=creator_id)
exhibit = cma.get_exhibition(rid=exhibit_id)

# list artwork, creator, or exhibition with filters
artworks = cma.list_artworks(limit=3, female_artists=True)
creators = cma.list_creators(limit=3, birth_year_after=1980)
exhibits = cma.list_exhibitions(limit=3, opened_before='2020-12-31')

About

Python wrapper for Cleveland Museum of Art Open Access API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages