Skip to content

Commit

Permalink
Merge pull request #81 from arthur-schnitzler/main
Browse files Browse the repository at this point in the history
updates
  • Loading branch information
csae8092 authored May 8, 2024
2 parents 8b850ce + 81bb459 commit ffe8ebf
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dumper/templates/dumper/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<h1 class="display-1 text-center">PMB</h1>
<h2 id="personen-der-morderne-basis">Personen der Moderne Basis*</h2>
<p>Die PMB ist ein Webservice für Personen, Werke, Institutionen, Orte und Ereignisse speziell
für die Zeit in Wien um 1900. Ihre einfachste Funktion besteht darin, für verschiedene
für die Zeit in Wien um 1900. Die einfachste Funktion besteht darin, für verschiedene
Projekte eine gemeinsame Datenbank zu schaffen. Das erleichtert einerseits die Erfassung von
Personen, wenn diese bereits angelegt sind. Es vereinfacht andererseits die Suche über
mehrere Projekte hinweg. Verweise auf andere Normdatensätze (GND, geonames.org) erlauben den
mehrere Projekte hinweg. Verweise auf andere Normdatensätze (GND, Wikidata, geonames.org) erlauben den
automatisierten Abgleich, ohne Fehler von diesen übernehmen zu müssen.</p>
<h2 id="datenherkunf">Datenherkunft<a class="anchor-link" href="#datenherkunft"
aria-label="Link to this section: Datenherkunf">#</a></h2>
Expand Down
111 changes: 111 additions & 0 deletions notebooks/issue__188_briefe_uris.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "ba8fedd0",
"metadata": {},
"outputs": [],
"source": [
"# 2024-05-02 run against production\n",
"from tqdm import tqdm\n",
"from dumper.utils import gsheet_to_df\n",
"from apis_core.utils import get_object_from_pk_or_uri"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1da8e52f",
"metadata": {},
"outputs": [],
"source": [
"uris = Uri.objects.filter(uri__icontains=\"schnitzler-briefe.acdh.oeaw.ac.at/pmb\")\n",
"uris.count()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d72e13cf",
"metadata": {},
"outputs": [],
"source": [
"for x in tqdm(uris, total=uris.count()):\n",
" x.delete()\n",
"uris = Uri.objects.filter(uri__icontains=\"schnitzler-briefe.acdh.oeaw.ac.at\")\n",
"uris.count()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "540b4e40",
"metadata": {},
"outputs": [],
"source": [
"df = gsheet_to_df(\"1VXXj7tc4sy52KpV_II4gIYmVUQ-lSLi-S8XqBsBMlCE\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9534a5cd",
"metadata": {},
"outputs": [],
"source": [
"df.head(3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "76db6ce8",
"metadata": {},
"outputs": [],
"source": [
"for i, row in tqdm(df.iterrows(), total=len(df)):\n",
" try:\n",
" entity = get_object_from_pk_or_uri(row[\"PMB\"])\n",
" except Exception as e:\n",
" print(row[\"PMB\"], e)\n",
" continue\n",
" uri, _ = Uri.objects.get_or_create(\n",
" uri=row[\"URI\"],\n",
" domain=\"schnitzler-briefe\",\n",
" entity=entity\n",
" )\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e44bd22c",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Django Shell-Plus",
"language": "python",
"name": "django_extensions"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit ffe8ebf

Please sign in to comment.