Basic tools for downloading and viewing the Cal-ITP transit technology stack database.
From source:
pip install .
import transitstacks as ts
all_stacks = ts.Stack(
ts.read_stack_from_gsheets(filter_dict = {"Transit Provider": "GET Bus"})
)
# list all products
my_stack.components_df.products
# get most common products
my_stack.components_df['products'].value_counts().sort_values(ascending=False)
You can use the Jupyter Notebook /notebooks/Stack Database Analysis.ipynb
for interactive viewing of dataframes by using the
command jupyter notebook
.
import transitstacks as ts
my_stack = ts.Stack(
ts.read_stack_from_gsheets(filter_dict = {"Transit Provider": "GET Bus"})
)
my_stack.relationships_df
LEVEL1 = "Function Group"
LEVEL2 = "Product"
d = ts.stack_diagram(
my_stack,
cluster_level_1 = LEVEL1,
cluster_level_2 = LEVEL2,
bgcolor_cluster_L1 = ts.stack.greenyellow_functiongroup_map,
)
You can use the Jupyter Notebook /notebooks/Individual Transit Provider Analysis.ipynb
for interactive transit stack diagram
generation by using the command jupyter notebook
.
General steps:
git checkout -b feature/fooBar
)git commit -am 'Add some fooBar'
)git push origin feature/fooBar
)Development requirements are listed in dev-requirements.txt
and can be installed by:
pip install -r dev-requirements.txt
Tests are written for pytest
and can be run using the command pytest
.
Docstrings are written in google style and
auto-rendered as api documentation using mkdocstrings as specified in /docs/api.md
.
Documentation uses mkdocs and is in the /docs
folder.
It can be rendered locally using the command mkdocs serve
.