simplestmaps 1.7.1__tar.gz → 1.7.2__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.
@@ -0,0 +1,160 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
@@ -0,0 +1,59 @@
1
+ # v1.7.2
2
+
3
+ - New "tiles_key" argument to be able to specify map providers API keys.
4
+
5
+ # v1.7.1
6
+
7
+ - Change default tiles to OpenStreetMap tiles, since the previous one now requires an API key to work.
8
+
9
+ # v1.7.0
10
+
11
+ - Add native support for Position objects from Orbit-predictor.
12
+
13
+ # v1.6.0
14
+
15
+ - Add support for multi polygons inside geojsons.
16
+
17
+ # v1.5.0
18
+
19
+ - No more _set helpers to work with element sets! (including internal refactor for readability)
20
+
21
+ # v1.4.0
22
+
23
+ - Added support for Telluric geo features and geo vectors out of the box!
24
+ - Fix: when converting sequences of coordinates, if the result is another type of object that needs
25
+ to be converted, keep converting them.
26
+ - Fix: suppport older versions of shapely in which geometries can't be imported from the root
27
+ package.
28
+ - Fix: custom coordinates sequence objects that evaluate to False when treated as booleans, should
29
+ still be converted.
30
+
31
+ # v1.3.0
32
+
33
+ - Added suppport for Shapely geometries out of the box!
34
+ - Fix: custom coordinates objects was broken for coordinates sequences in the "_set" helpers.
35
+
36
+ # v1.2.0
37
+
38
+ - Added feature to automatically convert custom types of objects to coordinates or sequences of
39
+ coordinates, with the function `auto_convert`.
40
+ - More docs about the auto conversion and map customization features.
41
+ - Some internal small refactors for code reuse and readability.
42
+
43
+ # v1.1.0
44
+
45
+ - Added support for element sets with the new helpers: marker_set, dot_set, label_set, html_set,
46
+ line_set, area_set and geojson_set.
47
+ - New and improved docs and examples.
48
+
49
+ # v1.0.2
50
+
51
+ - Hotfix: support for custom coordinates objects with known attributes was broken.
52
+
53
+ # v1.0.1
54
+
55
+ - Hotfix: package description was broken in PyPI.
56
+
57
+ # v1.0.0
58
+
59
+ - Initial version! Markers, dots, labels, htmls, areas, lines and geojsons supported.
@@ -1,30 +1,21 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: simplestmaps
3
- Version: 1.7.1
3
+ Version: 1.7.2
4
4
  Summary: Super simple on-liner maps in python.
5
- Home-page: http://github.com/fisadev/simplestmaps
6
- Author: Juan Pedro Fisanotti
7
- Author-email: fisadev@gmail.com
8
- License: MIT
5
+ Project-URL: Homepage, http://github.com/fisadev/simplestmaps
6
+ Project-URL: Documentation, https://simplestmaps.fisadev.com/
7
+ Author-email: Juan Pedro Fisanotti <fisadev@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
9
10
  Classifier: Intended Audience :: Developers
10
- Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Natural Language :: English
12
12
  Classifier: Operating System :: OS Independent
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
+ Requires-Python: >=3.8
16
+ Requires-Dist: folium>=0.15.0
17
+ Requires-Dist: xyzservices
15
18
  Description-Content-Type: text/markdown
16
- License-File: LICENSE
17
- Requires-Dist: folium>=0.14.0
18
- Dynamic: author
19
- Dynamic: author-email
20
- Dynamic: classifier
21
- Dynamic: description
22
- Dynamic: description-content-type
23
- Dynamic: home-page
24
- Dynamic: license
25
- Dynamic: license-file
26
- Dynamic: requires-dist
27
- Dynamic: summary
28
19
 
29
20
  # Simplest Maps
30
21
 
