Modern Python package for geographic task allocation, clustering, and routing optimization
Project description
allocator
Field teams, delivery services, and survey organizations waste time and money on inefficient routes. When you have 100+ locations to visit, manual planning fails. Allocator solves this.
What It Does
- Cluster: Divide locations into balanced work zones
- Route: Find the shortest path through locations (TSP)
- Assign: Match locations to nearest workers or depots
- Random Walk: Generate survey itineraries on road networks
Install
pip install allocator
Python API
Cluster locations into zones
import allocator
import pandas as pd
locations = pd.DataFrame({
'longitude': [100.501, 100.506, 100.510, 100.515, 100.520],
'latitude': [13.756, 13.759, 13.763, 13.768, 13.772]
})
result = allocator.cluster(locations, n_clusters=2)
print(result.labels) # [0 0 0 1 1]
Find shortest route
route = allocator.shortest_path(locations, method='ortools')
print(route.route) # [0, 1, 2, 4, 3, 0]
Assign to nearest depot
depots = pd.DataFrame({
'longitude': [100.50, 100.52],
'latitude': [13.75, 13.77]
})
assignments = allocator.assign_to_closest(locations, depots)
print(assignments.data['assigned_worker'].tolist()) # [0, 0, 1, 1, 1]
Generate random walk itineraries
import networkx as nx
# Load road network graph (from OSMnx or similar)
G = nx.read_graphml("road_network.graphml")
result = allocator.random_walk(G, n_walks=10, walk_length_m=5000)
print(result.data) # DataFrame with waypoints
CLI
allocator cluster kmeans locations.csv -n 5 -o zones.csv
allocator route tsp locations.csv --method ortools -o route.csv
allocator sort locations.csv --workers depots.csv -o assignments.csv
allocator random-walk road_network.graphml -n 10 -l 5000 -o waypoints.csv
Documentation
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file allocator-1.2.0.tar.gz.
File metadata
- Download URL: allocator-1.2.0.tar.gz
- Upload date:
- Size: 35.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5768fa50595c4d327a6d1b7c61377104ab6902e29175387b1954b33b4615dfd5
|
|
| MD5 |
5aee497aadaa0dd4077b8661e1fc0c72
|
|
| BLAKE2b-256 |
1a27ed4db49f0c360b475627a70dd0564c3d928c89688c9c34c279a4e90d2b29
|
Provenance
The following attestation bundles were made for allocator-1.2.0.tar.gz:
Publisher:
python-publish.yml on geosensing/allocator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
allocator-1.2.0.tar.gz -
Subject digest:
5768fa50595c4d327a6d1b7c61377104ab6902e29175387b1954b33b4615dfd5 - Sigstore transparency entry: 1281057577
- Sigstore integration time:
-
Permalink:
geosensing/allocator@0458a87f558425c914d8d33a49ce6d4f72c5340d -
Branch / Tag:
refs/heads/master - Owner: https://github.com/geosensing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0458a87f558425c914d8d33a49ce6d4f72c5340d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file allocator-1.2.0-py3-none-any.whl.
File metadata
- Download URL: allocator-1.2.0-py3-none-any.whl
- Upload date:
- Size: 48.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d744b21d0d79d393373c7779e25de07bcff0e603bd17f4befa86cc8aef0f99fb
|
|
| MD5 |
5eb7d2c1a8f46f9ec47770d27e527214
|
|
| BLAKE2b-256 |
83d63f0daabf9f6a7b2cbbf505005c6011fe223b82c184b70416ff1c83e77b9b
|
Provenance
The following attestation bundles were made for allocator-1.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on geosensing/allocator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
allocator-1.2.0-py3-none-any.whl -
Subject digest:
d744b21d0d79d393373c7779e25de07bcff0e603bd17f4befa86cc8aef0f99fb - Sigstore transparency entry: 1281057581
- Sigstore integration time:
-
Permalink:
geosensing/allocator@0458a87f558425c914d8d33a49ce6d4f72c5340d -
Branch / Tag:
refs/heads/master - Owner: https://github.com/geosensing
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0458a87f558425c914d8d33a49ce6d4f72c5340d -
Trigger Event:
workflow_dispatch
-
Statement type: