swarmauri_tool_folium 0.9.0.dev4__tar.gz → 0.9.2.dev6__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.
@@ -1,8 +1,10 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: swarmauri_tool_folium
3
- Version: 0.9.0.dev4
3
+ Version: 0.9.2.dev6
4
4
  Summary: This repository includes an example of a First Class Swarmauri Example.
5
- License: Apache-2.0
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Keywords: swarmauri,tool,folium,repository,includes,example,first,class
6
8
  Author: Jacob Stewart
7
9
  Author-email: jacob@swarmauri.com
8
10
  Requires-Python: >=3.10,<3.13
@@ -10,14 +12,17 @@ Classifier: License :: OSI Approved :: Apache Software License
10
12
  Classifier: Programming Language :: Python :: 3.10
11
13
  Classifier: Programming Language :: Python :: 3.11
12
14
  Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Natural Language :: English
16
+ Classifier: Development Status :: 3 - Alpha
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
13
19
  Requires-Dist: folium (>=0.18.0)
14
20
  Requires-Dist: swarmauri_base
15
21
  Requires-Dist: swarmauri_core
16
22
  Requires-Dist: swarmauri_standard
17
23
  Description-Content-Type: text/markdown
18
24
 
19
-
20
- ![Swamauri Logo](https://res.cloudinary.com/dbjmpekvl/image/upload/v1730099724/Swarmauri-logo-lockup-2048x757_hww01w.png)
25
+ ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
21
26
 
22
27
  <p align="center">
23
28
  <a href="https://pypi.org/project/swarmauri_tool_folium/">
@@ -36,26 +41,56 @@ Description-Content-Type: text/markdown
36
41
 
37
42
  # Swarmauri Tool Folium
38
43
 
39
- A tool to generate maps with markers using Folium.
44
+ Generates an interactive Folium map with optional markers and returns the HTML as a base64-encoded string. Designed for embedding maps in Swarmauri workflows or downstream UIs.
45
+
46
+ ## Features
47
+
48
+ - Accepts a map center `(lat, lon)` plus an optional list of markers `(lat, lon, popup)`.
49
+ - Creates a Folium map (HTML) and returns `{"image_b64": <base64-html>}`.
50
+ - Easy to extend with additional Folium layers/tiles by subclassing.
51
+
52
+ ## Prerequisites
53
+
54
+ - Python 3.10 or newer.
55
+ - [`folium`](https://python-visualization.github.io/folium/) (installed automatically).
56
+ - Network access if Folium needs to load tiles from external providers at render time.
40
57
 
41
58
  ## Installation
42
59
 
43
60
  ```bash
61
+ # pip
44
62
  pip install swarmauri_tool_folium
63
+
64
+ # poetry
65
+ poetry add swarmauri_tool_folium
66
+
67
+ # uv (pyproject-based projects)
68
+ uv add swarmauri_tool_folium
45
69
  ```
46
70
 
47
- ## Usage
48
- Basic usage examples with code snippets
71
+ ## Quickstart
72
+
49
73
  ```python
50
- from swarmauri.tools.FoliumTool import FoliumTool
74
+ import base64
75
+ from pathlib import Path
76
+ from swarmauri_tool_folium import FoliumTool
51
77
 
52
- tool = FoliumTool()
53
78
  map_center = (40.7128, -74.0060)
54
79
  markers = [(40.7128, -74.0060, "Marker 1"), (40.7328, -74.0010, "Marker 2")]
55
80
 
56
- result = tool(map_center, markers)
57
- print(result['image_b64']) # Prints the base64 string of the map image
81
+ result = FoliumTool()(map_center, markers)
82
+ html_bytes = base64.b64decode(result["image_b64"])
83
+ Path("map.html").write_bytes(html_bytes)
58
84
  ```
85
+
86
+ Open `map.html` in a browser to interact with the generated map.
87
+
88
+ ## Tips
89
+
90
+ - Customize map appearance by subclassing and adjusting `folium.Map` parameters (`tiles`, `zoom_start`, etc.).
91
+ - Add other Folium layers (heatmaps, choropleths) before saving to build richer visualizations.
92
+ - When serving maps via APIs, return the base64 string directly or write to a temporary HTML file and send its path.
93
+
59
94
  ## Want to help?
60
95
 
61
96
  If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
@@ -0,0 +1,72 @@
1
+ ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
2
+
3
+ <p align="center">
4
+ <a href="https://pypi.org/project/swarmauri_tool_folium/">
5
+ <img src="https://img.shields.io/pypi/dm/swarmauri_tool_folium" alt="PyPI - Downloads"/></a>
6
+ <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_folium/">
7
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_folium.svg"/></a>
8
+ <a href="https://pypi.org/project/swarmauri_tool_folium/">
9
+ <img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_folium" alt="PyPI - Python Version"/></a>
10
+ <a href="https://pypi.org/project/swarmauri_tool_folium/">
11
+ <img src="https://img.shields.io/pypi/l/swarmauri_tool_folium" alt="PyPI - License"/></a>
12
+ <a href="https://pypi.org/project/swarmauri_tool_folium/">
13
+ <img src="https://img.shields.io/pypi/v/swarmauri_tool_folium?label=swarmauri_tool_folium&color=green" alt="PyPI - swarmauri_tool_folium"/></a>
14
+ </p>
15
+
16
+ ---
17
+
18
+ # Swarmauri Tool Folium
19
+
20
+ Generates an interactive Folium map with optional markers and returns the HTML as a base64-encoded string. Designed for embedding maps in Swarmauri workflows or downstream UIs.
21
+
22
+ ## Features
23
+
24
+ - Accepts a map center `(lat, lon)` plus an optional list of markers `(lat, lon, popup)`.
25
+ - Creates a Folium map (HTML) and returns `{"image_b64": <base64-html>}`.
26
+ - Easy to extend with additional Folium layers/tiles by subclassing.
27
+
28
+ ## Prerequisites
29
+
30
+ - Python 3.10 or newer.
31
+ - [`folium`](https://python-visualization.github.io/folium/) (installed automatically).
32
+ - Network access if Folium needs to load tiles from external providers at render time.
33
+
34
+ ## Installation
35
+
36
+ ```bash
37
+ # pip
38
+ pip install swarmauri_tool_folium
39
+
40
+ # poetry
41
+ poetry add swarmauri_tool_folium
42
+
43
+ # uv (pyproject-based projects)
44
+ uv add swarmauri_tool_folium
45
+ ```
46
+
47
+ ## Quickstart
48
+
49
+ ```python
50
+ import base64
51
+ from pathlib import Path
52
+ from swarmauri_tool_folium import FoliumTool
53
+
54
+ map_center = (40.7128, -74.0060)
55
+ markers = [(40.7128, -74.0060, "Marker 1"), (40.7328, -74.0010, "Marker 2")]
56
+
57
+ result = FoliumTool()(map_center, markers)
58
+ html_bytes = base64.b64decode(result["image_b64"])
59
+ Path("map.html").write_bytes(html_bytes)
60
+ ```
61
+
62
+ Open `map.html` in a browser to interact with the generated map.
63
+
64
+ ## Tips
65
+
66
+ - Customize map appearance by subclassing and adjusting `folium.Map` parameters (`tiles`, `zoom_start`, etc.).
67
+ - Add other Folium layers (heatmaps, choropleths) before saving to build richer visualizations.
68
+ - When serving maps via APIs, return the base64 string directly or write to a temporary HTML file and send its path.
69
+
70
+ ## Want to help?
71
+
72
+ If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "swarmauri_tool_folium"
3
- version = "0.9.0.dev4"
3
+ version = "0.9.2.dev6"
4
4
  description = "This repository includes an example of a First Class Swarmauri Example."
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
@@ -11,6 +11,10 @@ classifiers = [
11
11
  "Programming Language :: Python :: 3.10",
12
12
  "Programming Language :: Python :: 3.11",
13
13
  "Programming Language :: Python :: 3.12",
14
+ "Natural Language :: English",
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Developers",
17
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
14
18
  ]
15
19
  authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
16
20
  dependencies = [
@@ -19,6 +23,16 @@ dependencies = [
19
23
  "swarmauri_base",
20
24
  "swarmauri_standard",
21
25
  ]
26
+ keywords = [
27
+ "swarmauri",
28
+ "tool",
29
+ "folium",
30
+ "repository",
31
+ "includes",
32
+ "example",
33
+ "first",
34
+ "class",
35
+ ]
22
36
 
23
37
  [tool.uv.sources]
24
38
  swarmauri_core = { workspace = true }
@@ -1,43 +0,0 @@
1
-
2
- ![Swamauri Logo](https://res.cloudinary.com/dbjmpekvl/image/upload/v1730099724/Swarmauri-logo-lockup-2048x757_hww01w.png)
3
-
4
- <p align="center">
5
- <a href="https://pypi.org/project/swarmauri_tool_folium/">
6
- <img src="https://img.shields.io/pypi/dm/swarmauri_tool_folium" alt="PyPI - Downloads"/></a>
7
- <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_folium/">
8
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_folium.svg"/></a>
9
- <a href="https://pypi.org/project/swarmauri_tool_folium/">
10
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_folium" alt="PyPI - Python Version"/></a>
11
- <a href="https://pypi.org/project/swarmauri_tool_folium/">
12
- <img src="https://img.shields.io/pypi/l/swarmauri_tool_folium" alt="PyPI - License"/></a>
13
- <a href="https://pypi.org/project/swarmauri_tool_folium/">
14
- <img src="https://img.shields.io/pypi/v/swarmauri_tool_folium?label=swarmauri_tool_folium&color=green" alt="PyPI - swarmauri_tool_folium"/></a>
15
- </p>
16
-
17
- ---
18
-
19
- # Swarmauri Tool Folium
20
-
21
- A tool to generate maps with markers using Folium.
22
-
23
- ## Installation
24
-
25
- ```bash
26
- pip install swarmauri_tool_folium
27
- ```
28
-
29
- ## Usage
30
- Basic usage examples with code snippets
31
- ```python
32
- from swarmauri.tools.FoliumTool import FoliumTool
33
-
34
- tool = FoliumTool()
35
- map_center = (40.7128, -74.0060)
36
- markers = [(40.7128, -74.0060, "Marker 1"), (40.7328, -74.0010, "Marker 2")]
37
-
38
- result = tool(map_center, markers)
39
- print(result['image_b64']) # Prints the base64 string of the map image
40
- ```
41
- ## Want to help?
42
-
43
- If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.