Skip to content

Commit 0798ab6

Browse files
authored
Update examples in README
1 parent 5c70ec7 commit 0798ab6

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ import museumpy
9696

9797
id = '98977'
9898
module = 'Multimedia'
99-
# download attachment to a direcory called `files`
99+
# download attachment to a directory called `files`
100100
attachment_path = client.download_attachment(id, module, 'files')
101101
print(attachment_path)
102102
```
@@ -124,9 +124,10 @@ For convenience a default mapping is provided to access some fields more easily:
124124
```python
125125
for record in records:
126126
print(record['hasAttachments'])
127+
print(record['ObjObjectNumberTxt'])
127128
```
128129

129-
If you want to customize this mapping, you can pass a `map_function` to `search` and `fulltext_search`:
130+
If you want to customize this mapping, you can pass a `map_function` to the client, which is then used on all subsequent calls to `search` and `fulltext_search`:
130131

131132

132133
```python
@@ -149,6 +150,15 @@ client = museumpy.MuseumPlusClient(
149150
base_url='https://test.zetcom.com/MpWeb-mpTest',
150151
map_function=my_custom_map,
151152
)
153+
154+
records = client.search(
155+
base_url='https://test.zetcom.com/MpWeb-mpTest',
156+
query='Patolu',
157+
)
158+
for record in records:
159+
print(record['my_id'])
160+
print(record['my_title'])
161+
152162
```
153163

154164
## Release

0 commit comments

Comments
 (0)