How to use the cligj.verbose_opt function in cligj

To help you get started, we’ve selected a few cligj examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mapbox / cligj / tests / test_cli.py View on Github external
    @cligj.verbose_opt
    def cmd(verbose):
        click.echo("%s" % verbose)
github Toblerity / Fiona / fiona / fio / main.py View on Github external
@verbose_opt
@quiet_opt
@click.option(
    "--aws-profile",
    help="Select a profile from the AWS credentials file")
@click.option(
    "--aws-no-sign-requests",
    is_flag=True,
    help="Make requests anonymously")
@click.option(
    "--aws-requester-pays",
    is_flag=True,
    help="Requester pays data transfer costs")
@click.version_option(fio_version)
@click.version_option(fiona.__gdal_version__, '--gdal-version',
                      prog_name='GDAL')
@click.version_option(sys.version, '--python-version', prog_name='Python')
github mapbox / rasterio / rasterio / rio / main.py View on Github external
@cligj.verbose_opt
@cligj.quiet_opt
@click.option('--aws-profile',
              help="Selects a profile from your shared AWS credentials file")
@click.version_option(version=rasterio.__version__, message='%(version)s')
@click.option('--gdal-version', is_eager=True, is_flag=True,
              callback=gdal_version_cb)
@click.pass_context
def main_group(ctx, verbose, quiet, aws_profile, gdal_version):
    """Rasterio command line interface.
    """
    verbosity = verbose - quiet
    configure_logging(verbosity)
    ctx.obj = {}
    ctx.obj['verbosity'] = verbosity
    ctx.obj['aws_profile'] = aws_profile
    ctx.obj['env'] = rasterio.Env(CPL_DEBUG=(verbosity > 2),
github mapbox / mapbox-cli-py / mapboxcli / scripts / cli.py View on Github external
@cligj.verbose_opt
@cligj.quiet_opt
@click.option('--access-token', help="Your Mapbox access token.")
@click.option('--config', '-c', type=click.Path(exists=True,
              resolve_path=True),
              help="Config file (default: '{0}/mapbox.ini'".format(
                  click.get_app_dir('mapbox')))
@click.pass_context
def main_group(ctx, verbose, quiet, access_token, config):
    """This is the command line interface to Mapbox web services.

    Mapbox web services require an access token. Your token is shown
    on the https://www.mapbox.com/studio/account/tokens/ page when you are
    logged in. The token can be provided on the command line

      $ mapbox --access-token MY_TOKEN ...
github dheerajchand / ubuntu-django-nginx-ansible / projectenv / lib / python2.7 / site-packages / fiona / fio / main.py View on Github external
@verbose_opt
@quiet_opt
@click.version_option(fio_version)
@click.version_option(fiona.__gdal_version__, '--gdal-version',
    prog_name='GDAL')
@click.version_option(sys.version, '--python-version', prog_name='Python')
@click.pass_context
def main_group(ctx, verbose, quiet):

    """Fiona command line interface."""

    verbosity = verbose - quiet
    configure_logging(verbosity)
    ctx.obj = {'verbosity': verbosity}
github smnorris / bcdata / bcdata / cli.py View on Github external
@verbose_opt
@quiet_opt
def info(dataset, indent, meta_member, verbose, quiet):
    """Print basic metadata about a DataBC WFS layer as JSON.

    Optionally print a single metadata item as a string.
    """
    verbosity = verbose - quiet
    configure_logging(verbosity)
    table = bcdata.validate_name(dataset)
    wfs = WebFeatureService(url=bcdata.OWS_URL, version="2.0.0")
    info = {}
    info["name"] = table
    info["count"] = bcdata.get_count(table)
    info["schema"] = wfs.get_schema("pub:" + table)
    if meta_member:
        click.echo(info[meta_member])
github Toblerity / Fiona / fiona / fio / cli.py View on Github external
@verbose_opt
@quiet_opt
@click.option('--version', is_flag=True, callback=print_version,
              expose_value=False, is_eager=True,
              help="Print Fiona version.")
@click.pass_context
def cli(ctx, verbose, quiet):
    verbosity = verbose - quiet
    configure_logging(verbosity)
    ctx.obj = {}
    ctx.obj['verbosity'] = verbosity
github smnorris / bcdata / bcdata / cli.py View on Github external
@verbose_opt
@quiet_opt
def dump(dataset, query, out_file, bounds, bounds_crs, verbose, quiet):
    """Write DataBC features to stdout as GeoJSON feature collection.

    \b
      $ bcdata dump bc-airports
      $ bcdata dump bc-airports --query "AIRPORT_NAME='Victoria Harbour (Shoal Point) Heliport'"
      $ bcdata dump bc-airports --bounds xmin ymin xmax ymax

     It can also be combined to read bounds of a feature dataset using Fiona:
    \b
      $ bcdata dump bc-airports --bounds $(fio info aoi.shp --bounds)

    """
    verbosity = verbose - quiet
    configure_logging(verbosity)
github smnorris / bcdata / bcdata / cli.py View on Github external
@verbose_opt
@quiet_opt
def dem(
    bounds, bounds_crs, dst_crs, out_file, resolution, interpolation, verbose, quiet
):
    """Dump BC DEM to TIFF
    """
    verbosity = verbose - quiet
    configure_logging(verbosity)
    if not dst_crs:
        dst_crs = "EPSG:3005"
    bcdata.get_dem(
        bounds,
        out_file=out_file,
        src_crs=bounds_crs,
        dst_crs=dst_crs,
        resolution=resolution,
github mapbox / mapbox-sdk-py / mapbox / scripts / cli.py View on Github external
@cligj.verbose_opt
@cligj.quiet_opt
@click.option('--access-token', help="Your Mapbox access token.")
@click.version_option(version=mapbox.__version__, message='%(version)s')
@click.pass_context
def main_group(ctx, verbose, quiet, access_token):
    """This is the command line interface to Mapbox web services.

    Mapbox web services require an access token. Your token is shown
    on the https://www.mapbox.com/developers/api/ page when you are
    logged in. The token can be provided on the command line

      $ mbx --access-token MY_TOKEN ...

    or as an environment variable named MAPBOX_ACCESS_TOKEN or 
    MapboxAccessToken.