2020-06-16 10:08:07 +00:00
|
|
|
import typer
|
|
|
|
|
from pathlib import Path
|
2020-06-24 17:20:45 +00:00
|
|
|
from .utils import generate_dates
|
2020-06-16 10:08:07 +00:00
|
|
|
|
|
|
|
|
app = typer.Typer()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.command()
|
|
|
|
|
def export_conv_json(
|
|
|
|
|
conv_src: Path = typer.Option(Path("./conv_data.json"), show_default=True),
|
|
|
|
|
conv_dest: Path = typer.Option(Path("./data/conv_data.json"), show_default=True),
|
|
|
|
|
):
|
|
|
|
|
from .utils import ExtendedPath
|
|
|
|
|
|
|
|
|
|
conv_data = ExtendedPath(conv_src).read_json()
|
|
|
|
|
|
2020-06-24 17:20:45 +00:00
|
|
|
conv_data["dates"] = generate_dates()
|
2020-06-16 10:08:07 +00:00
|
|
|
|
|
|
|
|
ExtendedPath(conv_dest).write_json(conv_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
app()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
main()
|