quantaroute-geocoding 1.0.2__tar.gz → 1.0.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.

Potentially problematic release.


This version of quantaroute-geocoding might be problematic. Click here for more details.

Files changed (24) hide show
  1. {quantaroute_geocoding-1.0.2/quantaroute_geocoding.egg-info → quantaroute_geocoding-1.0.3}/PKG-INFO +161 -10
  2. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/README.md +158 -7
  3. quantaroute_geocoding-1.0.3/examples/README.md +85 -0
  4. quantaroute_geocoding-1.0.3/examples/basic_usage.py +158 -0
  5. quantaroute_geocoding-1.0.3/examples/batch_location_lookup.py +193 -0
  6. quantaroute_geocoding-1.0.3/examples/location_lookup_demo.py +214 -0
  7. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/pyproject.toml +3 -3
  8. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding/__init__.py +3 -1
  9. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding/cli.py +138 -2
  10. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding/client.py +112 -1
  11. quantaroute_geocoding-1.0.3/quantaroute_geocoding/location_lookup.py +291 -0
  12. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3/quantaroute_geocoding.egg-info}/PKG-INFO +161 -10
  13. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding.egg-info/SOURCES.txt +5 -0
  14. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/setup.py +2 -2
  15. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/LICENSE +0 -0
  16. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/MANIFEST.in +0 -0
  17. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding/csv_processor.py +0 -0
  18. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding/exceptions.py +0 -0
  19. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding/offline.py +0 -0
  20. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding.egg-info/dependency_links.txt +0 -0
  21. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding.egg-info/entry_points.txt +0 -0
  22. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding.egg-info/requires.txt +0 -0
  23. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/quantaroute_geocoding.egg-info/top_level.txt +0 -0
  24. {quantaroute_geocoding-1.0.2 → quantaroute_geocoding-1.0.3}/setup.cfg +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: quantaroute-geocoding
3
- Version: 1.0.2
4
- Summary: Python SDK for QuantaRoute Geocoding API with offline DigiPin processing
3
+ Version: 1.0.3
4
+ Summary: Revolutionary Python SDK for QuantaRoute Geocoding API with Location Lookup and offline DigiPin processing
5
5
  Home-page: https://github.com/quantaroute/quantaroute-geocoding-python
6
6
  Author: QuantaRoute
7
7
  Author-email: QuantaRoute <support@quantaroute.com>
@@ -10,7 +10,7 @@ Project-URL: Homepage, https://quantaroute.com
10
10
  Project-URL: Documentation, https://api.quantaroute.com/v1/digipin/docs
11
11
  Project-URL: Repository, https://github.com/quantaroute/quantaroute-geocoding-python
12
12
  Project-URL: Bug Tracker, https://github.com/quantaroute/quantaroute-geocoding-python/issues
13
- Keywords: geocoding,digipin,gis,location,india,address,coordinates
13
+ Keywords: geocoding,digipin,gis,location,india,address,coordinates,administrative-boundaries,pincode,postal-lookup,location-intelligence
14
14
  Classifier: Development Status :: 4 - Beta
15
15
  Classifier: Intended Audience :: Developers
16
16
  Classifier: License :: OSI Approved :: MIT License
@@ -44,10 +44,18 @@ Dynamic: requires-python
44
44
 
45
45
  # QuantaRoute Geocoding Python SDK
46
46
 
47
- A comprehensive Python library for geocoding addresses to DigiPin codes with both online API and offline processing capabilities.
47
+ A **revolutionary** Python library for geocoding addresses to DigiPin codes with **groundbreaking Location Lookup API** and offline processing capabilities.
48
48
 
49
- ## Features
49
+ ## 🚀 Revolutionary Features
50
50
 
51
+ ### 🎯 **NEW: Location Lookup API** - *Service that even government doesn't provide!*
52
+ - 🗺️ **Administrative Boundary Lookup**: Get state, division, locality, pincode from coordinates
53
+ - 📍 **36,000+ Postal Boundaries**: Complete coverage across India
54
+ - ⚡ **Sub-100ms Response**: Cached responses with database fallback
55
+ - 🎯 **Government-Level Precision**: Accuracy that official services don't offer
56
+ - 🔄 **Batch Processing**: Up to 100 locations per request
57
+
58
+ ### 🌟 **Core Features**
51
59
  - 🌐 **Online API Integration**: Full access to QuantaRoute Geocoding API
52
60
  - 🔌 **Offline Processing**: Process coordinates ↔ DigiPin without internet
53
61
  - 📊 **CSV Bulk Processing**: Handle large datasets efficiently
@@ -70,14 +78,36 @@ pip install digipin
70
78
 
71
79
  ## Quick Start
72
80
 
73
- ### Online API Usage
81
+ ### 🚀 **NEW: Revolutionary Location Lookup API**
74
82
 
75
83
  ```python
76
- from quantaroute_geocoding import QuantaRouteClient
84
+ from quantaroute_geocoding import QuantaRouteClient, LocationLookupClient
77
85
 
78
86
  # Initialize client
79
87
  client = QuantaRouteClient(api_key="your-api-key")
80
88
 
89
+ # 🚀 REVOLUTIONARY: Get administrative boundaries from coordinates
90
+ result = client.lookup_location_from_coordinates(28.6139, 77.2090)
91
+ print(f"Pincode: {result['pincode']}") # 110001
92
+ print(f"Office: {result['office_name']}") # New Delhi GPO
93
+ print(f"Division: {result['division']}") # New Delhi GPO
94
+ print(f"Circle: {result['circle']}") # Delhi
95
+ print(f"DigiPin: {result['digipin']}") # 39J-438-TJC7
96
+ print(f"Response Time: {result['response_time_ms']}ms") # <100ms
97
+
98
+ # 🚀 REVOLUTIONARY: Get boundaries from DigiPin
99
+ result = client.lookup_location_from_digipin("39J-438-TJC7")
100
+ print(f"Administrative Details: {result}")
101
+
102
+ # 📊 Get live statistics (36,000+ boundaries)
103
+ stats = client.get_location_statistics()
104
+ print(f"Total Boundaries: {stats['total_boundaries']:,}")
105
+ print(f"Total States: {stats['total_states']}")
106
+ ```
107
+
108
+ ### 🌟 **Traditional Geocoding API**
109
+
110
+ ```python
81
111
  # Geocode an address
82
112
  result = client.geocode("India Gate, New Delhi, India")
83
113
  print(f"DigiPin: {result['digipin']}")
@@ -141,9 +171,25 @@ result = processor_offline.process_coordinates_to_digipin_csv(
141
171
 
142
172
  ## Command Line Interface
143
173
 
144
- The package includes a powerful CLI for batch processing:
174
+ The package includes a **revolutionary** CLI with Location Lookup capabilities:
145
175
 
146
- ### Geocode addresses from CSV
176
+ ### 🚀 **NEW: Revolutionary Location Lookup Commands**
177
+
178
+ ```bash
179
+ # Get administrative boundaries from coordinates
180
+ quantaroute-geocode location-lookup 28.6139 77.2090 --api-key your-key
181
+
182
+ # Get boundaries from DigiPin
183
+ quantaroute-geocode location-from-digipin "39J-438-TJC7" --api-key your-key
184
+
185
+ # Get live statistics (36,000+ boundaries)
186
+ quantaroute-geocode location-stats --api-key your-key
187
+
188
+ # Batch location lookup from CSV (coming soon)
189
+ quantaroute-geocode location-lookup-csv coordinates.csv boundaries.csv --api-key your-key
190
+ ```
191
+
192
+ ### 🌟 **Traditional Geocoding Commands**
147
193
 
148
194
  ```bash
149
195
  # Using API
@@ -215,6 +261,77 @@ digipin
215
261
  39J-49J-4867
216
262
  ```
217
263
 
264
+ ## 🚀 Revolutionary Location Lookup API
265
+
266
+ ### Dedicated Location Lookup Client
267
+
268
+ ```python
269
+ from quantaroute_geocoding import LocationLookupClient
270
+
271
+ # Initialize dedicated location client
272
+ location_client = LocationLookupClient(api_key="your-api-key")
273
+
274
+ # Single coordinate lookup
275
+ result = location_client.lookup_coordinates(28.6139, 77.2090)
276
+ print(f"📮 Pincode: {result['pincode']}")
277
+ print(f"🏢 Office: {result['office_name']}")
278
+ print(f"🏛️ Division: {result['division']}")
279
+ print(f"⚡ Response Time: {result['response_time_ms']}ms")
280
+
281
+ # DigiPin to boundaries
282
+ result = location_client.lookup_digipin("39J-438-TJC7")
283
+ print(f"Administrative boundaries: {result}")
284
+
285
+ # Batch processing (up to 100 locations)
286
+ locations = [
287
+ {"latitude": 28.6139, "longitude": 77.2090},
288
+ {"latitude": 19.0760, "longitude": 72.8777},
289
+ {"digipin": "39J-438-TJC7"}
290
+ ]
291
+ results = location_client.batch_lookup(locations)
292
+ print(f"Processed {len(results['results'])} locations")
293
+
294
+ # Live statistics
295
+ stats = location_client.get_statistics()
296
+ print(f"🗺️ Total Boundaries: {stats['total_boundaries']:,}")
297
+ print(f"⚡ Cache Size: {stats['cache_size']}")
298
+
299
+ # Coverage information
300
+ coverage = location_client.get_coverage_info()
301
+ print(f"Service capabilities: {coverage}")
302
+ ```
303
+
304
+ ### Location Lookup Output Format
305
+
306
+ ```json
307
+ {
308
+ "pincode": "110001",
309
+ "office_name": "New Delhi GPO",
310
+ "division": "New Delhi GPO",
311
+ "region": "",
312
+ "circle": "Delhi",
313
+ "coordinates": {
314
+ "latitude": 28.6139,
315
+ "longitude": 77.2090
316
+ },
317
+ "digipin": "39J-438-TJC7",
318
+ "cached": true,
319
+ "response_time_ms": 45
320
+ }
321
+ ```
322
+
323
+ ### Why This is Revolutionary
324
+
325
+ 🎯 **Government-Level Precision**: Access to administrative boundaries that even government APIs don't provide at this level of detail and accessibility.
326
+
327
+ 📍 **36,000+ Boundaries**: Complete coverage of Indian postal boundaries with sub-district level precision.
328
+
329
+ ⚡ **Performance**: Sub-100ms cached responses, <500ms database queries.
330
+
331
+ 🔄 **Batch Processing**: Process up to 100 locations in a single API call.
332
+
333
+ ✨ **Unique Value**: The only service providing this level of administrative boundary lookup precision for India.
334
+
218
335
  ## Advanced Features
219
336
 
220
337
  ### Webhook Management
@@ -332,17 +449,51 @@ except APIError as e:
332
449
 
333
450
  ## API Limits
334
451
 
452
+ ### Traditional Geocoding API
453
+
335
454
  | Tier | Requests/Minute | Monthly Limit | Batch Size |
336
455
  |------|----------------|---------------|------------|
337
456
  | Free | 10 | 1,000 | 50 |
338
457
  | Paid | 100 | 10,000 | 100 |
339
458
  | Enterprise | 1,000 | Unlimited | 100 |
340
459
 
460
+ ### 🚀 Revolutionary Location Lookup API
461
+
462
+ | Tier | Requests/Minute | Monthly Limit | Batch Size | Boundaries |
463
+ |------|----------------|---------------|------------|------------|
464
+ | Free | 20 | 2,000 | 50 | 36,000+ |
465
+ | Paid | 200 | 20,000 | 100 | 36,000+ |
466
+ | Enterprise | 2,000 | Unlimited | 100 | 36,000+ |
467
+
468
+ **Performance Guarantees:**
469
+ - ⚡ Cached responses: <100ms
470
+ - 🔍 Database queries: <500ms
471
+ - 📊 Batch processing: <50ms per location
472
+ - 🎯 99.9% uptime SLA (Enterprise)
473
+
341
474
  ## Support
342
475
 
343
476
  - 📧 Email: support@quantaroute.com
344
477
  - 🌐 Website: https://quantaroute.com
345
- - 📖 API Documentation: https://api.quantaroute.com/v1/digipin/docs
478
+ - 📖 Traditional API Docs: https://api.quantaroute.com/v1/digipin/docs
479
+ - 🚀 **NEW: Location Lookup API**: https://api.quantaroute.com/v1/location
480
+ - 📊 **Live Statistics**: https://api.quantaroute.com/v1/location/stats
481
+
482
+ ### 🚀 What Makes This Revolutionary?
483
+
484
+ **QuantaRoute's Location Lookup API is the first and only service to provide:**
485
+
486
+ ✨ **Government-Level Precision**: Administrative boundary data that even government APIs don't provide at this level of detail and accessibility.
487
+
488
+ 📍 **Complete Coverage**: 36,000+ postal boundaries across India with sub-district precision.
489
+
490
+ ⚡ **Blazing Performance**: Sub-100ms cached responses, guaranteed <500ms database queries.
491
+
492
+ 🎯 **Unique Value Proposition**: The only service providing this level of administrative boundary lookup precision for India.
493
+
494
+ 🔄 **Developer-Friendly**: Simple APIs, comprehensive SDKs, and excellent documentation.
495
+
496
+ **Ready to revolutionize your location intelligence applications?**
346
497
 
347
498
  ## License
348
499
 
@@ -1,9 +1,17 @@
1
1
  # QuantaRoute Geocoding Python SDK
2
2
 
3
- A comprehensive Python library for geocoding addresses to DigiPin codes with both online API and offline processing capabilities.
3
+ A **revolutionary** Python library for geocoding addresses to DigiPin codes with **groundbreaking Location Lookup API** and offline processing capabilities.
4
4
 
5
- ## Features
5
+ ## 🚀 Revolutionary Features
6
6
 
7
+ ### 🎯 **NEW: Location Lookup API** - *Service that even government doesn't provide!*
8
+ - 🗺️ **Administrative Boundary Lookup**: Get state, division, locality, pincode from coordinates
9
+ - 📍 **36,000+ Postal Boundaries**: Complete coverage across India
10
+ - ⚡ **Sub-100ms Response**: Cached responses with database fallback
11
+ - 🎯 **Government-Level Precision**: Accuracy that official services don't offer
12
+ - 🔄 **Batch Processing**: Up to 100 locations per request
13
+
14
+ ### 🌟 **Core Features**
7
15
  - 🌐 **Online API Integration**: Full access to QuantaRoute Geocoding API
8
16
  - 🔌 **Offline Processing**: Process coordinates ↔ DigiPin without internet
9
17
  - 📊 **CSV Bulk Processing**: Handle large datasets efficiently
@@ -26,14 +34,36 @@ pip install digipin
26
34
 
27
35
  ## Quick Start
28
36
 
29
- ### Online API Usage
37
+ ### 🚀 **NEW: Revolutionary Location Lookup API**
30
38
 
31
39
  ```python
32
- from quantaroute_geocoding import QuantaRouteClient
40
+ from quantaroute_geocoding import QuantaRouteClient, LocationLookupClient
33
41
 
34
42
  # Initialize client
35
43
  client = QuantaRouteClient(api_key="your-api-key")
36
44
 
45
+ # 🚀 REVOLUTIONARY: Get administrative boundaries from coordinates
46
+ result = client.lookup_location_from_coordinates(28.6139, 77.2090)
47
+ print(f"Pincode: {result['pincode']}") # 110001
48
+ print(f"Office: {result['office_name']}") # New Delhi GPO
49
+ print(f"Division: {result['division']}") # New Delhi GPO
50
+ print(f"Circle: {result['circle']}") # Delhi
51
+ print(f"DigiPin: {result['digipin']}") # 39J-438-TJC7
52
+ print(f"Response Time: {result['response_time_ms']}ms") # <100ms
53
+
54
+ # 🚀 REVOLUTIONARY: Get boundaries from DigiPin
55
+ result = client.lookup_location_from_digipin("39J-438-TJC7")
56
+ print(f"Administrative Details: {result}")
57
+
58
+ # 📊 Get live statistics (36,000+ boundaries)
59
+ stats = client.get_location_statistics()
60
+ print(f"Total Boundaries: {stats['total_boundaries']:,}")
61
+ print(f"Total States: {stats['total_states']}")
62
+ ```
63
+
64
+ ### 🌟 **Traditional Geocoding API**
65
+
66
+ ```python
37
67
  # Geocode an address
38
68
  result = client.geocode("India Gate, New Delhi, India")
39
69
  print(f"DigiPin: {result['digipin']}")
