add command to export the data in a way that the ui (immoweb) can consume
This commit is contained in:
parent
102c20ac42
commit
7e8c79d3d1
4 changed files with 66 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ from data_access import Listing
|
|||
import csv_exporter
|
||||
from rec.query import ListingType, FurnishType
|
||||
from rec.routing import API_KEY_ENVIRONMENT_VARIABLE, TravelMode
|
||||
from ui_exporter import export_immoweb as export_immoweb_ui
|
||||
|
||||
dump_listings_module = importlib.import_module('1_dump_listings')
|
||||
dump_detail_module = importlib.import_module('2_dump_detail')
|
||||
|
|
@ -230,6 +231,25 @@ def export_csv(ctx: click.core.Context, output_file: str, columns: tuple[str]):
|
|||
asyncio.run(
|
||||
csv_exporter.export_to_csv(listings, output_file_path,
|
||||
list(columns)), )
|
||||
|
||||
@cli.command()
|
||||
@click.option(
|
||||
'--output-file',
|
||||
'-O',
|
||||
help='Path to the output immoweb file',
|
||||
required=True,
|
||||
type=click.Path(
|
||||
writable=True,
|
||||
file_okay=True,
|
||||
dir_okay=False,
|
||||
resolve_path=True,
|
||||
),
|
||||
)
|
||||
@click.pass_context
|
||||
def export_immoweb(ctx, output_file: str):
|
||||
click.echo(f'Exporting data to {output_file}')
|
||||
asyncio.run(export_immoweb_ui(ctx, output_file))
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue