Nason commited on
Commit
15557cb
·
verified ·
1 Parent(s): d8a5495

docs: add tested quick starts and snapshot guidance

Browse files
Files changed (1) hide show
  1. README.md +23 -1
README.md CHANGED
@@ -34,6 +34,28 @@ ATTACH 'https://huggingface.co/datasets/Nason/fec-database/resolve/main/fec.duck
34
  SELECT CAND_ID,CAND_NAME FROM fec.candidates WHERE cycle=2026 AND CAND_OFFICE='H' ORDER BY CAND_ID LIMIT 5;
35
  ```
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  ### R with DBI and duckdb
38
 
39
  Install the dependencies once with `install.packages(c("DBI", "duckdb"))`.
@@ -51,7 +73,7 @@ dbDisconnect(con, shutdown = TRUE)
51
  DuckDB uses HTTP range requests; queries run on your machine and may need substantial memory or download data. A `LIMIT` does not guarantee a small scan.
52
 
53
 
54
- Install/upgrade Python with `python -m pip install --upgrade datapond` (the examples use 0.1.5), or install released R datapond from [CRAN](https://cran.r-project.org/package=datapond) with `install.packages("datapond")`. R 0.1.1 remains a separate development version. The catalog ID is `fec`.
55
 
56
  ## Snapshot and verification
57
 
 
34
  SELECT CAND_ID,CAND_NAME FROM fec.candidates WHERE cycle=2026 AND CAND_OFFICE='H' ORDER BY CAND_ID LIMIT 5;
35
  ```
36
 
37
+ ### Python with DuckDB
38
+
39
+ Install once with `python -m pip install duckdb`.
40
+
41
+ ```python
42
+ import duckdb
43
+ con = duckdb.connect(config={"memory_limit": "128MiB", "threads": 1,
44
+ "max_temp_directory_size": "0B"})
45
+ try:
46
+ con.execute("INSTALL httpfs; LOAD httpfs;")
47
+ con.execute("ATTACH 'https://huggingface.co/datasets/Nason/fec-database/resolve/main/fec.duckdb' AS fec (READ_ONLY)")
48
+ print(con.execute("SELECT CAND_ID, CAND_NAME FROM fec.candidates WHERE cycle=2026 AND CAND_OFFICE='H' ORDER BY CAND_ID LIMIT 5").fetchall())
49
+ finally:
50
+ con.close()
51
+ ```
52
+
53
+ These URLs follow the latest publication. For reproducible results, use the immutable
54
+ `attach_url` in the [Datapond registry](https://github.com/datapond-db/registry/blob/main/registry.json)
55
+ and record the revision. HTTP range queries execute locally and may transfer much of
56
+ the database; `LIMIT` does not guarantee a small scan. The buffer limit is not a total
57
+ process-memory cap; with spill disabled, larger queries may fail.
58
+
59
  ### R with DBI and duckdb
60
 
61
  Install the dependencies once with `install.packages(c("DBI", "duckdb"))`.
 
73
  DuckDB uses HTTP range requests; queries run on your machine and may need substantial memory or download data. A `LIMIT` does not guarantee a small scan.
74
 
75
 
76
+ Install/upgrade Python with `python -m pip install --upgrade datapond`, or install released R datapond from [CRAN](https://cran.r-project.org/package=datapond) with `install.packages("datapond")`. R 0.1.1 remains a separate development version. The catalog ID is `fec`.
77
 
78
  ## Snapshot and verification
79