@@ -97,9 +127,25 @@ result = processor_offline.process_coordinates_to_digipin_csv(
97
127
 
98
128
  ## Command Line Interface
99
129
 
100
- The package includes a powerful CLI for batch processing:
130
+ The package includes a **revolutionary** CLI with Location Lookup capabilities:
101
131
 
102
- ### Geocode addresses from CSV
132
+ ### 🚀 **NEW: Revolutionary Location Lookup Commands**
133
+
134
+ ```bash
135
+ # Get administrative boundaries from coordinates
136
+ quantaroute-geocode location-lookup 28.6139 77.2090 --api-key your-key
137
+
138
+ # Get boundaries from DigiPin
139
+ quantaroute-geocode location-from-digipin "39J-438-TJC7" --api-key your-key
140
+
141
+ # Get live statistics (36,000+ boundaries)
142
+ quantaroute-geocode location-stats --api-key your-key
143
+
144
+ # Batch location lookup from CSV (coming soon)
145
+ quantaroute-geocode location-lookup-csv coordinates.csv boundaries.csv --api-key your-key
146
+ ```
147
+
148
+ ### 🌟 **Traditional Geocoding Commands**
103
149
 
104
150
  ```bash
105
151
  # Using API
@@ -171,6 +217,77 @@ digipin
171
217
  39J-49J-4867
172
218
  ```
173
219
 
220
+ ## 🚀 Revolutionary Location Lookup API
221
+
222
+ ### Dedicated Location Lookup Client
223
+
224
+ ```python
225
+ from quantaroute_geocoding import LocationLookupClient
226
+
227
+ # Initialize dedicated location client
228
+ location_client = LocationLookupClient(api_key="your-api-key")
229
+
230
+ # Single coordinate lookup
231
+ result = location_client.lookup_coordinates(28.6139, 77.2090)
232
+ print(f"📮 Pincode: {result['pincode']}")
233
+ print(f"🏢 Office: {result['office_name']}")
234
+ print(f"🏛️ Division: {result['division']}")
235
+ print(f"⚡ Response Time: {result['response_time_ms']}ms")
236
+
237
+ # DigiPin to boundaries
238
+ result = location_client.lookup_digipin("39J-438-TJC7")
239
+ print(f"Administrative boundaries: {result}")
240
+
241
+ # Batch processing (up to 100 locations)
242
+ locations = [
243
+ {"latitude": 28.6139, "longitude": 77.2090},
244
+ {"latitude": 19.0760, "longitude": 72.8777},
245
+ {"digipin": "39J-438-TJC7"}
246
+ ]
247
+ results = location_client.batch_lookup(locations)
248
+ print(f"Processed {len(results['results'])} locations")
249
+
250
+ # Live statistics
251
+ stats = location_client.get_statistics()
252
+ print(f"🗺️ Total Boundaries: {stats['total_boundaries']:,}")
253
+ print(f"⚡ Cache Size: {stats['cache_size']}")
254
+
255
+ # Coverage information
256
+ coverage = location_client.get_coverage_info()
257
+ print(f"Service capabilities: {coverage}")
258
+ ```
259
+
260
+ ### Location Lookup Output Format
261
+
262
+ ```json
263
+ {
264
+ "pincode": "110001",
265
+ "office_name": "New Delhi GPO",
266
+ "division": "New Delhi GPO",
267
+ "region": "",
268
+ "circle": "Delhi",
269
+ "coordinates": {
270
+ "latitude": 28.6139,
271
+ "longitude": 77.2090
272
+ },
273
+ "digipin": "39J-438-TJC7",
274
+ "cached": true,
275
+ "response_time_ms": 45
276
+ }
277
+ ```
278
+
279
+ ### Why This is Revolutionary
280
+
281
+ 🎯 **Government-Level Precision**: Access to administrative boundaries that even government APIs don't provide at this level of detail and accessibility.
282
+
283
+ 📍 **36,000+ Boundaries**: Complete coverage of Indian postal boundaries with sub-district level precision.
284
+
285
+ ⚡ **Performance**: Sub-100ms cached responses, <500ms database queries.
286
+
287
+ 🔄 **Batch Processing**: Process up to 100 locations in a single API call.
288
+
289
+ ✨ **Unique Value**: The only service providing this level of administrative boundary lookup precision for India.
290
+
174
291
  ## Advanced Features
175
292
 
176
293
  ### Webhook Management
@@ -288,17 +405,51 @@ except APIError as e:
288
405
 
289
406
  ## API Limits
290
407
 
408
+ ### Traditional Geocoding API
409
+
291
410
  | Tier | Requests/Minute | Monthly Limit | Batch Size |
292
411
  |------|----------------|---------------|------------|
293
412
  | Free | 10 | 1,000 | 50 |
294
413
  | Paid | 100 | 10,000 | 100 |
295
414
  | Enterprise | 1,000 | Unlimited | 100 |
296
415
 
416
+ ### 🚀 Revolutionary Location Lookup API
417
+
418
+ | Tier | Requests/Minute | Monthly Limit | Batch Size | Boundaries |
419
+ |------|----------------|---------------|------------|------------|
420
+ | Free | 20 | 2,000 | 50 | 36,000+ |
421
+ | Paid | 200 | 20,000 | 100 | 36,000+ |
422
+ | Enterprise | 2,000 | Unlimited | 100 | 36,000+ |
423
+
424
+ **Performance Guarantees:**
425
+ - ⚡ Cached responses: <100ms
426
+ - 🔍 Database queries: <500ms
427
+ - 📊 Batch processing: <50ms per location
428
+ - 🎯 99.9% uptime SLA (Enterprise)
429
+
297
430
  ## Support
298
431
 
299
432
  - 📧 Email: support@quantaroute.com
300
433
  - 🌐 Website: https://quantaroute.com
301
- - 📖 API Documentation: https://api.quantaroute.com/v1/digipin/docs
434
+ - 📖 Traditional API Docs: https://api.quantaroute.com/v1/digipin/docs
435
+ - 🚀 **NEW: Location Lookup API**: https://api.quantaroute.com/v1/location
436
+ - 📊 **Live Statistics**: https://api.quantaroute.com/v1/location/stats
437
+
438
+ ### 🚀 What Makes This Revolutionary?
439
+
440
+ **QuantaRoute's Location Lookup API is the first and only service to provide:**
441
+
442
+ ✨ **Government-Level Precision**: Administrative boundary data that even government APIs don't provide at this level of detail and accessibility.
443
+
444
+ 📍 **Complete Coverage**: 36,000+ postal boundaries across India with sub-district precision.
445
+
446
+ ⚡ **Blazing Performance**: Sub-100ms cached responses, guaranteed <500ms database queries.
447
+
448
+ 🎯 **Unique Value Proposition**: The only service providing this level of administrative boundary lookup precision for India.
449
+
450
+ 🔄 **Developer-Friendly**: Simple APIs, comprehensive SDKs, and excellent documentation.
451
+
452
+ **Ready to revolutionize your location intelligence applications?**
302
453
 
303
454
  ## License
304
455
 
@@ -0,0 +1,85 @@
1
+ # QuantaRoute Geocoding Examples
2
+
3
+ This directory contains examples demonstrating the revolutionary capabilities of the QuantaRoute Geocoding Python SDK.
4
+
5
+ ## 🚀 Revolutionary Location Lookup Examples
6
+
7
+ ### `location_lookup_demo.py`
8
+ **Comprehensive demonstration of the groundbreaking Location Lookup API**
9
+
10
+ Features demonstrated:
11
+ - Single coordinate to administrative boundaries
12
+ - DigiPin to administrative boundaries
13
+ - Batch processing multiple locations
14
+ - Live statistics and performance metrics
15
+ - Service coverage information
16
+
17
+ ```bash
18
+ python location_lookup_demo.py
19
+ ```
20
+
21
+ ### `batch_location_lookup.py`
22
+ **Efficient batch processing of coordinates to administrative boundaries**
23
+
24
+ Features:
25
+ - CSV file processing
26
+ - Batch API calls (up to 100 locations)
27
+ - Progress tracking and error handling
28
+ - Sample data generation
29
+ - Performance metrics
30
+
31
+ ```bash
32
+ python batch_location_lookup.py
33
+ ```
34
+
35
+ ## 🌟 Traditional Geocoding Examples
36
+
37
+ *Coming soon - examples for traditional geocoding, DigiPin conversion, and CSV processing*
38
+
39
+ ## Setup
40
+
41
+ 1. Install the package:
42
+ ```bash
43
+ pip install quantaroute-geocoding
44
+ ```
45
+
46
+ 2. Set your API key:
47
+ ```bash
48
+ export QUANTAROUTE_API_KEY="your-api-key"
49
+ ```
50
+
51
+ 3. Run any example:
52
+ ```bash
53
+ python location_lookup_demo.py
54
+ ```
55
+
56
+ ## 🎯 What Makes These Examples Revolutionary?
57
+
58
+ ✨ **Government-Level Precision**: See administrative boundary lookup that even government services don't provide
59
+
60
+ 📍 **36,000+ Boundaries**: Experience complete coverage across India
61
+
62
+ ⚡ **Sub-100ms Performance**: Witness blazing-fast cached responses
63
+
64
+ 🔄 **Batch Processing**: Process hundreds of locations efficiently
65
+
66
+ 🎯 **Unique Value**: Access precision that no other service offers
67
+
68
+ ## Sample Output
69
+
70
+ ```
71
+ 🚀 REVOLUTIONARY LOCATION LOOKUP RESULT
72
+ ==================================================
73
+ 📍 Coordinates: 28.6139, 77.209
74
+ 📮 Pincode: 110001
75
+ 🏢 Office Name: New Delhi GPO
76
+ 🏛️ Division: New Delhi GPO
77
+ 🌍 Region:
78
+ ⭕ Circle: Delhi
79
+ 🗺️ DigiPin: 39J-438-TJC7
80
+ ⚡ Response Time: 45ms (cached)
81
+
82
+ ✨ This precision is not available from government services!
83
+ ```
84
+
85
+ **Ready to revolutionize your location intelligence applications?**
@@ -0,0 +1,158 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Basic usage examples for QuantaRoute Geocoding SDK
4
+ """
5
+
6
+ import os
7
+ from quantaroute_geocoding import QuantaRouteClient, OfflineProcessor, CSVProcessor
8
+
9
+ # Example 1: Online API Usage
10
+ def example_online_api():
11
+ print("=== Online API Usage ===")
12
+
13
+ # Get API key from environment or use test key
14
+ api_key = os.getenv('QUANTAROUTE_API_KEY', 'free_test_key_hash_12345')
15
+ client = QuantaRouteClient(api_key)
16
+
17
+ try:
18
+ # Geocode an address
19
+ print("1. Geocoding address...")
20
+ result = client.geocode("India Gate, New Delhi, India")
21
+ print(f" Address: India Gate, New Delhi, India")
22
+ print(f" DigiPin: {result['digipin']}")
23
+ print(f" Coordinates: {result['coordinates']['latitude']}, {result['coordinates']['longitude']}")
24
+ print(f" Confidence: {result['confidence']}")
25
+
26
+ # Convert coordinates to DigiPin
27
+ print("\n2. Converting coordinates to DigiPin...")
28
+ result = client.coordinates_to_digipin(28.6139, 77.2090)
29
+ print(f" Coordinates: 28.6139, 77.2090")
30
+ print(f" DigiPin: {result['digipin']}")
31
+
32
+ # Reverse geocode DigiPin
33
+ print("\n3. Reverse geocoding DigiPin...")
34
+ result = client.reverse_geocode(result['digipin'])
35
+ print(f" DigiPin: {result['digipin']}")
36
+ print(f" Coordinates: {result['coordinates']['latitude']}, {result['coordinates']['longitude']}")
37
+
38
+ # Check usage
39
+ print("\n4. Checking API usage...")
40
+ usage = client.get_usage()
41
+ usage_info = usage['usage']
42
+ print(f" Current usage: {usage_info['currentUsage']}")
43
+ print(f" Monthly limit: {usage_info['monthlyLimit']}")
44
+ print(f" Tier: {usage_info['tier']}")
45
+
46
+ except Exception as e:
47
+ print(f" Error: {e}")
48
+
49
+
50
+ # Example 2: Offline Processing
51
+ def example_offline_processing():
52
+ print("\n=== Offline Processing ===")
53
+
54
+ try:
55
+ processor = OfflineProcessor()
56
+
57
+ # Convert coordinates to DigiPin (offline)
58
+ print("1. Converting coordinates to DigiPin (offline)...")
59
+ result = processor.coordinates_to_digipin(28.6139, 77.2090)
60
+ print(f" Coordinates: 28.6139, 77.2090")
61
+ print(f" DigiPin: {result['digipin']}")
62
+
63
+ # Convert DigiPin to coordinates (offline)
64
+ print("\n2. Converting DigiPin to coordinates (offline)...")
65
+ result = processor.digipin_to_coordinates(result['digipin'])
66
+ print(f" DigiPin: {result['digipin']}")
67
+ print(f" Coordinates: {result['coordinates']['latitude']}, {result['coordinates']['longitude']}")
68
+
69
+ # Validate DigiPin
70
+ print("\n3. Validating DigiPin...")
71
+ result = processor.validate_digipin("39J-438-TJC7")
72
+ print(f" DigiPin: 39J-438-TJC7")
73
+ print(f" Valid: {result['isValid']}")
74
+
75
+ # Get grid information
76
+ print("\n4. Getting grid information...")
77
+ grid_info = processor.get_grid_info("39J-438-TJC7")
78
+ print(f" DigiPin: 39J-438-TJC7")
79
+ print(f" Center: {grid_info['center']['latitude']}, {grid_info['center']['longitude']}")
80
+ print(f" Grid size: {grid_info['grid_size_meters']}m x {grid_info['grid_size_meters']}m")
81
+
82
+ # Find nearby grids
83
+ print("\n5. Finding nearby grids...")
84
+ nearby = processor.find_nearby_grids(28.6139, 77.2090, radius_meters=50)
85
+ print(f" Found {len(nearby)} grids within 50m of 28.6139, 77.2090:")
86
+ for i, grid in enumerate(nearby[:3]): # Show first 3
87
+ print(f" {i+1}. {grid['digipin']} - {grid['distance_meters']:.1f}m away")
88
+
89
+ except Exception as e:
90
+ print(f" Error: {e}")
91
+
92
+
93
+ # Example 3: CSV Processing
94
+ def example_csv_processing():
95
+ print("\n=== CSV Processing Example ===")
96
+
97
+ # Create sample CSV files
98
+ import pandas as pd
99
+
100
+ # Sample coordinates CSV
101
+ coords_data = {
102
+ 'latitude': [28.6139, 19.0760, 13.0827, 22.5726],
103
+ 'longitude': [77.2090, 72.8777, 80.2707, 88.3639],
104
+ 'location': ['New Delhi', 'Mumbai', 'Chennai', 'Kolkata']
105
+ }
106
+ coords_df = pd.DataFrame(coords_data)
107
+ coords_df.to_csv('sample_coordinates.csv', index=False)
108
+ print("Created sample_coordinates.csv")
109
+
110
+ try:
111
+ # Process coordinates to DigiPin (offline)
112
+ print("\n1. Processing coordinates to DigiPin (offline)...")
113
+ processor = CSVProcessor(use_offline=True)
114
+
115
+ def progress_callback(processed, total, success, errors):
116
+ print(f" Progress: {processed}/{total} - Success: {success}, Errors: {errors}")
117
+
118
+ result = processor.process_coordinates_to_digipin_csv(
119
+ input_file='sample_coordinates.csv',
120
+ output_file='coordinates_with_digipin.csv',
121
+ progress_callback=progress_callback
122
+ )
123
+
124
+ print(f"\n Processing complete!")
125
+ print(f" Total rows: {result['total_rows']}")
126
+ print(f" Success rate: {result['success_rate']:.1%}")
127
+ print(f" Output saved to: coordinates_with_digipin.csv")
128
+
129
+ # Show results
130
+ result_df = pd.read_csv('coordinates_with_digipin.csv')
131
+ print(f"\n Sample results:")
132
+ for _, row in result_df.head(2).iterrows():
133
+ print(f" {row['location']}: {row['latitude']}, {row['longitude']} -> {row['digipin']}")
134
+
135
+ except Exception as e:
136
+ print(f" Error: {e}")
137
+
138
+ # Cleanup
139
+ try:
140
+ os.remove('sample_coordinates.csv')
141
+ os.remove('coordinates_with_digipin.csv')
142
+ print("\n Cleaned up sample files")
143
+ except:
144
+ pass
145
+
146
+
147
+ if __name__ == '__main__':
148
+ print("QuantaRoute Geocoding SDK - Basic Usage Examples")
149
+ print("=" * 50)
150
+
151
+ example_online_api()
152
+ example_offline_processing()
153
+ example_csv_processing()
154
+
155
+ print("\n" + "=" * 50)
156
+ print("Examples completed!")
157
+ print("\nFor more examples, check the documentation at:")
158
+ print("https://github.com/quantaroute/quantaroute-geocoding-python")