Skip to content

Allow a variable set of cities and states in Library of Congress import #159

@JosiahDub

Description

@JosiahDub

In the import library_of_congress Richmond, Virginia is hard-coded in the search terms.

Create two new environment variables for comma separated lists of cities and states to insert into search terms. Something like this:

DEPLOYMENT_CITIES=Riverside,Corona,San Bernardino
DEPLOYMENT_STATES=California

These will default to Richmond, Virginia of course.

Params will then look like

    states = "|".join(f"location:{state.lower()}" for state in STATES.split(","))
    cities = "|".join(f"location:{city.lower()}" for city in CITIES.split(","))
    params = {
        "fa": f"{states}|{cities}",
        "fo": "json",
        "c": items_per_page,
        "sp": start_page,
    }

This will become the basis of allowing variable cities and states for other deployments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    importsImporting new collections

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions