MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / save

Method save

openlibrary/api.py:140–147  ·  view source on GitHub ↗
(self, key, data, comment=None)

Source from the content-addressed store, hash-verified

138 return response.json()["result"]
139
140 def save(self, key, data, comment=None):
141 headers = {"Content-Type": "application/json"}
142 data = marshal(data)
143 if comment:
144 headers["Opt"] = '"%s/dev/docs/api"; ns=42' % self.base_url
145 headers["42-comment"] = comment
146 data = json.dumps(data)
147 return self._request(key, method="PUT", data=data, headers=headers).content
148
149 def _call_write(self, name, query, comment, action):
150 headers = {"Content-Type": "application/json"}

Callers 2

update_preferencesFunction · 0.45
fix_recordsFunction · 0.45

Calls 3

_requestMethod · 0.95
marshalFunction · 0.85
dumpsMethod · 0.80

Tested by

no test coverage detected