@scene_type
@workspace
@click.argument("destination")
@limit_option(default=-1)
@click.option("--dryrun", is_flag=True, help='Do not actually download')
@click.option("--products", multiple=True,
              type=click.Choice(ORTHO_PRODUCTS + ['all']),
              help='Specifiy products to download, default is visual')
@cli.command('sync')
def sync(destination, workspace, scene_type, limit, dryrun, products):
    aoi = None
    filters = {'workspace': workspace}

    if 'all' in products:
        products = ORTHO_PRODUCTS
    else:
        products = products or ('visual',)

    sync_tool = _SyncTool(client(), destination, aoi,
                          scene_type, products, **filters)

    try:
        to_fetch = sync_tool.init(limit)
    except ValueError as ve:
        raise click.ClickException(str(ve))
    click.echo('total scene products to fetch: %s' % to_fetch)
    if limit > -1:
        click.echo('limiting to %s' % limit)

    if dryrun:
        click.echo('would download:')
        for scene in sync_tool.get_scenes_to_sync():
            click.echo(scene['id'])
        return

    def progress_callback(name, remaining):
        click.echo('downloaded %s, remaining %s' %
                   (name, remaining))

    start_time = time.time()

    summary = sync_tool.sync(progress_callback)

    if summary.transferred:
        summarize_throughput(summary.transferred, start_time)
Synchronize a directory to a specified AOI or workspace
dataset/ETHPy150Open planetlabs/planet-client-python/planet/scripts/__init__.py/sync