geo-engine-python 0.1.2__tar.gz → 0.1.3__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,9 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geo-engine-python
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: SDK oficial para Geo-Engine: Rastreo y Geofencing
5
- Author-email: AlexG <alexg695845@gmail.com>
6
- Project-URL: Homepage, https://app.geoengine.dev
5
+ Home-page: https://github.com/AlexG695/geo-engine-python
6
+ Author: AlexG695
7
+ Author-email: AlexG <alexg@geoengine.dev>
8
+ Project-URL: Homepage, https://geoengine.dev
7
9
  Project-URL: Bug Tracker, https://github.com/AlexG695/geo-engine/issues
8
10
  Classifier: Programming Language :: Python :: 3
9
11
  Classifier: License :: OSI Approved :: MIT License
@@ -11,6 +13,9 @@ Classifier: Operating System :: OS Independent
11
13
  Requires-Python: >=3.7
12
14
  Description-Content-Type: text/markdown
13
15
  Requires-Dist: requests>=2.25.0
16
+ Dynamic: author
17
+ Dynamic: home-page
18
+ Dynamic: requires-python
14
19
 
15
20
  # 🐍 Geo-Engine Python SDK
16
21
 
@@ -1,9 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: geo-engine-python
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: SDK oficial para Geo-Engine: Rastreo y Geofencing
5
- Author-email: AlexG <alexg695845@gmail.com>
6
- Project-URL: Homepage, https://app.geoengine.dev
5
+ Home-page: https://github.com/AlexG695/geo-engine-python
6
+ Author: AlexG695
7
+ Author-email: AlexG <alexg@geoengine.dev>
8
+ Project-URL: Homepage, https://geoengine.dev
7
9
  Project-URL: Bug Tracker, https://github.com/AlexG695/geo-engine/issues
8
10
  Classifier: Programming Language :: Python :: 3
9
11
  Classifier: License :: OSI Approved :: MIT License
@@ -11,6 +13,9 @@ Classifier: Operating System :: OS Independent
11
13
  Requires-Python: >=3.7
12
14
  Description-Content-Type: text/markdown
13
15
  Requires-Dist: requests>=2.25.0
16
+ Dynamic: author
17
+ Dynamic: home-page
18
+ Dynamic: requires-python
14
19
 
15
20
  # 🐍 Geo-Engine Python SDK
16
21
 
@@ -1,8 +1,9 @@
1
1
  README.md
2
- geoengine.py
3
2
  pyproject.toml
3
+ setup.py
4
4
  geo_engine_python.egg-info/PKG-INFO
5
5
  geo_engine_python.egg-info/SOURCES.txt
6
6
  geo_engine_python.egg-info/dependency_links.txt
7
7
  geo_engine_python.egg-info/requires.txt
8
- geo_engine_python.egg-info/top_level.txt
8
+ geo_engine_python.egg-info/top_level.txt
9
+ geoengine/__init__.py
@@ -0,0 +1 @@
1
+ from .client import GeoEngine, GeoEngineError
@@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "geo-engine-python"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  authors = [
9
- { name="AlexG", email="alexg695845@gmail.com" },
9
+ { name="AlexG", email="alexg@geoengine.dev" },
10
10
  ]
11
11
  description = "SDK oficial para Geo-Engine: Rastreo y Geofencing"
12
12
  readme = "README.md"
@@ -21,5 +21,5 @@ dependencies = [
21
21
  ]
22
22
 
23
23
  [project.urls]
24
- "Homepage" = "https://app.geoengine.dev"
24
+ "Homepage" = "https://geoengine.dev"
25
25
  "Bug Tracker" = "https://github.com/AlexG695/geo-engine/issues"
@@ -0,0 +1,29 @@
1
+ from setuptools import setup, find_packages
2
+ import os
3
+
4
+ setup(
5
+ name="geo-engine-python",
6
+ version="1.0.0",
7
+ description="Official Python Client for the Geo-Engine Platform",
8
+ author="AlexG695",
9
+ author_email="alexg@geoengine.dev",
10
+ url="https://github.com/AlexG695/geo-engine-python",
11
+ license="MIT",
12
+ packages=find_packages(),
13
+ install_requires=[
14
+ "requests>=2.25.0",
15
+ ],
16
+ classifiers=[
17
+ "Development Status :: 5 - Production/Stable",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.9",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Topic :: Software Development :: Libraries :: Python Modules",
25
+ "Topic :: Scientific/Engineering :: GIS",
26
+ ],
27
+ python_requires=">=3.7",
28
+ keywords="geofencing, maps, location, sdk, geojson",
29
+ )
@@ -1,84 +0,0 @@
1
- import requests
2
- import time
3
- import json
4
-
5
- class GeoEngine:
6
- DEFAULT_MANAGEMENT_URL = "https://api.geoengine.dev"
7
- DEFAULT_INGEST_URL = "https://ingest.geoengine.dev"
8
-
9
- def __init__(self, api_key, management_url=None, ingest_url=None):
10
- """
11
- Inicializa el cliente de GeoEngine.
12
- """
13
- if not api_key:
14
- raise ValueError("GeoEngine: API Key es requerida")
15
-
16
- self.api_key = api_key
17
- self.management_url = management_url or self.DEFAULT_MANAGEMENT_URL
18
- self.ingest_url = ingest_url or self.DEFAULT_INGEST_URL
19
- self.headers = {
20
- "Content-Type": "application/json",
21
- "X-API-Key": self.api_key,
22
- "User-Agent": "GeoEnginePython/1.0.0"
23
- }
24
-
25
- def send_location(self, device_id, lat, lng):
26
- """
27
- Envía una coordenada al motor de ingestión.
28
- """
29
- payload = {
30
- "device_id": device_id,
31
- "latitude": float(lat),
32
- "longitude": float(lng),
33
- "timestamp": int(time.time())
34
- }
35
-
36
- try:
37
- response = requests.post(
38
- f"{self.ingest_url}/ingest",
39
- json=payload,
40
- headers=self.headers,
41
- timeout=10
42
- )
43
- response.raise_for_status()
44
- return response.json()
45
- except requests.exceptions.RequestException as e:
46
- raise Exception(f"GeoEngine Error: {e}")
47
-
48
- def create_geofence(self, name, coordinates, webhook_url):
49
- """
50
- Crea una geocerca.
51
- coordinates debe ser una lista de listas: [[lat, lng], [lat, lng]]
52
- """
53
- if len(coordinates) < 3:
54
- raise ValueError("Se requieren al menos 3 puntos")
55
-
56
- # Convertir [Lat, Lng] a [Lng, Lat] para GeoJSON
57
- polygon = [[p[1], p[0]] for p in coordinates]
58
-
59
- # Cerrar polígono
60
- if polygon[0] != polygon[-1]:
61
- polygon.append(polygon[0])
62
-
63
- payload = {
64
- "name": name,
65
- "webhook_url": webhook_url,
66
- "geojson": {
67
- "type": "Polygon",
68
- "coordinates": [polygon]
69
- }
70
- }
71
-
72
- try:
73
- response = requests.post(
74
- f"{self.management_url}/geofences",
75
- json=payload,
76
- headers=self.headers,
77
- timeout=10
78
- )
79
- response.raise_for_status()
80
- return response.json()
81
- except requests.exceptions.RequestException as e:
82
- if response.content:
83
- raise Exception(f"API Error: {response.json().get('error', response.text)}")
84
- raise Exception(f"Connection Error: {e}")