@@ -70,3 +61,7 @@ And every element plotted into the map is also customizable (colors, fonts, size
70
61
  Here are a good set of examples that showcase (and document) all of the supported features:
71
62
 
72
63
  ## [Take a look at everything that's possible with so little code!](https://simplestmaps.fisadev.com/)
64
+
65
+ # Development
66
+
67
+ The project uses [uv](https://docs.astral.sh/uv/). Run `uv sync` to create the virtualenv with all the dev dependencies, `make build_docs` to rebuild the docs, and `make release` to build and publish a new version to PyPI.
@@ -42,3 +42,7 @@ And every element plotted into the map is also customizable (colors, fonts, size
42
42
  Here are a good set of examples that showcase (and document) all of the supported features:
43
43
 
44
44
  ## [Take a look at everything that's possible with so little code!](https://simplestmaps.fisadev.com/)
45
+
46
+ # Development
47
+
48
+ The project uses [uv](https://docs.astral.sh/uv/). Run `uv sync` to create the virtualenv with all the dev dependencies, `make build_docs` to rebuild the docs, and `make release` to build and publish a new version to PyPI.
@@ -0,0 +1,39 @@
1
+ [project]
2
+ name = "simplestmaps"
3
+ version = "1.7.2"
4
+ description = "Super simple on-liner maps in python."
5
+ readme = "README.md"
6
+ license = "MIT"
7
+ license-files = ["LICENSE"]
8
+ authors = [{ name = "Juan Pedro Fisanotti", email = "fisadev@gmail.com" }]
9
+ requires-python = ">=3.8"
10
+ dependencies = ["folium>=0.15.0", "xyzservices"]
11
+ classifiers = [
12
+ "Intended Audience :: Developers",
13
+ "Natural Language :: English",
14
+ "Operating System :: OS Independent",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ ]
18
+
19
+ [project.urls]
20
+ Homepage = "http://github.com/fisadev/simplestmaps"
21
+ Documentation = "https://simplestmaps.fisadev.com/"
22
+
23
+ [dependency-groups]
24
+ dev = [
25
+ "jupyter",
26
+ "nbconvert",
27
+ "ipykernel",
28
+ "shapely",
29
+ ]
30
+
31
+ [build-system]
32
+ requires = ["hatchling>=1.27"]
33
+ build-backend = "hatchling.build"
34
+
35
+ [tool.hatch.build.targets.wheel]
36
+ only-include = ["simplestmaps.py"]
37
+
38
+ [tool.hatch.build.targets.sdist]
39
+ only-include = ["simplestmaps.py", "README.md", "LICENSE", "CHANGELOG"]
@@ -5,6 +5,7 @@ from types import GeneratorType
5
5
  import json
6
6
 
7
7
  import folium
8
+ import xyzservices
8
9
 
9
10
 
10
11
  Point = namedtuple("Point", "lat lon")
@@ -307,15 +308,24 @@ def geojson(path_or_data, points_as=marker, lines_as=line, areas_as=area):
307
308
  )
308
309
 
309
310
 
310
- def draw_map(*things, center=(0, 0), zoom=1.5, tiles="OpenStreetMap"):
311
+ def draw_map(*things, center=(0, 0), zoom=1.5, tiles="OpenStreetMap", tiles_key=None):
311
312
  """
312
313
  Draw a simple map with elements on it.
313
314
 
315
+ Some tile providers (like "CartoDB.Positron") require an API key, which can be specified with
316
+ tiles_key.
317
+
314
318
  More info on tiles:
315
319
  https://python-visualization.github.io/folium/latest/user_guide/raster_layers/tiles.html
316
320
  """
317
321
  center = to_points(center)
318
322
 
323
+ if tiles_key:
324
+ tiles = xyzservices.providers.query_name(tiles)
325
+ # each provider names its key field differently (apikey, key, accessToken, ...)
326
+ tiles = tiles(**{field: tiles_key for field, value in tiles.items()
327
+ if isinstance(value, str) and value.startswith("<insert your")})
328
+
319
329
  map_ = folium.Map(location=(center.lat, center.lon), zoom_start=zoom, attr=".", tiles=tiles)
320
330
 
321
331
  # consume all the things to display, and use inverted order so the user can easily understand
@@ -1,72 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: simplestmaps
3
- Version: 1.7.1
4
- Summary: Super simple on-liner maps in python.
5
- Home-page: http://github.com/fisadev/simplestmaps
6
- Author: Juan Pedro Fisanotti
7
- Author-email: fisadev@gmail.com
8
- License: MIT
9
- Classifier: Intended Audience :: Developers
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Natural Language :: English
12
- Classifier: Operating System :: OS Independent
13
- Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3
15
- Description-Content-Type: text/markdown
16
- License-File: LICENSE
17
- Requires-Dist: folium>=0.14.0
18
- Dynamic: author
19
- Dynamic: author-email
20
- Dynamic: classifier
21
- Dynamic: description
22
- Dynamic: description-content-type
23
- Dynamic: home-page
24
- Dynamic: license
25
- Dynamic: license-file
26
- Dynamic: requires-dist
27
- Dynamic: summary
28
-
29
- # Simplest Maps
30
-
31
- Super simple on-liner maps in python.
32
-
33
- # Installation
34
-
35
- `pip3 install simplestmaps`
36
-
37
- # Usage
38
-
39
- This lib aims to be super simple to use. For instance, to draw a markers and an area, you could do something like this:
40
-
41
- ```python
42
- from simplestmaps import draw_map, area, marker
43
-
44
- draw_map(
45
- marker(-31.2526, -61.4917, popup="my hometown"),
46
- area([(-31.2741, -61.5105), (-31.2872, -61.5137), (-31.2895, -61.5003), (-31.2764, -61.4973)], color="green", popup="our airfield"),
47
- )
48
- ```
49
-
50
- ![example map](./docs/readme_example1.png)
51
-
52
- It can even do more advanced stuff, like plotting the contents of a geojson file (points, areas, lines):
53
-
54
- ```python
55
- from simplestmaps import draw_map, geojson
56
-
57
- draw_map(
58
- geojson("./docs/readme_example.geojson"),
59
- )
60
- ```
61
-
62
- ![example map](./docs/readme_example2.png)
63
-
64
- SimplestMaps can plot markers, dots, labels (text), custom html, lines, areas and geojsons, and all of that can be combined in every map.
65
-
66
- And every element plotted into the map is also customizable (colors, fonts, sizes, popups, etc).
67
-
68
- # More demos and docs
69
-
70
- Here are a good set of examples that showcase (and document) all of the supported features:
71
-
72
- ## [Take a look at everything that's possible with so little code!](https://simplestmaps.fisadev.com/)
@@ -1,4 +0,0 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
@@ -1,24 +0,0 @@
1
- from setuptools import setup
2
-
3
-
4
- setup(
5
- name="simplestmaps",
6
- version="1.7.1",
7
- description="Super simple on-liner maps in python.",
8
- long_description=open("README.md").read(),
9
- long_description_content_type="text/markdown",
10
- author="Juan Pedro Fisanotti",
11
- author_email="fisadev@gmail.com",
12
- url="http://github.com/fisadev/simplestmaps",
13
- py_modules=["simplestmaps"],
14
- license="MIT",
15
- install_requires=["folium>=0.14.0"],
16
- classifiers=[
17
- "Intended Audience :: Developers",
18
- "License :: OSI Approved :: MIT License",
19
- "Natural Language :: English",
20
- "Operating System :: OS Independent",
21
- "Programming Language :: Python",
22
- "Programming Language :: Python :: 3",
23
- ],
24
- )
@@ -1,9 +0,0 @@
1
- LICENSE
2
- README.md
3
- setup.py
4
- simplestmaps.py
5
- simplestmaps.egg-info/PKG-INFO
6
- simplestmaps.egg-info/SOURCES.txt
7
- simplestmaps.egg-info/dependency_links.txt
8
- simplestmaps.egg-info/requires.txt
9
- simplestmaps.egg-info/top_level.txt
@@ -1 +0,0 @@
1
- folium>=0.14.0
@@ -1 +0,0 @@
1
- simplestmaps
File without changes