pixel-map 0.2.2__tar.gz → 0.2.4__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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pixel-map
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: A Python CLI tool for plotting geo files in the terminal
5
5
  Author-Email: Kamil Raczycki <kraczycki@kraina.ai>
6
6
  License: MIT
@@ -25,7 +25,7 @@ Requires-Dist: rich>=12.0.0
25
25
  Requires-Dist: typer[all]>=0.9.0
26
26
  Requires-Dist: img2unicode[n2]>=0.1a11; sys_platform != "win32" and sys_platform != "darwin"
27
27
  Requires-Dist: img2unicode>=0.1a11; sys_platform == "win32" or sys_platform == "darwin"
28
- Requires-Dist: geopandas>=0.6
28
+ Requires-Dist: geopandas>=0.8
29
29
  Requires-Dist: numpy>=1.26.0
30
30
  Requires-Dist: contextily>=1
31
31
  Requires-Dist: matplotlib>=3.2.0
@@ -67,13 +67,13 @@ Python CLI tool for plotting geo data in the terminal
67
67
  PyPI:
68
68
 
69
69
  ```sh
70
- $ pip install img2unicode
70
+ $ pip install pixel-map
71
71
  ```
72
72
 
73
73
  uv:
74
74
 
75
75
  ```sh
76
- $ uv pip install img2unicode
76
+ $ uv pip install pixel-map
77
77
  ```
78
78
 
79
79
  ## Usage
@@ -186,7 +186,7 @@ $ pixel-map --example london_buildings --no-bg -r ascii-bw
186
186
 
187
187
  - `rich (>=12.0.0)`: For showing progress and generating terminal output
188
188
 
189
- - `geopandas (>=0.6)`: For reading Geo files and plotting
189
+ - `geopandas (>=0.8)`: For reading Geo files and plotting
190
190
 
191
191
  - `pyarrow (>=16.0.0)`: For geoparquet files support
192
192
 
@@ -33,13 +33,13 @@ Python CLI tool for plotting geo data in the terminal
33
33
  PyPI:
34
34
 
35
35
  ```sh
36
- $ pip install img2unicode
36
+ $ pip install pixel-map
37
37
  ```
38
38
 
39
39
  uv:
40
40
 
41
41
  ```sh
42
- $ uv pip install img2unicode
42
+ $ uv pip install pixel-map
43
43
  ```
44
44
 
45
45
  ## Usage
@@ -152,7 +152,7 @@ $ pixel-map --example london_buildings --no-bg -r ascii-bw
152
152
 
153
153
  - `rich (>=12.0.0)`: For showing progress and generating terminal output
154
154
 
155
- - `geopandas (>=0.6)`: For reading Geo files and plotting
155
+ - `geopandas (>=0.8)`: For reading Geo files and plotting
156
156
 
157
157
  - `pyarrow (>=16.0.0)`: For geoparquet files support
158
158
 
@@ -1,4 +1,4 @@
1
1
  """Pixel-map library."""
2
2
 
3
3
  __app_name__ = "pixel-map"
4
- __version__ = "0.2.2"
4
+ __version__ = "0.2.4"
@@ -5,6 +5,7 @@ Generates a Matplotlib canvas that is rendered to an image and later transformed
5
5
  unicode characters.
6
6
  """
7
7
 
8
+ import os
8
9
  from pathlib import Path
9
10
  from typing import Any, Optional, Union
10
11
 
@@ -72,7 +73,11 @@ def plot_geo_data(
72
73
  plotting_dpi (int, optional): Quality of matplotlib figure. It's used to multiply terminal
73
74
  size by some value to get better quality plot. Defaults to 10.
74
75
  """
75
- console = get_console()
76
+ force_terminal = os.getenv("FORCE_TERMINAL_MODE", "false").lower() == "true"
77
+ if force_terminal:
78
+ console = Console(force_interactive=False, force_jupyter=False, force_terminal=True)
79
+ else:
80
+ console = get_console()
76
81
 
77
82
  if console_width:
78
83
  console.width = console_width
@@ -243,6 +248,11 @@ def _expand_bbox_to_match_ratio(
243
248
  bottom = bottom - height_padding
244
249
  top = top + height_padding
245
250
 
251
+ left = max(left, EPSG_3857_BOUNDS[0])
252
+ bottom = max(bottom, EPSG_3857_BOUNDS[1])
253
+ right = min(right, EPSG_3857_BOUNDS[2])
254
+ top = min(top, EPSG_3857_BOUNDS[3])
255
+
246
256
  new_minx, new_miny = TRANSFORMER.transform(left, bottom, direction=TransformDirection.INVERSE)
247
257
  new_maxx, new_maxy = TRANSFORMER.transform(right, top, direction=TransformDirection.INVERSE)
248
258
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pixel-map"
3
- version = "0.2.2"
3
+ version = "0.2.4"
4
4
  description = "A Python CLI tool for plotting geo files in the terminal"
5
5
  authors = [
6
6
  { name = "Kamil Raczycki", email = "kraczycki@kraina.ai" },
@@ -10,7 +10,7 @@ dependencies = [
10
10
  "typer[all]>=0.9.0",
11
11
  "img2unicode[n2]>=0.1a11; sys_platform != 'win32' and sys_platform != 'darwin'",
12
12
  "img2unicode>=0.1a11; sys_platform == 'win32' or sys_platform == 'darwin'",
13
- "geopandas>=0.6",
13
+ "geopandas>=0.8",
14
14
  "numpy>=1.26.0",
15
15
  "contextily>=1",
16
16
  "matplotlib>=3.2.0",
@@ -149,7 +149,7 @@ close-quotes-on-newline = true
149
149
  wrap-one-line = true
150
150
 
151
151
  [tool.bumpver]
152
- current_version = "0.2.2"
152
+ current_version = "0.2.4"
153
153
  version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]"
154
154
  commit_message = "chore(CI/CD): bump version {old_version} -> {new_version}"
155
155
  commit = true
@@ -0,0 +1 @@
1
+ """Tests for the pixel-map library."""
File without changes
File without changes
File without changes
File without changes