summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-25 14:23:54 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-25 14:23:54 +0000
commit1acd2783a7e491dd1adfaa8ab9b785ab4b431f40 (patch)
treed39f91531418a64543b162988a36fab19621f101
parent88c09502b85f6fb898a0597d741186e2efccc9ed (diff)
automatic import of python-opencageopeneuler20.03
-rw-r--r--.gitignore1
-rw-r--r--python-opencage.spec125
-rw-r--r--sources2
3 files changed, 75 insertions, 53 deletions
diff --git a/.gitignore b/.gitignore
index 8c80bc9..bebd506 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/opencage-2.1.0.tar.gz
+/opencage-2.1.1.tar.gz
diff --git a/python-opencage.spec b/python-opencage.spec
index e84b9d1..712be41 100644
--- a/python-opencage.spec
+++ b/python-opencage.spec
@@ -1,11 +1,11 @@
%global _empty_manifest_terminate_build 0
Name: python-opencage
-Version: 2.1.0
+Version: 2.1.1
Release: 1
Summary: Wrapper module for the OpenCage Geocoder API
License: BSD
URL: https://github.com/OpenCageData/python-opencage-geocoder/
-Source0: https://mirrors.nju.edu.cn/pypi/web/packages/9f/13/52582c31e9f35085452b7eab8ab7f759b5efda956158d1888d57400f91cd/opencage-2.1.0.tar.gz
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/49/fb/2c9a1c04226e6fdc98aa06e9304f2e4173d006d3f1d73729747256a2efb3/opencage-2.1.1.tar.gz
BuildArch: noarch
Requires: python3-Requests
@@ -25,11 +25,15 @@ A Python module to access the [OpenCage Geocoding API](https://opencagedata.com/
[![Versions](https://img.shields.io/pypi/pyversions/opencage)](https://pypi.org/project/opencage/)
![GitHub contributors](https://img.shields.io/github/contributors/opencagedata/python-opencage-geocoder)
[![Build Status](https://travis-ci.com/OpenCageData/python-opencage-geocoder.svg?branch=master)](https://travis-ci.com/OpenCageData/python-opencage-geocoder)
-[![Twitter Follow](https://img.shields.io/twitter/follow/OpenCage?label=Follow%20OpenCage&style=social)](https://twitter.com/opencage)
+![Mastodon Follow](https://img.shields.io/mastodon/follow/109287663468501769?domain=https%3A%2F%2Fen.osm.town%2F&style=social)
+
+## Tutorial
+
+You can find a [comprehensive tutorial for using this module on the OpenCage site](https://opencagedata.com/tutorials/geocode-in-python).
## Usage
-Supports Python 3.6 or newer. Use the older opencage 1.x releases if you need Python 2.7 support.
+Supports Python 3.7 or newer. Use the older opencage 1.x releases if you need Python 2.7 support.
Install the module:
@@ -51,24 +55,24 @@ key = 'your-api-key-here'
geocoder = OpenCageGeocode(key)
```
-Pass a string containing the query or address to be geocoded to the modules's `geocode` method:
+Pass a string containing the query or address to be geocoded to the modules' `geocode` method:
```python
-query = "82 Clerkenwell Road, London"
-result = geocoder.geocode(query)
+query = '82 Clerkenwell Road, London'
+results = geocoder.geocode(query)
```
-You can add [additional parameters](https://opencagedata.com/api#forward):
+You can add [additional parameters](https://opencagedata.com/api#forward-opt):
```python
-result = geocoder.geocode('London', no_annotations=1, language='es')
+results = geocoder.geocode('London', no_annotations=1, language='es')
```
-You can use the proximity parameter to provide the geocoder with a hint:
+For example you can use the proximity parameter to provide the geocoder with a hint:
```python
-result = geocoder.geocode('London', proximity='42.828576, -81.406643')
-print(result[0]['formatted'])
+results = geocoder.geocode('London', proximity='42.828576, -81.406643')
+print(results[0]['formatted'])
# u'London, ON N6A 3M8, Canada'
```
@@ -78,7 +82,7 @@ print(result[0]['formatted'])
Turn a lat/long into an address with the ``reverse_geocode`` method:
```python
-results = geocoder.reverse_geocode(51.51024, -0.10303)
+result = geocoder.reverse_geocode(51.51024, -0.10303)
```
### Sessions
@@ -94,7 +98,7 @@ with OpenCageGeocode(key) as geocoder:
results = [geocoder.geocode(query) for query in queries]
```
-### Asycronous requests
+### Asyncronous requests
You can run requests in parallel with the `geocode_async` and `reverse_geocode_async`
method which have the same parameters and response as their synronous counterparts.
@@ -105,15 +109,18 @@ async with OpenCageGeocode(key) as geocoder:
results = await geocoder.geocode_async(address)
```
-For a more complete example and links to futher tutorials on asycronous IO see
+For a more complete example and links to futher tutorials on asyncronous IO see
`batch.py` in the `examples` directory.
### Exceptions
If anything goes wrong, then an exception will be raised:
- * ``InvalidInputError`` for non-unicode query strings
- * ``UnknownError`` if there's some problem with the API (bad results, 500 status code, etc)
- * ``RateLimitExceededError`` if you go past your rate limit
+
+ * `InvalidInputError` for non-unicode query strings
+ * `NotAuthorizedError` if API key is missing, invalid syntax or disabled
+ * `ForbiddenError` API key is blocked or suspended
+ * `RateLimitExceededError` if you go past your rate limit
+ * `UnknownError` if there's some problem with the API (bad results, 500 status code, etc)
## Copyright & License
@@ -150,11 +157,15 @@ A Python module to access the [OpenCage Geocoding API](https://opencagedata.com/
[![Versions](https://img.shields.io/pypi/pyversions/opencage)](https://pypi.org/project/opencage/)
![GitHub contributors](https://img.shields.io/github/contributors/opencagedata/python-opencage-geocoder)
[![Build Status](https://travis-ci.com/OpenCageData/python-opencage-geocoder.svg?branch=master)](https://travis-ci.com/OpenCageData/python-opencage-geocoder)
-[![Twitter Follow](https://img.shields.io/twitter/follow/OpenCage?label=Follow%20OpenCage&style=social)](https://twitter.com/opencage)
+![Mastodon Follow](https://img.shields.io/mastodon/follow/109287663468501769?domain=https%3A%2F%2Fen.osm.town%2F&style=social)
+
+## Tutorial
+
+You can find a [comprehensive tutorial for using this module on the OpenCage site](https://opencagedata.com/tutorials/geocode-in-python).
## Usage
-Supports Python 3.6 or newer. Use the older opencage 1.x releases if you need Python 2.7 support.
+Supports Python 3.7 or newer. Use the older opencage 1.x releases if you need Python 2.7 support.
Install the module:
@@ -176,24 +187,24 @@ key = 'your-api-key-here'
geocoder = OpenCageGeocode(key)
```
-Pass a string containing the query or address to be geocoded to the modules's `geocode` method:
+Pass a string containing the query or address to be geocoded to the modules' `geocode` method:
```python
-query = "82 Clerkenwell Road, London"
-result = geocoder.geocode(query)
+query = '82 Clerkenwell Road, London'
+results = geocoder.geocode(query)
```
-You can add [additional parameters](https://opencagedata.com/api#forward):
+You can add [additional parameters](https://opencagedata.com/api#forward-opt):
```python
-result = geocoder.geocode('London', no_annotations=1, language='es')
+results = geocoder.geocode('London', no_annotations=1, language='es')
```
-You can use the proximity parameter to provide the geocoder with a hint:
+For example you can use the proximity parameter to provide the geocoder with a hint:
```python
-result = geocoder.geocode('London', proximity='42.828576, -81.406643')
-print(result[0]['formatted'])
+results = geocoder.geocode('London', proximity='42.828576, -81.406643')
+print(results[0]['formatted'])
# u'London, ON N6A 3M8, Canada'
```
@@ -203,7 +214,7 @@ print(result[0]['formatted'])
Turn a lat/long into an address with the ``reverse_geocode`` method:
```python
-results = geocoder.reverse_geocode(51.51024, -0.10303)
+result = geocoder.reverse_geocode(51.51024, -0.10303)
```
### Sessions
@@ -219,7 +230,7 @@ with OpenCageGeocode(key) as geocoder:
results = [geocoder.geocode(query) for query in queries]
```
-### Asycronous requests
+### Asyncronous requests
You can run requests in parallel with the `geocode_async` and `reverse_geocode_async`
method which have the same parameters and response as their synronous counterparts.
@@ -230,15 +241,18 @@ async with OpenCageGeocode(key) as geocoder:
results = await geocoder.geocode_async(address)
```
-For a more complete example and links to futher tutorials on asycronous IO see
+For a more complete example and links to futher tutorials on asyncronous IO see
`batch.py` in the `examples` directory.
### Exceptions
If anything goes wrong, then an exception will be raised:
- * ``InvalidInputError`` for non-unicode query strings
- * ``UnknownError`` if there's some problem with the API (bad results, 500 status code, etc)
- * ``RateLimitExceededError`` if you go past your rate limit
+
+ * `InvalidInputError` for non-unicode query strings
+ * `NotAuthorizedError` if API key is missing, invalid syntax or disabled
+ * `ForbiddenError` API key is blocked or suspended
+ * `RateLimitExceededError` if you go past your rate limit
+ * `UnknownError` if there's some problem with the API (bad results, 500 status code, etc)
## Copyright & License
@@ -272,11 +286,15 @@ A Python module to access the [OpenCage Geocoding API](https://opencagedata.com/
[![Versions](https://img.shields.io/pypi/pyversions/opencage)](https://pypi.org/project/opencage/)
![GitHub contributors](https://img.shields.io/github/contributors/opencagedata/python-opencage-geocoder)
[![Build Status](https://travis-ci.com/OpenCageData/python-opencage-geocoder.svg?branch=master)](https://travis-ci.com/OpenCageData/python-opencage-geocoder)
-[![Twitter Follow](https://img.shields.io/twitter/follow/OpenCage?label=Follow%20OpenCage&style=social)](https://twitter.com/opencage)
+![Mastodon Follow](https://img.shields.io/mastodon/follow/109287663468501769?domain=https%3A%2F%2Fen.osm.town%2F&style=social)
+
+## Tutorial
+
+You can find a [comprehensive tutorial for using this module on the OpenCage site](https://opencagedata.com/tutorials/geocode-in-python).
## Usage
-Supports Python 3.6 or newer. Use the older opencage 1.x releases if you need Python 2.7 support.
+Supports Python 3.7 or newer. Use the older opencage 1.x releases if you need Python 2.7 support.
Install the module:
@@ -298,24 +316,24 @@ key = 'your-api-key-here'
geocoder = OpenCageGeocode(key)
```
-Pass a string containing the query or address to be geocoded to the modules's `geocode` method:
+Pass a string containing the query or address to be geocoded to the modules' `geocode` method:
```python
-query = "82 Clerkenwell Road, London"
-result = geocoder.geocode(query)
+query = '82 Clerkenwell Road, London'
+results = geocoder.geocode(query)
```
-You can add [additional parameters](https://opencagedata.com/api#forward):
+You can add [additional parameters](https://opencagedata.com/api#forward-opt):
```python
-result = geocoder.geocode('London', no_annotations=1, language='es')
+results = geocoder.geocode('London', no_annotations=1, language='es')
```
-You can use the proximity parameter to provide the geocoder with a hint:
+For example you can use the proximity parameter to provide the geocoder with a hint:
```python
-result = geocoder.geocode('London', proximity='42.828576, -81.406643')
-print(result[0]['formatted'])
+results = geocoder.geocode('London', proximity='42.828576, -81.406643')
+print(results[0]['formatted'])
# u'London, ON N6A 3M8, Canada'
```
@@ -325,7 +343,7 @@ print(result[0]['formatted'])
Turn a lat/long into an address with the ``reverse_geocode`` method:
```python
-results = geocoder.reverse_geocode(51.51024, -0.10303)
+result = geocoder.reverse_geocode(51.51024, -0.10303)
```
### Sessions
@@ -341,7 +359,7 @@ with OpenCageGeocode(key) as geocoder:
results = [geocoder.geocode(query) for query in queries]
```
-### Asycronous requests
+### Asyncronous requests
You can run requests in parallel with the `geocode_async` and `reverse_geocode_async`
method which have the same parameters and response as their synronous counterparts.
@@ -352,15 +370,18 @@ async with OpenCageGeocode(key) as geocoder:
results = await geocoder.geocode_async(address)
```
-For a more complete example and links to futher tutorials on asycronous IO see
+For a more complete example and links to futher tutorials on asyncronous IO see
`batch.py` in the `examples` directory.
### Exceptions
If anything goes wrong, then an exception will be raised:
- * ``InvalidInputError`` for non-unicode query strings
- * ``UnknownError`` if there's some problem with the API (bad results, 500 status code, etc)
- * ``RateLimitExceededError`` if you go past your rate limit
+
+ * `InvalidInputError` for non-unicode query strings
+ * `NotAuthorizedError` if API key is missing, invalid syntax or disabled
+ * `ForbiddenError` API key is blocked or suspended
+ * `RateLimitExceededError` if you go past your rate limit
+ * `UnknownError` if there's some problem with the API (bad results, 500 status code, etc)
## Copyright & License
@@ -379,7 +400,7 @@ We also run [Geomob](https://thegeomob.com), a series of regular meetups for loc
%prep
-%autosetup -n opencage-2.1.0
+%autosetup -n opencage-2.1.1
%build
%py3_build
@@ -419,5 +440,5 @@ mv %{buildroot}/doclist.lst .
%{_docdir}/*
%changelog
-* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 2.1.0-1
+* Tue Apr 25 2023 Python_Bot <Python_Bot@openeuler.org> - 2.1.1-1
- Package Spec generated
diff --git a/sources b/sources
index be70b2c..a3dfdbf 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-8400c8d13b81843fec848603f97fd08e opencage-2.1.0.tar.gz
+3f6ab06f2992f32d250e5d116f85d08e opencage-2.1.1.tar.gz