예제 #1
0
#!/usr/bin/python
# coding: utf8

from __future__ import absolute_import

import click
import json
import geocoder
import os
import fileinput

from geocoder.api import options


providers = sorted(options.keys())
methods = ['geocode', 'reverse', 'elevation', 'timezone', 'places']
outputs = ['json', 'osm', 'geojson', 'wkt']
units = ['kilometers', 'miles', 'feet', 'meters']


@click.command()
@click.argument('location', nargs=-1)
@click.option('--provider', '-p', default='osm', type=click.Choice(providers))
@click.option('--method', '-m', default='geocode', type=click.Choice(methods))
@click.option('--output', '-o', default='json', type=click.Choice(outputs))
@click.option('--units', '-u', default='kilometers', type=click.Choice(units))
@click.option('--timeout', '-t', default=5.0)
@click.option('--distance', is_flag=True)
@click.option('--language', default='')
@click.option('--url', default='')
@click.option('--proxies')
예제 #2
0
파일: cli.py 프로젝트: pycat/geocoder
#!/usr/bin/python
# coding: utf8

from __future__ import absolute_import
import click
import json
import geocoder
import os
import fileinput
from geocoder.api import options


providers = options.keys()
methods = ['geocode', 'reverse', 'elevation', 'timezone']
outputs = ['json', 'osm', 'geojson', 'wkt']
units = ['kilometers', 'miles', 'feet', 'meters']


@click.command()
@click.argument('location', nargs=-1)
@click.option('--provider', '-p', default='osm', type=click.Choice(providers))
@click.option('--method', '-m', default='geocode', type=click.Choice(methods))
@click.option('--output', '-o', default='json', type=click.Choice(outputs))
@click.option('--units', '-u', default='kilometers', type=click.Choice(units))
@click.option('--distance', is_flag=True)
@click.option('--url', default='')
@click.option('--key')
def cli(location, **kwargs):
    "Geocode an arbitrary number of strings from Command Line."

    locations = []
예제 #3
0
#!/usr/bin/python
# coding: utf8

from __future__ import absolute_import
import click
import json
import geocoder
import os
import fileinput
from geocoder.api import options

providers = options.keys()
methods = ['geocode', 'reverse', 'elevation', 'timezone']
outputs = ['json', 'osm', 'geojson', 'wkt']
units = ['kilometers', 'miles', 'feet', 'meters']


@click.command()
@click.argument('location', nargs=-1)
@click.option('--provider', '-p', default='osm', type=click.Choice(providers))
@click.option('--method', '-m', default='geocode', type=click.Choice(methods))
@click.option('--output', '-o', default='json', type=click.Choice(outputs))
@click.option('--units', '-u', default='kilometers', type=click.Choice(units))
@click.option('--timeout', '-t', default=5.0)
@click.option('--distance', is_flag=True)
@click.option('--url', default='')
@click.option('--proxies')
@click.option('--key')
def cli(location, **kwargs):
    "Geocode an arbitrary number of strings from Command Line."