Skip to content

Commit

Permalink
ingest nypl_libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
fvankrieken committed Jan 29, 2025
1 parent 26651e2 commit 6681432
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 126 deletions.
28 changes: 0 additions & 28 deletions dcpy/library/script/nypl_libraries.py

This file was deleted.

32 changes: 0 additions & 32 deletions dcpy/library/templates/nypl_libraries.yml

This file was deleted.

60 changes: 0 additions & 60 deletions dcpy/lifecycle/ingest/dev_templates/nypl_libraries.yml

This file was deleted.

31 changes: 31 additions & 0 deletions dcpy/lifecycle/ingest/templates/nypl_libraries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
id: nypl_libraries

acl: public-read

attributes:
name: New York Public Libraries
description: NYPL operates libraries in Manhattan, Bronx, and Staten Island
url: https://www.nypl.org/locations

ingestion:
source:
type: api
endpoint: https://refinery.nypl.org/api/nypl/locations/v1.0/locations
format: json
file_format:
type: json
json_read_fn: normalize
json_read_kwargs: { "record_path": [ "locations" ] }
geometry:
geom_column: geolocation.coordinates
crs: EPSG:4326
format:
point_xy_str: "[x, y]"
processing_steps:
- name: rename_columns
args:
map: { postal_code: zipcode, street_address: address, geom: wkb_geometry }
- name: filter_columns
args: { columns: [ name, zipcode, address, locality, region, wkb_geometry ] }

columns: []
6 changes: 0 additions & 6 deletions dcpy/test/library/test_ingest_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,3 @@ def test_bpl_libraries():
ingestor = Ingestor()
ingestor.csv(f"{template_path}/bpl_libraries.yml", version="test")
assert os.path.isfile(".library/datasets/bpl_libraries/test/bpl_libraries.csv")


def test_nypl_libraries():
ingestor = Ingestor()
ingestor.csv(f"{template_path}/nypl_libraries.yml", version="test")
assert os.path.isfile(".library/datasets/nypl_libraries/test/nypl_libraries.csv")

0 comments on commit 6681432

Please sign in to comment.