-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a9d3f73
commit 290adb9
Showing
40 changed files
with
1,179 additions
and
1,162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import logging | ||
|
||
import click as click | ||
import click_log | ||
from fs import open_fs | ||
|
||
from liiatools.common.reference import authorities | ||
|
||
from .pipeline import process_session | ||
|
||
log = logging.getLogger() | ||
click_log.basic_config(log) | ||
|
||
|
||
@click.group() | ||
def cin_census(): | ||
"""Functions for cleaning, minimising and aggregating CIN census files""" | ||
pass | ||
|
||
|
||
@cin_census.command() | ||
@click.option( | ||
"--la-code", | ||
"-c", | ||
required=True, | ||
type=click.Choice(authorities.codes, case_sensitive=False), | ||
help="Local authority code", | ||
) | ||
@click.option( | ||
"--output", | ||
"-o", | ||
required=True, | ||
type=click.Path(file_okay=False, writable=True), | ||
help="Output folder", | ||
) | ||
@click.option( | ||
"--input", | ||
"-i", | ||
type=click.Path(exists=True, file_okay=False, readable=True), | ||
) | ||
@click_log.simple_verbosity_option(log) | ||
def pipeline(input, la_code, output): | ||
""" | ||
Runs the full pipeline on a file or folder | ||
:param input: The path to the input folder | ||
:param la_code: A three-letter string for the local authority depositing the file | ||
:param output: The path to the output folder | ||
:return: None | ||
""" | ||
|
||
# Source FS is the filesystem containing the input files | ||
source_fs = open_fs(input) | ||
|
||
# Get the output filesystem | ||
output_fs = open_fs(output) | ||
|
||
process_session(source_fs, output_fs, la_code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.