File tree Expand file tree Collapse file tree
datasets/US/us_nara_nsdap Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }}"
Original file line number Diff line number Diff line change 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+ )
Load diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments