parameterize data path when fetching listings
This commit is contained in:
parent
ea56555884
commit
48d379567b
3 changed files with 28 additions and 11 deletions
|
|
@ -1,9 +1,13 @@
|
|||
import pathlib
|
||||
from rec.query import listing_query
|
||||
from rec.districts import get_districts
|
||||
from data_access import Listing
|
||||
|
||||
|
||||
def dump_listings(district_names: set[str] | None = None):
|
||||
def dump_listings(
|
||||
district_names: set[str] | None = None,
|
||||
data_dir: pathlib.Path = pathlib.Path("data/rs/")
|
||||
):
|
||||
districts = get_districts() if district_names is None else {
|
||||
district: locid
|
||||
for district, locid in get_districts().items()
|
||||
|
|
@ -37,7 +41,7 @@ def dump_listings(district_names: set[str] | None = None):
|
|||
for property in d["properties"]:
|
||||
identifier = property["identifier"]
|
||||
|
||||
listing = Listing(identifier)
|
||||
listing = Listing(identifier, data_dir=data_dir)
|
||||
listing.dump_listing(property)
|
||||
print() # break line as we used end=, above.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue