Skip to content

Project Cards

Project Cards represent information about a tranportation infrastructure projects sufficient for usage in a regional travel demand model. The dream is that by coding a project once(ish) in a project card, it can be re-used over and over again in various scenarios – and even be shared across agencies.

Schema

The ProjectCard schema is represented as a json-schema in the /schema directory. More details: json-schemas page.

The rendering of json-schema leaves a wee bit to be desired, so you might prefer revieweing the schema in datamodels.

Data Model

If you are working in a python environment, you might find it easier to use the pydantic data models which are synced to the json-schema. More details: datamodels page.

Example Data

Example project cards can be found in the /examples directory and on the examples page as well as within the datamodels documentation.

Basic Usage

This package should generally be used to validate or update project cards.

There is also a limited object model, ProjectCard and Python API which can be used to read and write project cards.

Command Line

Validate project card(s) from a directory or specific file path, optionally filtering by a tag.

validate_card card_search_dir --filter_tags ['tag_to_search_for']

Update older project card(s) to current format from a directory or specific file path. Cards should still be validated afterwards.

update_projectcard_schema card_search_dir output_dir

Python API

from projectcard.io import read_cards

# Read in cards from a directory with the tag "Baseline 2030"
project_cards = read_cards(directory, filter_tags=["Baseline2030"])

# Iterate through a deck of cards for validity
for project_name,card in project_cards.items():
    print(f"{project_name}: {card.valid}")

# Print out a summary of the card with the project name "4th Ave Busway"
print(project_cards["4th Ave Busway"])

For more examples and detail, pleae see the API page.

Installation

pip install projectcard

Note

It is not generally necessary to install the projectcard package yourself unless you are using it to do independent validation of project cards. Projects such as network_wrangler that use the projectcard package to validate project cards usually include projectcard as a requirement and install it on their own.

Plan on developing in network wrangler?

You might want to follow the directions in the development documentation.

Companion Software

NetworkWrangler: While ProjectCard can stand alone, it was initially developed to be used with the NetworkWrangler network scenario management software.

ProjectCardRegistry: Example project card registries can be useful for storing collections of project cards, tracking their changes, and making sure project names are not duplicated.

Having an issue?

🪲 ProjectCard may contain bugs.

🤔 Also, since it has primarily been used by its developers, the documentation may contain some omissions or not be entirely clear.

But we’d love to make it better! Please report bugs or incorrect/unclear/missing documentation with a GitHub Issue - or fix them yourself with a pull request!

Who-dat?

ProjectCard was developed using resources from the Metropolitan Transportation Commission, Metropolitan Council MN, and in-kind time from UrbanLabs LLC and WSP. It is currently maintained using in-kind time…so please be patient.

Release History

Notable changes and version history.

Version Date Comment
v0.3.3 2024-10-15 Fixed “all” being treated as a str enum instead of bool in some places.
v0.3.2 2024-10-09 Fix bug with pycode validation and use Ruff instead of Flake8 b/c of deprecated API.
v0.3.1 2024-10-07 Improved resilience of read_cards() including ability to handle relative paths.
v0.3.0 2024-09-27 Added transit addition and deletion change types.
v0.2.0 2024-09-08 Read cards from nested folders.
v0.1.2 2024-08-05 -
v0.1.1 2024-06-20 Initial release on PyPI