Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/pdct 1399 Add skeleton for GCF document mapping #7

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gcf_data_mapper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import click

from gcf_data_mapper.parsers.collection import collection
from gcf_data_mapper.parsers.document import document
from gcf_data_mapper.parsers.family import family


Expand Down Expand Up @@ -45,7 +46,7 @@ def wrangle_to_json(debug) -> dict[str, list[Optional[dict[str, Any]]]]:
return {
"collections": collection(debug),
"families": family(debug),
"documents": [],
"documents": document(debug),
"events": [],
}

Expand Down
17 changes: 17 additions & 0 deletions gcf_data_mapper/parsers/document.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from typing import Any, Optional

import click


def document(debug: bool) -> list[Optional[dict[str, Any]]]:
"""Map the GCF document info to new structure.

:param bool debug: Whether debug mode is on.
:return list[Optional[dict[str, Any]]]: A list of GCF families in
the 'destination' format described in the GCF Data Mapper Google
Sheet.
"""
if debug:
click.echo("📝 Wrangling GCF document data.")

return []
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gcf-data-mapper"
version = "0.1.3"
version = "0.1.4"
description = "A CLI tool to wrangle GCF data into format recognised by the bulk-import tool."
authors = ["CPR-dev-team <[email protected]>"]
license = "Apache-2.0"
Expand Down
9 changes: 9 additions & 0 deletions tests/unit_tests/parsers/document/test_document.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import pytest

from gcf_data_mapper.parsers.document import document


@pytest.mark.parametrize("debug", [True, False])
def test_returns_empty(debug: bool):
document_data = document(debug)
assert document_data == []
Loading