met_museum 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +74 -5
- data/lib/met_museum/collection.rb +56 -0
- data/lib/met_museum/version.rb +1 -1
- data/met_museum.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 900cb94a372a90f0d57977e7f6ac59288016387db01674fb8ad8289781674fc1
|
4
|
+
data.tar.gz: 4872ea946934abcd6f33e774940ea913f26f5bd322e8de0f3e9a07be270cb9de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51254a6caafca44ad8a797a10ce992a71ccfaa9b1069c87644fbc269489dd991f059b7a66a0cdf05aab4d555e14ef7728367a86f9c037a148ec2fe53e5abbf3a
|
7
|
+
data.tar.gz: 38c930bd7f2ebbf65d3bd4232608060c4c71634a6aeaedb6166467bf9f5ea1157910efb717c19c7cf079e6194aa40bfb9a25340ce94ac67e7dc58a550d44c562
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -24,7 +24,14 @@ Or install it yourself as:
|
|
24
24
|
|
25
25
|
```
|
26
26
|
require 'met_museum'
|
27
|
-
|
27
|
+
```
|
28
|
+
The description of the method is as follows
|
29
|
+
<details>
|
30
|
+
<summary>
|
31
|
+
MetMuseum::Collection.objects
|
32
|
+
</summary>
|
33
|
+
<pre>
|
34
|
+
```
|
28
35
|
MetMuseum::Collection.objects
|
29
36
|
=> {"total"=>490607,
|
30
37
|
"objectIDs"=>
|
@@ -37,17 +44,79 @@ MetMuseum::Collection.objects
|
|
37
44
|
7,
|
38
45
|
8,
|
39
46
|
--< omit >--
|
40
|
-
|
41
|
-
|
42
|
-
|
47
|
+
820613]}
|
48
|
+
MetMuseum::Collection.objects('2018-10-10')
|
49
|
+
=>{"total"=>88232,
|
50
|
+
"objectIDs"=>
|
51
|
+
[33,
|
52
|
+
35,
|
53
|
+
36,
|
54
|
+
74,
|
55
|
+
75,
|
56
|
+
--< omit >--
|
57
|
+
820613]}
|
58
|
+
```
|
59
|
+
</pre>
|
60
|
+
</details>
|
61
|
+
<hr>
|
62
|
+
<details>
|
63
|
+
<summary>
|
64
|
+
MetMuseum::Collection.object
|
65
|
+
</summary>
|
66
|
+
<pre>
|
67
|
+
```
|
68
|
+
MetMuseum::Collection.object(1000)
|
43
69
|
=> {"objectID"=>1000,
|
44
70
|
"isHighlight"=>false,
|
45
71
|
"accessionNumber"=>"10.149.99",
|
46
72
|
"isPublicDomain"=>true,
|
47
|
-
|
73
|
+
"primaryImage"=>"https://images.metmuseum.org/CRDImages/ad/original/DP258638.jpg",
|
74
|
+
"primaryImageSmall"=>"https://images.metmuseum.org/CRDImages/ad/web-large/DP258638.jpg",
|
75
|
+
"additionalImages"=>[],
|
76
|
+
"constituents"=>nil,
|
77
|
+
"department"=>"The American Wing",
|
78
|
+
"objectName"=>"Bread plate",
|
79
|
+
"title"=>"Bread Plate",
|
80
|
+
"culture"=>"Chinese, for American market",
|
81
|
+
"period"=>"",
|
82
|
+
"dynasty"=>"",
|
83
|
+
"reign"=>"",
|
84
|
+
"portfolio"=>"",
|
85
|
+
"artistRole"=>"",
|
86
|
+
"artistPrefix"=>"",
|
87
|
+
"artistDisplayName"=>"",
|
88
|
+
"artistDisplayBio"=>"",
|
89
|
+
"artistSuffix"=>"",
|
90
|
+
"artistAlphaSort"=>"",
|
91
|
+
"artistNationality"=>"",
|
92
|
+
"artistBeginDate"=>"",
|
93
|
+
"artistEndDate"=>"",
|
94
|
+
"objectDate"=>"1785–90",
|
95
|
+
"objectBeginDate"=>1785,
|
96
|
+
"objectEndDate"=>1790,
|
97
|
+
"medium"=>"Porcelain",
|
98
|
+
"dimensions"=>"Diam. 6 1/4 in. (15.9 cm)",
|
99
|
+
"creditLine"=>"Bequest of James T. Woodward, 1910",
|
100
|
+
"geographyType"=>"Made in",
|
101
|
+
"city"=>"",
|
102
|
+
"state"=>"",
|
103
|
+
"county"=>"",
|
104
|
+
"country"=>"China",
|
105
|
+
"region"=>"",
|
106
|
+
"subregion"=>"",
|
107
|
+
"locale"=>"",
|
108
|
+
"locus"=>"",
|
109
|
+
"excavation"=>"",
|
110
|
+
"river"=>"",
|
111
|
+
"classification"=>"Ceramics",
|
112
|
+
"rightsAndReproduction"=>"",
|
113
|
+
"linkResource"=>"",
|
114
|
+
"metadataDate"=>"2019-01-30T09:08:07.74Z",
|
48
115
|
"repository"=>"Metropolitan Museum of Art, New York, NY",
|
49
116
|
"objectURL"=>"https://www.metmuseum.org/art/collection/search/1000"}
|
50
117
|
```
|
118
|
+
</pre>
|
119
|
+
</details>
|
51
120
|
|
52
121
|
## Contributing
|
53
122
|
|
@@ -3,12 +3,68 @@ module MetMuseum
|
|
3
3
|
API_ENDPOINT = "https://collectionapi.metmuseum.org".freeze
|
4
4
|
PUBLIC_URI = "/public/collection/v1/objects".freeze
|
5
5
|
|
6
|
+
# Return a listing of all valid Object IDs available to use
|
7
|
+
# @param [String] metadataDate Returns any objects with updated data after this date
|
8
|
+
# @return [Hash<total, Integer>] The total number of publicly-available objects
|
9
|
+
# @return [Hash<objectIDs, Array<Integer>>] An array containing the object ID of publicly-available object
|
6
10
|
def self.objects(metadataDate = nil)
|
7
11
|
conn = Faraday.new(:url => API_ENDPOINT)
|
8
12
|
response = conn.get PUBLIC_URI, {:metadataDate => metadataDate}
|
9
13
|
Oj.load(response.body)
|
10
14
|
end
|
11
15
|
|
16
|
+
# returns a record for an object, containing all open access data about that object, including its image (if the image is available under Open Access)
|
17
|
+
# @param [Integer] objectID The unique Object ID for an object
|
18
|
+
# @return [Hash<objectID, Integer>] Identifying number for each artwork (unique, can be used as key field)
|
19
|
+
# @return [Hash<isHighlight, Boolean>] When "true" indicates a popular and important artwork in the collection
|
20
|
+
# @return [Hash<accessionNumber, String>] Identifying number for each artwork (not always unique)
|
21
|
+
# @return [Hash<isPublicDomain, Boolean>] When "true" indicates an artwork in the Public Domain
|
22
|
+
# @return [Hash<primaryImage, String>] URL to the primary image of an object in JPEG format
|
23
|
+
# @return [Hash<primaryImageSmall, String>] URL to the lower-res primary image of an object in JPEG format
|
24
|
+
# @return [Hash<additionalImages, Array<String>>] An array containing URLs to the additional images of an object in JPEG format
|
25
|
+
# @return [Hash<constituents, Array<Hash<String:String>>>] An array containing the constituents of an object, with both an artist name and their role
|
26
|
+
# @return [Hash<department, String>] Indicates The Met's curatorial department responsible for the artwork
|
27
|
+
# @return [Hash<objectName, String>] Describes the physical type of the object
|
28
|
+
# @return [Hash<title, String>] Title, identifying phrase, or name given to a work of art
|
29
|
+
# @return [Hash<culture, String>] Information about the culture, or people from which an object was created
|
30
|
+
# @return [Hash<period, String>] Time or time period when an object was created
|
31
|
+
# @return [Hash<dynasty, String>] Dynasty (a succession of rulers of the same line or family) under which an object was created
|
32
|
+
# @return [Hash<reign, String>] Reign of a monarch or ruler under which an object was created
|
33
|
+
# @return [Hash<portfolio, String>] A set of works created as a group or published as a series.
|
34
|
+
# @return [Hash<artistRole, String>] Role of the artist related to the type of artwork or object that was created
|
35
|
+
# @return [Hash<artistPrefix, String>] TDescribes the extent of creation or describes an attribution qualifier to the information given in the artistRole field
|
36
|
+
# @return [Hash<artistDisplayName, String>] Artist name in the correct order for display
|
37
|
+
# @return [Hash<artistDisplayBio, String>] Nationality and life dates of an artist, also includes birth and death city when known
|
38
|
+
# @return [Hash<artistSuffix, String>] Used to record complex information that qualifies the role of a constituent, e.g. extent of participation by the Constituent (verso only, and followers)
|
39
|
+
# @return [Hash<artistAlphaSort, String>] Used to sort artist names alphabetically. Last Name, First Name, Middle Name, Suffix, and Honorific fields, in that order.
|
40
|
+
# @return [Hash<artistNationality, String>] National, geopolitical, cultural, or ethnic origins or affiliation of the creator or institution that made the artwork
|
41
|
+
# @return [Hash<artistBeginDate, String>] Year the artist was born
|
42
|
+
# @return [Hash<artistEndDate, String>] Year the artist died
|
43
|
+
# @return [Hash<objectDate, string>] The total number of publicly-available objects
|
44
|
+
# @return [Hash<total, string>] Year, a span of years, or a phrase that describes the specific or approximate date when an artwork was designed or created
|
45
|
+
# @return [Hash<objectBeginDate, string>] Machine readable date indicating the year the artwork was started to be created
|
46
|
+
# @return [Hash<objectEndDate, string>] Machine readable date indicating the year the artwork was completed (may be the same year or different year than the objectBeginDate)
|
47
|
+
# @return [Hash<medium, string>] Refers to the materials that were used to create the artwork
|
48
|
+
# @return [Hash<dimensions, string>] Size of the artwork or object
|
49
|
+
# @return [Hash<creditLine, String>] Text acknowledging the source or origin of the artwork and the year the object was acquired by the museum.
|
50
|
+
# @return [Hash<geographyType, String>] Qualifying information that describes the relationship of the place catalogued in the geography fields to the object that is being catalogued
|
51
|
+
# @return [Hash<city, String>] City where the artwork was created
|
52
|
+
# @return [Hash<state, String>] State or province where the artwork was created, may sometimes overlap with County
|
53
|
+
# @return [Hash<county, String>] County where the artwork was created, may sometimes overlap with State
|
54
|
+
# @return [Hash<country, String>] Country where the artwork was created or found
|
55
|
+
# @return [Hash<region, String>] Geographic location more specific than country, but more specific than subregion, where the artwork was created or found (frequently null)
|
56
|
+
# @return [Hash<subregion, String>] Geographic location more specific than Region, but less specific than Locale, where the artwork was created or found (frequently null)
|
57
|
+
# @return [Hash<locale, String>] Geographic location more specific than subregion, but more specific than locus, where the artwork was found (frequently null)
|
58
|
+
# @return [Hash<locus, String>] Geographic location that is less specific than locale, but more specific than excavation, where the artwork was found (frequently null)
|
59
|
+
# @return [Hash<excavation, String>] The name of an excavation. The excavation field usually includes dates of excavation.
|
60
|
+
# @return [Hash<river, String>] River is a natural watercourse, usually freshwater, flowing toward an ocean, a lake, a sea or another river related to the origins of an artwork (frequently null)
|
61
|
+
# @return [Hash<classification, String>] General term describing the artwork type.
|
62
|
+
# @return [Hash<rightsAndReproduction, String>] Credit line for artworks still under copyright.
|
63
|
+
# @return [Hash<linkResource, String>] URL to object's page on metmuseum.org
|
64
|
+
# @return [Hash<metadataDate, String>] Date metadata was last updated
|
65
|
+
# @return [Hash<repository, String>]
|
66
|
+
# @return [Hash<objectURL, String>] URL to object's page on metmuseum.org
|
67
|
+
# @return [Hash<total, String>] The total number of publicly-available objects
|
12
68
|
def self.object(objectID)
|
13
69
|
response = Faraday.get "#{API_ENDPOINT}#{PUBLIC_URI}/#{objectID}"
|
14
70
|
Oj.load(response.body)
|
data/lib/met_museum/version.rb
CHANGED
data/met_museum.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["calenthird@gamil.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{MET museum api wrapper}
|
13
|
-
spec.description = %q{The Metropolitan Museum of Art Collection API
|
13
|
+
spec.description = %q{The Metropolitan Museum of Art Collection API wrapper }
|
14
14
|
spec.homepage = "https://github.com/hyuraku/met_museum"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: met_museum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hyuraku
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description: 'The Metropolitan Museum of Art Collection API
|
83
|
+
description: 'The Metropolitan Museum of Art Collection API wrapper '
|
84
84
|
email:
|
85
85
|
- calenthird@gamil.com
|
86
86
|
executables: []
|