Skip to content

Commit 00f0c88

Browse files
committed
✨ (memorious) Add NARA NSDAP Membership Records
1 parent 361805b commit 00f0c88

3 files changed

Lines changed: 85 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: us_nara_nsdap
2+
title: NARA NSDAP Membership Records
3+
prefix: us-nara-nsdap
4+
description: >
5+
Digitized records of the NSDAP (Nationalsozialistische Deutsche Arbeiterpartei)
6+
membership and master files held by the U.S. National Archives and Records
7+
Administration (NARA) as part of Record Group 242, "National Archives
8+
Collection of Foreign Records Seized". The collection comprises the NSDAP
9+
central party membership index cards (A3340-MFKL series) microfilmed by NARA
10+
and now made available as PDF objects via the National Archives Catalog.
11+
category: library
12+
publisher:
13+
name: U.S. National Archives and Records Administration
14+
url: https://www.archives.gov/
15+
country: us
16+
official: true
17+
data_url: https://catalog.archives.gov/id/12044361
18+
maintainer:
19+
name: DARC
20+
url: https://dataresearchcenter.org
21+
logo_url: https://cdn.investigativedata.org/style/logos/darc/svg/DARC-Logo-RGB-Horizontal-Neg.svg
22+
git_repo: https://github.com/dataresearchcenter/datasets
23+
coverage:
24+
frequency: never
25+
content_type: documents
26+
27+
pipeline:
28+
init:
29+
method: ./operations.py:seed
30+
params:
31+
source: ./src/urls.json
32+
handle:
33+
pass: fetch
34+
35+
fetch:
36+
method: fetch
37+
handle:
38+
pass: store
39+
40+
store:
41+
method: lakehouse
42+
params:
43+
compute_path:
44+
method: template
45+
params:
46+
template: "{{ file_name }}"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
"""NARA NSDAP membership records crawler.
2+
3+
Iterates a static `urls.json` manifest (one entry per PDF) produced upstream
4+
from the NARA Catalog API and emits each record into the fetch pipeline.
5+
6+
Source json from this repo: https://github.com/R3ITOSv87/nara-crawler
7+
"""
8+
9+
import json
10+
from pathlib import Path
11+
12+
from anystore.types import SDict
13+
from memorious.logic.context import Context
14+
15+
16+
def seed(context: Context, data: SDict):
17+
source = Path(context.params["source"])
18+
if not source.is_absolute():
19+
source = Path(__file__).parent / source
20+
21+
publisher = context.crawler.config.publisher.model_dump(mode="json")
22+
23+
with source.open() as fh:
24+
manifest = json.load(fh)
25+
26+
for item in manifest["items"]:
27+
na_id = item["naId"]
28+
context.emit(
29+
data={
30+
"url": item["pdf_url"],
31+
"file_name": item["filename"],
32+
"title": item["title"],
33+
"foreign_id": na_id,
34+
"emit_cache_key": na_id,
35+
"na_id": na_id,
36+
"publisher": publisher,
37+
}
38+
)

datasets/US/us_nara_nsdap/src/urls.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)