here-search-demo 0.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- here-search-demo-0.8.0/LICENSE +22 -0
- here-search-demo-0.8.0/MANIFEST.in +6 -0
- here-search-demo-0.8.0/PKG-INFO +68 -0
- here-search-demo-0.8.0/README.md +47 -0
- here-search-demo-0.8.0/docs/developers.md +123 -0
- here-search-demo-0.8.0/docs/screenshot.png +0 -0
- here-search-demo-0.8.0/pyproject.toml +6 -0
- here-search-demo-0.8.0/requirements/build.txt +20 -0
- here-search-demo-0.8.0/requirements/lite_run.txt +6 -0
- here-search-demo-0.8.0/requirements/test.txt +5 -0
- here-search-demo-0.8.0/requirements/util.txt +3 -0
- here-search-demo-0.8.0/setup.cfg +47 -0
- here-search-demo-0.8.0/setup.py +13 -0
- here-search-demo-0.8.0/src/here_search/demo/__init__.py +10 -0
- here-search-demo-0.8.0/src/here_search/demo/api.py +304 -0
- here-search-demo-0.8.0/src/here_search/demo/api_options.py +50 -0
- here-search-demo-0.8.0/src/here_search/demo/base.py +256 -0
- here-search-demo-0.8.0/src/here_search/demo/entity/__init__.py +0 -0
- here-search-demo-0.8.0/src/here_search/demo/entity/constants.py +12 -0
- here-search-demo-0.8.0/src/here_search/demo/entity/endpoint.py +82 -0
- here-search-demo-0.8.0/src/here_search/demo/entity/intent.py +49 -0
- here-search-demo-0.8.0/src/here_search/demo/entity/place.py +68 -0
- here-search-demo-0.8.0/src/here_search/demo/entity/request.py +159 -0
- here-search-demo-0.8.0/src/here_search/demo/event.py +210 -0
- here-search-demo-0.8.0/src/here_search/demo/http.py +13 -0
- here-search-demo-0.8.0/src/here_search/demo/lite.py +153 -0
- here-search-demo-0.8.0/src/here_search/demo/scripts/here-search-notebooks +14 -0
- here-search-demo-0.8.0/src/here_search/demo/scripts/lite-run.sh +43 -0
- here-search-demo-0.8.0/src/here_search/demo/user.py +119 -0
- here-search-demo-0.8.0/src/here_search/demo/util.py +57 -0
- here-search-demo-0.8.0/src/here_search/demo/widgets/__init__.py +0 -0
- here-search-demo-0.8.0/src/here_search/demo/widgets/app.py +170 -0
- here-search-demo-0.8.0/src/here_search/demo/widgets/input.py +294 -0
- here-search-demo-0.8.0/src/here_search/demo/widgets/output.py +255 -0
- here-search-demo-0.8.0/src/here_search/demo/widgets/util.py +125 -0
- here-search-demo-0.8.0/src/here_search_demo.egg-info/PKG-INFO +68 -0
- here-search-demo-0.8.0/src/here_search_demo.egg-info/SOURCES.txt +44 -0
- here-search-demo-0.8.0/src/here_search_demo.egg-info/dependency_links.txt +1 -0
- here-search-demo-0.8.0/src/here_search_demo.egg-info/not-zip-safe +1 -0
- here-search-demo-0.8.0/src/here_search_demo.egg-info/requires.txt +20 -0
- here-search-demo-0.8.0/src/here_search_demo.egg-info/top_level.txt +1 -0
- here-search-demo-0.8.0/tests/test_api.py +174 -0
- here-search-demo-0.8.0/tests/test_base.py +188 -0
- here-search-demo-0.8.0/tests/test_entities.py +89 -0
- here-search-demo-0.8.0/tests/test_util.py +41 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (C) 2023 HERE Europe B.V.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: here-search-demo
|
|
3
|
+
Version: 0.8.0
|
|
4
|
+
Summary: HERE Geocoding and Search demo and widgets
|
|
5
|
+
Home-page: https://here.com
|
|
6
|
+
Author: HERE Europe B.V.
|
|
7
|
+
Author-email: emmanuel.decitre@here.com
|
|
8
|
+
License: The MIT License
|
|
9
|
+
Keywords: HERE,Search,Ipywidgets,GS7
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Requires-Python: >=3.8
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
|
|
22
|
+
[](https://github.com/heremaps/here-search-demo/actions/workflows/test.yml)
|
|
23
|
+
[](https://codecov.io/gh/heremaps/here-search-demo)
|
|
24
|
+
|
|
25
|
+
# HERE Search notebooks
|
|
26
|
+
|
|
27
|
+
A set of jupyter notebooks demonstrating the use of HERE Geocoding & Search endpoints `/autosuggest`, `/discover`, `/browse`, and `/lookup`.
|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
Requirements: a [HERE API key][1] and a Python environment.
|
|
32
|
+
|
|
33
|
+
The notebooks can be [used in your browser][3] without further installation.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
If you need to install the notebooks or the underlying library on your workstation, run preferably in a virtual environment:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
pip -v install here-search-demo
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Link the virtual environment to a IPython kernel:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
python -m ipykernel install \
|
|
47
|
+
--prefix $(python -c "import sys; print(sys.prefix)") \
|
|
48
|
+
--name search_demo --display-name "search demo"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
Use the `here-search-notebooks` script with your HERE API Key:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
API_KEY="your API key" here-search-notebooks
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
(More [details][2])
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
Copyright (C) 2022-2023 HERE Europe B.V.
|
|
63
|
+
|
|
64
|
+
This project is licensed under the MIT license - see the [LICENSE](./LICENSE) file in the root of this project for license details.
|
|
65
|
+
|
|
66
|
+
[1]: https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/quick-start-dhc.html#get-an-api-key
|
|
67
|
+
[2]: docs/developers.md#setup-a-notebook-python-environment
|
|
68
|
+
[3]: https://heremaps.github.io/here-search-demo/lab/?path=demo.ipynb
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[](https://github.com/heremaps/here-search-demo/actions/workflows/test.yml)
|
|
2
|
+
[](https://codecov.io/gh/heremaps/here-search-demo)
|
|
3
|
+
|
|
4
|
+
# HERE Search notebooks
|
|
5
|
+
|
|
6
|
+
A set of jupyter notebooks demonstrating the use of HERE Geocoding & Search endpoints `/autosuggest`, `/discover`, `/browse`, and `/lookup`.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
Requirements: a [HERE API key][1] and a Python environment.
|
|
11
|
+
|
|
12
|
+
The notebooks can be [used in your browser][3] without further installation.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
If you need to install the notebooks or the underlying library on your workstation, run preferably in a virtual environment:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
pip -v install here-search-demo
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Link the virtual environment to a IPython kernel:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
python -m ipykernel install \
|
|
26
|
+
--prefix $(python -c "import sys; print(sys.prefix)") \
|
|
27
|
+
--name search_demo --display-name "search demo"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Use the `here-search-notebooks` script with your HERE API Key:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
API_KEY="your API key" here-search-notebooks
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
(More [details][2])
|
|
38
|
+
|
|
39
|
+
## License
|
|
40
|
+
|
|
41
|
+
Copyright (C) 2022-2023 HERE Europe B.V.
|
|
42
|
+
|
|
43
|
+
This project is licensed under the MIT license - see the [LICENSE](./LICENSE) file in the root of this project for license details.
|
|
44
|
+
|
|
45
|
+
[1]: https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/quick-start-dhc.html#get-an-api-key
|
|
46
|
+
[2]: docs/developers.md#setup-a-notebook-python-environment
|
|
47
|
+
[3]: https://heremaps.github.io/here-search-demo/lab/?path=demo.ipynb
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
## Developer notes
|
|
2
|
+
|
|
3
|
+
### Setup a Notebook Python environment
|
|
4
|
+
|
|
5
|
+
It is recommended to use a Python virtual environment. The below recipe uses the python batteries `venv` module.
|
|
6
|
+
It has only been tested on a Macos Monterey machine, but it should not be too difficult to use it on another Unix-like workstation.
|
|
7
|
+
|
|
8
|
+
1. Virtual environment
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
mkdir -p ~/virtualenv; (cd ~/virtualenv; python -m venv search-notebook)
|
|
12
|
+
source ~/virtualenv/search-notebook/bin/activate
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. Download and install
|
|
16
|
+
|
|
17
|
+
For users:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
pip -v install here-search-demo
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For contributors/developers:
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
git clone git@github.com:heremaps/here-search-demo.git
|
|
27
|
+
cd search-notebook-ext
|
|
28
|
+
pip install -e .
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
3. Jupyter config
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
python -m ipykernel install --user --name search_demo --display-name "search demo"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
To run the notebook on Jupyter Classic, you will need:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
jupyter nbextension enable --py widgetsnbextension
|
|
41
|
+
jupyter labextension install @jupyterlab/geojson-extension
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Upload a new package to a pypa repository
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
pip install -r requirements/util.txt
|
|
48
|
+
python -m build --sdist --wheel
|
|
49
|
+
twine upload dist/*
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Test on MacOS / python3.7
|
|
53
|
+
|
|
54
|
+
1. Build Python 3.7.9 for `pyenv`
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
brew install zlib bzip2 openssl@1.1 readline xz
|
|
58
|
+
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include"
|
|
59
|
+
LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib"
|
|
60
|
+
pyenv install 3.7.9
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
2. Create virtual environment
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
pyenv virtualenv 3.7.9 venv3.7
|
|
67
|
+
pyenv activate venv3.7
|
|
68
|
+
pyenv local venv3.7 && python -V
|
|
69
|
+
pip install -e .
|
|
70
|
+
pip install -r requirements_dev.txt
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### JupyterLite
|
|
74
|
+
|
|
75
|
+
[JupyterLite](https://jupyterlite.readthedocs.io/en/latest/) is a JupyterLab distribution that runs entirely in the browser.
|
|
76
|
+
The Python kernels are backed by [`Pyodide`](https://pyodide.org/en/stable/) running in a Web Worker.
|
|
77
|
+
|
|
78
|
+
Pyodide can not be used outside a browser. But for development purposes (type hints), it is advised to
|
|
79
|
+
install its [`py`](https://github.com/pyodide/pyodide/tree/main/src/py) package into the venv used for `search-notebook-ext`
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
git clone git@github.com:pyodide/pyodide.git
|
|
83
|
+
cd pyodide/src/py
|
|
84
|
+
pip install -e .
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
For the Pyodide kernels to be able to use certain packages, those need to be installed from the notebook itself:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
try:
|
|
91
|
+
import piplite
|
|
92
|
+
await piplite.install(["ipywidgets==7.7.1", "ipyleaflet==0.17.1", "emfs:here_search_widget-0.6.1-py3-none-any.whl"], keep_going=True)
|
|
93
|
+
except ImportError:
|
|
94
|
+
pass
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
#### From a local git clone
|
|
98
|
+
|
|
99
|
+
To test the jupyterlite page locally, run from the local git repository:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
$(find . -name "lite_run.sh")
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Option `-n` only builds the page and does not serve it.
|
|
106
|
+
|
|
107
|
+
A way to get the sources without git cloning the project is to use the source distribution:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
pip install --upgrade pip
|
|
111
|
+
pip download here-search-demo --no-deps --no-binary ":all:"
|
|
112
|
+
|
|
113
|
+
tar xpfz $(find . -name "*.tar.gz")
|
|
114
|
+
|
|
115
|
+
$(find . -name "lite_run.sh")
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Inject a lat/lon using geojs.io
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
from here_search.demo.util import get_lat_lon
|
|
122
|
+
latitude, longitude = await get_lat_lon()
|
|
123
|
+
```
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
aiohttp==3.8.3
|
|
2
|
+
argon2-cffi-bindings==21.2.0
|
|
3
|
+
debugpy==1.6.3
|
|
4
|
+
ipykernel==6.18.0
|
|
5
|
+
ipyleaflet==0.17.1
|
|
6
|
+
ipython-genutils==0.2.0
|
|
7
|
+
ipython==8.6.0
|
|
8
|
+
ipywidgets==7.7.2
|
|
9
|
+
jupyter-client==7.4.7
|
|
10
|
+
jupyter-server==1.23.3
|
|
11
|
+
jupyterlab==3.5.0
|
|
12
|
+
comm==0.1.2
|
|
13
|
+
jupyterlab-server==2.19.0
|
|
14
|
+
notebook-shim==0.2.2
|
|
15
|
+
nbclassic==0.4.8
|
|
16
|
+
nbconvert==7.2.5
|
|
17
|
+
nbformat==5.7.0
|
|
18
|
+
pygments==2.13.0
|
|
19
|
+
pyzmq==24.0.1
|
|
20
|
+
xyzservices==2022.9.0
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[metadata]
|
|
2
|
+
name = here-search-demo
|
|
3
|
+
version = attr: here_search.demo.__version__
|
|
4
|
+
author = HERE Europe B.V.
|
|
5
|
+
author_email = emmanuel.decitre@here.com
|
|
6
|
+
url = https://here.com
|
|
7
|
+
home_page = https://github.com/heremaps/here-search-demo
|
|
8
|
+
description = HERE Geocoding and Search demo and widgets
|
|
9
|
+
long_description = file: README.md
|
|
10
|
+
long_description_content_type = text/markdown
|
|
11
|
+
license = The MIT License
|
|
12
|
+
license_files =
|
|
13
|
+
LICENSE
|
|
14
|
+
keywords = HERE, Search, Ipywidgets, GS7
|
|
15
|
+
classifiers =
|
|
16
|
+
Development Status :: 4 - Beta
|
|
17
|
+
Intended Audience :: Developers
|
|
18
|
+
Programming Language :: Python :: 3
|
|
19
|
+
Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Programming Language :: Python :: 3.8
|
|
21
|
+
Programming Language :: Python :: 3.9
|
|
22
|
+
Programming Language :: Python :: 3.10
|
|
23
|
+
License :: OSI Approved :: MIT License
|
|
24
|
+
|
|
25
|
+
[options]
|
|
26
|
+
zip_safe = False
|
|
27
|
+
python_requires = >=3.8
|
|
28
|
+
package_dir =
|
|
29
|
+
= src
|
|
30
|
+
scripts =
|
|
31
|
+
src/here_search/demo/scripts/here-search-notebooks
|
|
32
|
+
src/here_search/demo/scripts/lite-run.sh
|
|
33
|
+
install_requires = file: requirements/build.txt
|
|
34
|
+
|
|
35
|
+
[options.packages.find]
|
|
36
|
+
where = src
|
|
37
|
+
|
|
38
|
+
[options.package_data]
|
|
39
|
+
here_search.notebooks =
|
|
40
|
+
*.ipynb
|
|
41
|
+
* =
|
|
42
|
+
requirements/*.txt; setup.py; setup.cfg; pyproject.toml
|
|
43
|
+
|
|
44
|
+
[egg_info]
|
|
45
|
+
tag_build =
|
|
46
|
+
tag_date = 0
|
|
47
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2023 HERE Europe B.V.
|
|
4
|
+
#
|
|
5
|
+
# SPDX-License-Identifier: MIT
|
|
6
|
+
# License-Filename: LICENSE
|
|
7
|
+
#
|
|
8
|
+
###############################################################################
|
|
9
|
+
|
|
10
|
+
from setuptools import setup
|
|
11
|
+
|
|
12
|
+
if __name__ == "__main__":
|
|
13
|
+
setup()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
###############################################################################
|
|
2
|
+
#
|
|
3
|
+
# Copyright (c) 2023 HERE Europe B.V.
|
|
4
|
+
#
|
|
5
|
+
# SPDX-License-Identifier: MIT
|
|
6
|
+
# License-Filename: LICENSE
|
|
7
|
+
#
|
|
8
|
+
###############################################################################
|
|
9
|
+
|
|
10
|
+
__version__ = "0.8.0"
|