Skip to content

Commit

Permalink
Extract XLSX logic + Add Data Dictionary + Add Artifacts (#1263)
Browse files Browse the repository at this point in the history
* Add new attrs required for the zoning metadata

* Add Revisions to the Dataset Model

* Add DataDictionary to document fields on our models

* Add __repr__ equivalent to pretty-print types

* Add Abstract Docs and Artifacts

* Rewrite XLSX generator to take tables + org md

* Rename package.oti_xlsx -> xlsx_writer

* Remove OTI Template Tabs from XLSX

* Ongoing docs + quick fixes

---------

Co-authored-by: Alex Richey <[email protected]>
  • Loading branch information
alexrichey and Alex Richey authored Dec 9, 2024
1 parent e7bdf5a commit 340ec91
Show file tree
Hide file tree
Showing 24 changed files with 1,253 additions and 330 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/template_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/checkout@v4
with:
repository: NYCPlanning/product-metadata
path: product_metadata

- name: set_product_metadata_path
run: echo "PRODUCT_METADATA_REPO_PATH=$(pwd)/product_metadata" >> $GITHUB_ENV
working-directory: ./

- name: Load Secrets
uses: 1password/load-secrets-action@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions dcpy/connectors/socrata/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def from_dataset_attributes(cls, attrs: md.DatasetAttributes):
description=attrs.description,
category=attrs.category,
attribution=attrs.attribution or "",
attributionLink=attrs.attributionLink or "",
attributionLink=attrs.attribution_link or "",
tags=attrs.tags or [],
metadata={
"rowLabel": attrs.each_row_is_a,
Expand All @@ -158,7 +158,7 @@ def from_dataset_attributes(cls, attrs: md.DatasetAttributes):
"Legislative Compliance": {
"Removed Records?": "Yes", # refers to row removal at time of push to Socrata. Always true since we overwrite the existing dataset.
"Has Data Dictionary?": "Yes",
"Geocoded?": "Yes",
"Geocoded?": "Yes" if attrs.geocoded else "No",
"External Frequency (LL 110/2015)": attrs.publishing_frequency,
"Exists Externally? (LL 110/2015)": "Yes",
"Contains Address?": (
Expand Down
4 changes: 2 additions & 2 deletions dcpy/lifecycle/package/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from .esri import app as esri_app

from .assemble import app as assemble_app
from .oti_xlsx import app as oti_xlsx_app
from .xlsx_writer import app as xlsx_writer_app
from .shapefiles import app as shapefile_app

app = typer.Typer()
app.command(name="validate")(_validate)
app.add_typer(esri_app, name="esri")
app.add_typer(assemble_app, name="assemble")
app.add_typer(oti_xlsx_app, name="oti")
app.add_typer(xlsx_writer_app, name="oti")
app.add_typer(shapefile_app, name="shapefile")
Loading

0 comments on commit 340ec91

Please sign in to comment.