Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impresso.collections.find(term="war")

# Get a specific collection by ID
collection = impresso.collections.get("collection-id")
collection_id = collection.raw["uid"]
collection_id = collection.raw["id"]

# List items in a collection
items = impresso.collections.items(collection_id)
Expand Down
535 changes: 275 additions & 260 deletions examples/notebooks/basic.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions examples/notebooks/collections.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"metadata": {},
"outputs": [],
"source": [
"test_collection_id = result.raw[\"uid\"]\n",
"test_collection_id = result.raw[\"id\"]\n",
"test_collection_id"
]
},
Expand All @@ -98,7 +98,7 @@
"outputs": [],
"source": [
"content_item = impresso.content_items.get(\"NZZ-1794-08-09-a-i0002\")\n",
"impresso.collections.add_items(test_collection_id, [content_item.pydantic.uid])"
"impresso.collections.add_items(test_collection_id, [content_item.pydantic.id])"
]
},
{
Expand Down Expand Up @@ -133,7 +133,7 @@
"metadata": {},
"outputs": [],
"source": [
"impresso.collections.remove_items(test_collection_id, [content_item.pydantic.uid])"
"impresso.collections.remove_items(test_collection_id, [content_item.pydantic.id])"
]
},
{
Expand All @@ -157,7 +157,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "impresso-py3.13 (3.13.7)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand Down
94 changes: 67 additions & 27 deletions examples/notebooks/data_providers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,35 +70,40 @@
" <th></th>\n",
" <th>name</th>\n",
" <th>names</th>\n",
" <th>bitmapIndex</th>\n",
" </tr>\n",
" <tr>\n",
" <th>id</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>ArcInfo</th>\n",
" <td>ArcInfo</td>\n",
" <td>[{'langCode': 'fr', 'name': 'ArcInfo'}, {'lang...</td>\n",
" <td>39</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BBC</th>\n",
" <td>British Broadcasting Corporation</td>\n",
" <td>[{'langCode': 'en', 'name': 'British Broadcast...</td>\n",
" <td>18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BCUF</th>\n",
" <td>Bibliothèque cantonale et universitaire de Fri...</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Bibliothèque cant...</td>\n",
" <td>23</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"<impresso.resources.data_providers.FindDataProvidersContainer at 0x1177c8c20>"
"<impresso.resources.data_providers.FindDataProvidersContainer at 0x1231d8ec0>"
]
},
"execution_count": 2,
Expand Down Expand Up @@ -158,35 +163,40 @@
" <th></th>\n",
" <th>name</th>\n",
" <th>names</th>\n",
" <th>bitmapIndex</th>\n",
" </tr>\n",
" <tr>\n",
" <th>id</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>BCUF</th>\n",
" <td>Bibliothèque cantonale et universitaire de Fri...</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Bibliothèque cant...</td>\n",
" <td>23</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BCUL</th>\n",
" <td>Bibliothèque cantonale et universitaire de Lau...</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Bibliothèque cant...</td>\n",
" <td>22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BL</th>\n",
" <td>British Library</td>\n",
" <td>[{'langCode': 'en', 'name': 'British Library'}]</td>\n",
" <td>10</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"<impresso.resources.data_providers.FindDataProvidersContainer at 0x1177a47d0>"
"<impresso.resources.data_providers.FindDataProvidersContainer at 0x12312ead0>"
]
},
"execution_count": 3,
Expand Down Expand Up @@ -236,35 +246,40 @@
" <th></th>\n",
" <th>name</th>\n",
" <th>names</th>\n",
" <th>bitmapIndex</th>\n",
" </tr>\n",
" <tr>\n",
" <th>id</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>BNF</th>\n",
" <td>National Library of France</td>\n",
" <td>[{'langCode': 'en', 'name': 'National Library ...</td>\n",
" <td>7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BNL</th>\n",
" <td>National Library of Luxembourg</td>\n",
" <td>[{'langCode': 'en', 'name': 'National Library ...</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CNA</th>\n",
" <td>Centre national de l'audiovisuel</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Centre national d...</td>\n",
" <td>41</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"<impresso.resources.data_providers.FindDataProvidersContainer at 0x1177a5e50>"
"<impresso.resources.data_providers.FindDataProvidersContainer at 0x12350c190>"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -374,25 +389,28 @@
" <th></th>\n",
" <th>name</th>\n",
" <th>names</th>\n",
" <th>bitmapIndex</th>\n",
" </tr>\n",
" <tr>\n",
" <th>id</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>ArcInfo</th>\n",
" <td>ArcInfo</td>\n",
" <td>[{'langCode': 'fr', 'name': 'ArcInfo'}, {'lang...</td>\n",
" <td>39</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"<impresso.resources.data_providers.GetDataProviderContainer at 0x1177c8980>"
"<impresso.resources.data_providers.GetDataProviderContainer at 0x1231daa50>"
]
},
"execution_count": 6,
Expand Down Expand Up @@ -449,113 +467,135 @@
" <th></th>\n",
" <th>name</th>\n",
" <th>names</th>\n",
" <th>bitmapIndex</th>\n",
" </tr>\n",
" <tr>\n",
" <th>id</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>ArcInfo</th>\n",
" <td>ArcInfo</td>\n",
" <td>[{'langCode': 'fr', 'name': 'ArcInfo'}, {'lang...</td>\n",
" <td>39</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BBC</th>\n",
" <td>British Broadcasting Corporation</td>\n",
" <td>[{'langCode': 'en', 'name': 'British Broadcast...</td>\n",
" <td>18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BCUF</th>\n",
" <td>Bibliothèque cantonale et universitaire de Fri...</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Bibliothèque cant...</td>\n",
" <td>23</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BCUL</th>\n",
" <td>Bibliothèque cantonale et universitaire de Lau...</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Bibliothèque cant...</td>\n",
" <td>22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BL</th>\n",
" <td>British Library</td>\n",
" <td>[{'langCode': 'en', 'name': 'British Library'}]</td>\n",
" <td>10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BNF</th>\n",
" <td>National Library of France</td>\n",
" <td>[{'langCode': 'en', 'name': 'National Library ...</td>\n",
" <td>7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BNL</th>\n",
" <td>National Library of Luxembourg</td>\n",
" <td>[{'langCode': 'en', 'name': 'National Library ...</td>\n",
" <td>6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BVCF</th>\n",
" <td>Bibliothèque de la Ville de La Chaux-de-Fonds</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Bibliothèque de l...</td>\n",
" <td>37</td>\n",
" </tr>\n",
" <tr>\n",
" <th>BVU</th>\n",
" <td>Bote vom Untersee und Rhein</td>\n",
" <td>[{'langCode': 'de', 'name': 'Bote vom Untersee...</td>\n",
" <td>38</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CNA</th>\n",
" <td>Centre national de l'audiovisuel</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Centre national d...</td>\n",
" <td>41</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DR</th>\n",
" <td>Deutschlandradio</td>\n",
" <td>[{'langCode': 'de', 'name': 'Deutschlandradio'...</td>\n",
" <td>21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>FedGaz</th>\n",
" <td>Swiss Federal Archives</td>\n",
" <td>[{'langCode': 'en', 'name': 'Swiss Federal Arc...</td>\n",
" <td>42</td>\n",
" </tr>\n",
" <tr>\n",
" <th>FRN</th>\n",
" <td>Freiburger Nachrichten</td>\n",
" <td>[{'langCode': 'de', 'name': 'Freiburger Nachri...</td>\n",
" <td>31</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Gruyere</th>\n",
" <td>La Gruyère</td>\n",
" <td>[{'langCode': 'fr', 'name': 'La Gruyère'}]</td>\n",
" <td>26</td>\n",
" </tr>\n",
" <tr>\n",
" <th>INA</th>\n",
" <td>Institut national de l'audiovisuel</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Institut national...</td>\n",
" <td>16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>KB</th>\n",
" <td>Royal Library of the Netherlands</td>\n",
" <td>[{'langCode': 'en', 'name': 'Royal Library of ...</td>\n",
" <td>9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>KBR</th>\n",
" <td>Royal Library of Belgium</td>\n",
" <td>[{'langCode': 'en', 'name': 'Royal Library of ...</td>\n",
" <td>8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LCE</th>\n",
" <td>Le Confédéré</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Le Confédéré'}]</td>\n",
" <td>28</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LES</th>\n",
" <td>L'Essor</td>\n",
" <td>[{'langCode': 'fr', 'name': 'L'Essor'}]</td>\n",
" <td>29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LeTemps</th>\n",
" <td>Le Temps</td>\n",
" <td>[{'langCode': 'fr', 'name': 'Le Temps'}, {'lan...</td>\n",
" <td>14</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
Expand Down Expand Up @@ -585,28 +625,28 @@
"LES L'Essor \n",
"LeTemps Le Temps \n",
"\n",
" names \n",
"id \n",
"ArcInfo [{'langCode': 'fr', 'name': 'ArcInfo'}, {'lang... \n",
"BBC [{'langCode': 'en', 'name': 'British Broadcast... \n",
"BCUF [{'langCode': 'fr', 'name': 'Bibliothèque cant... \n",
"BCUL [{'langCode': 'fr', 'name': 'Bibliothèque cant... \n",
"BL [{'langCode': 'en', 'name': 'British Library'}] \n",
"BNF [{'langCode': 'en', 'name': 'National Library ... \n",
"BNL [{'langCode': 'en', 'name': 'National Library ... \n",
"BVCF [{'langCode': 'fr', 'name': 'Bibliothèque de l... \n",
"BVU [{'langCode': 'de', 'name': 'Bote vom Untersee... \n",
"CNA [{'langCode': 'fr', 'name': 'Centre national d... \n",
"DR [{'langCode': 'de', 'name': 'Deutschlandradio'... \n",
"FedGaz [{'langCode': 'en', 'name': 'Swiss Federal Arc... \n",
"FRN [{'langCode': 'de', 'name': 'Freiburger Nachri... \n",
"Gruyere [{'langCode': 'fr', 'name': 'La Gruyère'}] \n",
"INA [{'langCode': 'fr', 'name': 'Institut national... \n",
"KB [{'langCode': 'en', 'name': 'Royal Library of ... \n",
"KBR [{'langCode': 'en', 'name': 'Royal Library of ... \n",
"LCE [{'langCode': 'fr', 'name': 'Le Confédéré'}] \n",
"LES [{'langCode': 'fr', 'name': 'L'Essor'}] \n",
"LeTemps [{'langCode': 'fr', 'name': 'Le Temps'}, {'lan... "
" names bitmapIndex \n",
"id \n",
"ArcInfo [{'langCode': 'fr', 'name': 'ArcInfo'}, {'lang... 39 \n",
"BBC [{'langCode': 'en', 'name': 'British Broadcast... 18 \n",
"BCUF [{'langCode': 'fr', 'name': 'Bibliothèque cant... 23 \n",
"BCUL [{'langCode': 'fr', 'name': 'Bibliothèque cant... 22 \n",
"BL [{'langCode': 'en', 'name': 'British Library'}] 10 \n",
"BNF [{'langCode': 'en', 'name': 'National Library ... 7 \n",
"BNL [{'langCode': 'en', 'name': 'National Library ... 6 \n",
"BVCF [{'langCode': 'fr', 'name': 'Bibliothèque de l... 37 \n",
"BVU [{'langCode': 'de', 'name': 'Bote vom Untersee... 38 \n",
"CNA [{'langCode': 'fr', 'name': 'Centre national d... 41 \n",
"DR [{'langCode': 'de', 'name': 'Deutschlandradio'... 21 \n",
"FedGaz [{'langCode': 'en', 'name': 'Swiss Federal Arc... 42 \n",
"FRN [{'langCode': 'de', 'name': 'Freiburger Nachri... 31 \n",
"Gruyere [{'langCode': 'fr', 'name': 'La Gruyère'}] 26 \n",
"INA [{'langCode': 'fr', 'name': 'Institut national... 16 \n",
"KB [{'langCode': 'en', 'name': 'Royal Library of ... 9 \n",
"KBR [{'langCode': 'en', 'name': 'Royal Library of ... 8 \n",
"LCE [{'langCode': 'fr', 'name': 'Le Confédéré'}] 28 \n",
"LES [{'langCode': 'fr', 'name': 'L'Essor'}] 29 \n",
"LeTemps [{'langCode': 'fr', 'name': 'Le Temps'}, {'lan... 14 "
]
},
"execution_count": 7,
Expand Down Expand Up @@ -705,7 +745,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "impresso-py3.13 (3.13.7)",
"display_name": ".venv",
"language": "python",
"name": "python3"
},
Expand Down
Loading