aportee 0.1.0__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.
- aportee-0.1.0/LICENSE +21 -0
- aportee-0.1.0/PKG-INFO +160 -0
- aportee-0.1.0/README.md +140 -0
- aportee-0.1.0/pyproject.toml +74 -0
- aportee-0.1.0/pyproject.toml.orig +62 -0
- aportee-0.1.0/src/aportee/__init__.py +11 -0
- aportee-0.1.0/src/aportee/cli.py +534 -0
- aportee-0.1.0/src/aportee/client.py +675 -0
- aportee-0.1.0/src/aportee/format.py +149 -0
- aportee-0.1.0/src/aportee/py.typed +0 -0
aportee-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ammil industries ltd.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
aportee-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aportee
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python client and command-line tool for the à portée access API for Canada: walking, cycling and transit.
|
|
5
|
+
Keywords: aportee,walkability,accessibility,canada,api
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
14
|
+
Classifier: Typing :: Typed
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Project-URL: Homepage, https://aportee.ca/dev/tools/cli/
|
|
17
|
+
Project-URL: Documentation, https://aportee.ca/dev/api/overview/
|
|
18
|
+
Project-URL: Repository, https://github.com/ammil-industries/aportee
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
|
|
21
|
+
# aportee
|
|
22
|
+
|
|
23
|
+
A Python client and command-line tool for the [à portée](https://aportee.ca) access API for
|
|
24
|
+
Canada: walking, cycling and transit minutes to everyday amenities at any point, place and
|
|
25
|
+
amenity search, reference datasets, map images and embeds.
|
|
26
|
+
|
|
27
|
+
Every CLI command has a `--json` mode that prints the API payload, and an exit code that maps
|
|
28
|
+
to the HTTP status, so a script or coding agent can branch on it without parsing text.
|
|
29
|
+
|
|
30
|
+
Documentation: [aportee.ca/dev/tools/cli](https://aportee.ca/dev/tools/cli/) and the
|
|
31
|
+
[API reference](https://aportee.ca/dev/api/overview/).
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
Needs Python 3.11 or later. It has no dependencies outside the standard library.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pipx install aportee # the aportee command
|
|
39
|
+
uvx aportee access 43.25085 -79.81809 # or run it without installing
|
|
40
|
+
pip install aportee # the Python client in a project
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Keys
|
|
44
|
+
|
|
45
|
+
Most read calls work without a key (100 requests a day per IP address). A free key raises
|
|
46
|
+
the limit to 1,000 a day and unlocks batch lookups, map images, walking routes, the name search
|
|
47
|
+
near a point, and transit at other periods, at `p90` (the worst case) or by bike + transit.
|
|
48
|
+
`aportee login` gets one: it prints a link and a code and opens your browser, where you sign
|
|
49
|
+
in and approve. It then prints `export APORTEE_API_KEY=…` (the key is shown once). `--name`
|
|
50
|
+
sets the name shown on the approval page. You can also [sign in](https://aportee.ca/signin)
|
|
51
|
+
and choose **Create a key** on your account page.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
eval "$(aportee login)" # or copy the export line it prints
|
|
55
|
+
export APORTEE_API_KEY=ap_... # or pass --key <k>
|
|
56
|
+
export APORTEE_BASE=https://aportee.ca # another deployment (or --base)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Command line
|
|
60
|
+
|
|
61
|
+
| Command | What it does |
|
|
62
|
+
|---------|--------------|
|
|
63
|
+
| `aportee access <lat> <lon>` | Minutes to each amenity type from a point. `--mode walk\|bike\|transit\|combo` (default `walk`; `combo` is bike + transit), and for transit `--period weekday_peak\|weekday_night\|saturday_midday\|sunday_midday` and `--statistic p50\|p90`. `--include minutes,population,place,narrative,walk_counts` (or `all`), `--types grocery,pharmacy`, `--lang en\|fr`, `--walk-minutes 5-55` for `walk_counts`. |
|
|
64
|
+
| `aportee describe <lat> <lon>` | Just the generated walkability narrative. `--lang en\|fr`. |
|
|
65
|
+
| `aportee where <lat> <lon>` | Nearest populated place. |
|
|
66
|
+
| `aportee find <name>` | Place search. Add `--near <lat,lon>` (keyed) to also search, by name, the POIs reached on foot from there; `--walk-minutes` sets how far (default 15). |
|
|
67
|
+
| `aportee compare <lat,lon> <lat,lon>` | Per-type minutes delta between two points. `--types`, `--mode`, `--period`, `--statistic`. |
|
|
68
|
+
| `aportee routes <lat> <lon> --types grocery,school` | The walked path to the nearest place of each of 1–5 types, routed live (keyed; each type routed counts as one request). |
|
|
69
|
+
| `aportee compass <lat> <lon>` | Each everyday trip's nearest place, its minutes and its direction, and the next places. `--types`. |
|
|
70
|
+
| `aportee batch <file.csv\|->` | Batch lookups from `lat,lon` CSV rows (keyed). `--format json\|geojson`, `--mode`, `--period`, `--statistic`. |
|
|
71
|
+
| `aportee image <lat> <lon>` | Branded map PNG (keyed). `--out FILE`, `--zoom --types --theme --lang -w -h`, `--markers-file FILE` (your own points, up to 500: a CSV of `lat,lon[,label]` or a GeoJSON FeatureCollection). |
|
|
72
|
+
| `aportee embed <lat> <lon>` | iframe snippet. `--zoom --types --theme --lang -w -h --dots 0`, `--markers-file FILE` (up to 20 points, without labels). |
|
|
73
|
+
| `aportee amenities` | Every amenity type with English and French labels. |
|
|
74
|
+
| `aportee reference [canale\|sam]` | Can-ALE and Spatial Access Measures records. `--id`, `--mode`. |
|
|
75
|
+
| `aportee me` | The key's tier, today's limit and what is left. Not counted against the limit. |
|
|
76
|
+
| `aportee login` | Get a free API key by approving it in your browser. `--name`. |
|
|
77
|
+
|
|
78
|
+
`access`, `describe`, `where`, `routes`, `compass`, `image`, `embed` and `reference` also accept `--place "<name>"`
|
|
79
|
+
instead of `<lat> <lon>`. It takes the centre of the first town matching that name (no street
|
|
80
|
+
addresses). Global flags: `--json`, `--key <k>`, `--base <url>`, `--help`.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
aportee access 43.25085 -79.81809 --include all
|
|
84
|
+
aportee access 45.5017 -73.5673 --mode transit --types grocery,pharmacy
|
|
85
|
+
aportee describe --place "Kitchener"
|
|
86
|
+
aportee find "Fickle Fig" --near 48.43,-123.37
|
|
87
|
+
aportee compare 43.25,-79.82 43.65,-79.38 --types grocery,pharmacy
|
|
88
|
+
aportee routes 43.25085 -79.81809 --types grocery,school
|
|
89
|
+
aportee compass 43.25085 -79.81809
|
|
90
|
+
aportee image --place Hamilton --out hamilton.png
|
|
91
|
+
aportee image 53.5465 -113.555 --zoom 15 --markers-file permits.csv --out permits.png
|
|
92
|
+
aportee reference sam 43.25 -79.82 --mode walking
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Exit codes
|
|
96
|
+
|
|
97
|
+
| Code | Meaning |
|
|
98
|
+
|------|---------|
|
|
99
|
+
| `0` | success |
|
|
100
|
+
| `2` | bad input (400 / 422, or bad arguments) |
|
|
101
|
+
| `3` | no data (204) |
|
|
102
|
+
| `4` | outside coverage (404) |
|
|
103
|
+
| `5` | rate limited (429) |
|
|
104
|
+
| `1` | anything else: no key (401), network, 5xx |
|
|
105
|
+
|
|
106
|
+
## Python
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from aportee import Client
|
|
110
|
+
|
|
111
|
+
client = Client() # reads APORTEE_API_KEY; Client(key="ap_...") also works
|
|
112
|
+
|
|
113
|
+
# One point needs no key and returns a dict.
|
|
114
|
+
snapshot = client.access((43.25085, -79.81809), types=["grocery", "pharmacy"])
|
|
115
|
+
print(snapshot["minutes"]["grocery"]) # {'value': 6, 'reason': 'ok'}
|
|
116
|
+
|
|
117
|
+
# A list of points is sent 100 at a time (keyed) and returns a list in the same order.
|
|
118
|
+
results = client.access([(43.25, -79.82), (43.65, -79.38)], include="minutes")
|
|
119
|
+
|
|
120
|
+
client.amenities() # [{'type': 'grocery', 'label': {...}}, ...]
|
|
121
|
+
client.search("Hamilton") # {'places': [...]}
|
|
122
|
+
client.reference("canale", id="35250773")
|
|
123
|
+
client.routes((43.25085, -79.81809), ["grocery", "school"]) # GeoJSON, keyed
|
|
124
|
+
client.compass((43.25085, -79.81809)) # {'cell': ..., 'trips': [...], 'meta': ...}
|
|
125
|
+
client.me() # your tier and what is left of today's limit
|
|
126
|
+
|
|
127
|
+
# A map image with your own points on it (keyed): up to 20 pairs go in the query, more
|
|
128
|
+
# (up to 500), labels or a GeoJSON FeatureCollection are sent as a POST.
|
|
129
|
+
png = client.image(53.5465, -113.555, zoom=15, markers=[(53.5465, -113.555, "Permit 1")])
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Results are plain dicts and lists. With pandas installed, `to_frame` flattens them into a
|
|
133
|
+
DataFrame with dotted columns such as `minutes.grocery.value`:
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
from aportee import to_frame
|
|
137
|
+
|
|
138
|
+
frame = to_frame(results)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
A failed call raises `aportee.ApiError` with `status`, `code` and `detail`.
|
|
142
|
+
`Client().login()` runs the same browser sign-in as `aportee login` and keeps the new key on
|
|
143
|
+
the client.
|
|
144
|
+
|
|
145
|
+
## Development
|
|
146
|
+
|
|
147
|
+
`cli/` is its own uv project, separate from the repository's root Python project (the data
|
|
148
|
+
pipeline). Inside the root venv, the `aportee` command is the pipeline's; run the client with
|
|
149
|
+
`uv run --project cli aportee`. From the repository root:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
uv sync --project cli
|
|
153
|
+
uv run --project cli aportee access 43.25 -79.82 --base http://localhost:4321
|
|
154
|
+
uv run --project cli pytest cli
|
|
155
|
+
uv run --project cli ruff check cli && uv run --project cli ruff format --check cli
|
|
156
|
+
uv run --project cli ty check --project cli
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Releases are published to PyPI by `.github/workflows/publish-python.yml` when a `py-v*` tag
|
|
160
|
+
is pushed; the tag must match `version` in `cli/pyproject.toml`.
|
aportee-0.1.0/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# aportee
|
|
2
|
+
|
|
3
|
+
A Python client and command-line tool for the [à portée](https://aportee.ca) access API for
|
|
4
|
+
Canada: walking, cycling and transit minutes to everyday amenities at any point, place and
|
|
5
|
+
amenity search, reference datasets, map images and embeds.
|
|
6
|
+
|
|
7
|
+
Every CLI command has a `--json` mode that prints the API payload, and an exit code that maps
|
|
8
|
+
to the HTTP status, so a script or coding agent can branch on it without parsing text.
|
|
9
|
+
|
|
10
|
+
Documentation: [aportee.ca/dev/tools/cli](https://aportee.ca/dev/tools/cli/) and the
|
|
11
|
+
[API reference](https://aportee.ca/dev/api/overview/).
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
Needs Python 3.11 or later. It has no dependencies outside the standard library.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pipx install aportee # the aportee command
|
|
19
|
+
uvx aportee access 43.25085 -79.81809 # or run it without installing
|
|
20
|
+
pip install aportee # the Python client in a project
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Keys
|
|
24
|
+
|
|
25
|
+
Most read calls work without a key (100 requests a day per IP address). A free key raises
|
|
26
|
+
the limit to 1,000 a day and unlocks batch lookups, map images, walking routes, the name search
|
|
27
|
+
near a point, and transit at other periods, at `p90` (the worst case) or by bike + transit.
|
|
28
|
+
`aportee login` gets one: it prints a link and a code and opens your browser, where you sign
|
|
29
|
+
in and approve. It then prints `export APORTEE_API_KEY=…` (the key is shown once). `--name`
|
|
30
|
+
sets the name shown on the approval page. You can also [sign in](https://aportee.ca/signin)
|
|
31
|
+
and choose **Create a key** on your account page.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
eval "$(aportee login)" # or copy the export line it prints
|
|
35
|
+
export APORTEE_API_KEY=ap_... # or pass --key <k>
|
|
36
|
+
export APORTEE_BASE=https://aportee.ca # another deployment (or --base)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Command line
|
|
40
|
+
|
|
41
|
+
| Command | What it does |
|
|
42
|
+
|---------|--------------|
|
|
43
|
+
| `aportee access <lat> <lon>` | Minutes to each amenity type from a point. `--mode walk\|bike\|transit\|combo` (default `walk`; `combo` is bike + transit), and for transit `--period weekday_peak\|weekday_night\|saturday_midday\|sunday_midday` and `--statistic p50\|p90`. `--include minutes,population,place,narrative,walk_counts` (or `all`), `--types grocery,pharmacy`, `--lang en\|fr`, `--walk-minutes 5-55` for `walk_counts`. |
|
|
44
|
+
| `aportee describe <lat> <lon>` | Just the generated walkability narrative. `--lang en\|fr`. |
|
|
45
|
+
| `aportee where <lat> <lon>` | Nearest populated place. |
|
|
46
|
+
| `aportee find <name>` | Place search. Add `--near <lat,lon>` (keyed) to also search, by name, the POIs reached on foot from there; `--walk-minutes` sets how far (default 15). |
|
|
47
|
+
| `aportee compare <lat,lon> <lat,lon>` | Per-type minutes delta between two points. `--types`, `--mode`, `--period`, `--statistic`. |
|
|
48
|
+
| `aportee routes <lat> <lon> --types grocery,school` | The walked path to the nearest place of each of 1–5 types, routed live (keyed; each type routed counts as one request). |
|
|
49
|
+
| `aportee compass <lat> <lon>` | Each everyday trip's nearest place, its minutes and its direction, and the next places. `--types`. |
|
|
50
|
+
| `aportee batch <file.csv\|->` | Batch lookups from `lat,lon` CSV rows (keyed). `--format json\|geojson`, `--mode`, `--period`, `--statistic`. |
|
|
51
|
+
| `aportee image <lat> <lon>` | Branded map PNG (keyed). `--out FILE`, `--zoom --types --theme --lang -w -h`, `--markers-file FILE` (your own points, up to 500: a CSV of `lat,lon[,label]` or a GeoJSON FeatureCollection). |
|
|
52
|
+
| `aportee embed <lat> <lon>` | iframe snippet. `--zoom --types --theme --lang -w -h --dots 0`, `--markers-file FILE` (up to 20 points, without labels). |
|
|
53
|
+
| `aportee amenities` | Every amenity type with English and French labels. |
|
|
54
|
+
| `aportee reference [canale\|sam]` | Can-ALE and Spatial Access Measures records. `--id`, `--mode`. |
|
|
55
|
+
| `aportee me` | The key's tier, today's limit and what is left. Not counted against the limit. |
|
|
56
|
+
| `aportee login` | Get a free API key by approving it in your browser. `--name`. |
|
|
57
|
+
|
|
58
|
+
`access`, `describe`, `where`, `routes`, `compass`, `image`, `embed` and `reference` also accept `--place "<name>"`
|
|
59
|
+
instead of `<lat> <lon>`. It takes the centre of the first town matching that name (no street
|
|
60
|
+
addresses). Global flags: `--json`, `--key <k>`, `--base <url>`, `--help`.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
aportee access 43.25085 -79.81809 --include all
|
|
64
|
+
aportee access 45.5017 -73.5673 --mode transit --types grocery,pharmacy
|
|
65
|
+
aportee describe --place "Kitchener"
|
|
66
|
+
aportee find "Fickle Fig" --near 48.43,-123.37
|
|
67
|
+
aportee compare 43.25,-79.82 43.65,-79.38 --types grocery,pharmacy
|
|
68
|
+
aportee routes 43.25085 -79.81809 --types grocery,school
|
|
69
|
+
aportee compass 43.25085 -79.81809
|
|
70
|
+
aportee image --place Hamilton --out hamilton.png
|
|
71
|
+
aportee image 53.5465 -113.555 --zoom 15 --markers-file permits.csv --out permits.png
|
|
72
|
+
aportee reference sam 43.25 -79.82 --mode walking
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Exit codes
|
|
76
|
+
|
|
77
|
+
| Code | Meaning |
|
|
78
|
+
|------|---------|
|
|
79
|
+
| `0` | success |
|
|
80
|
+
| `2` | bad input (400 / 422, or bad arguments) |
|
|
81
|
+
| `3` | no data (204) |
|
|
82
|
+
| `4` | outside coverage (404) |
|
|
83
|
+
| `5` | rate limited (429) |
|
|
84
|
+
| `1` | anything else: no key (401), network, 5xx |
|
|
85
|
+
|
|
86
|
+
## Python
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
from aportee import Client
|
|
90
|
+
|
|
91
|
+
client = Client() # reads APORTEE_API_KEY; Client(key="ap_...") also works
|
|
92
|
+
|
|
93
|
+
# One point needs no key and returns a dict.
|
|
94
|
+
snapshot = client.access((43.25085, -79.81809), types=["grocery", "pharmacy"])
|
|
95
|
+
print(snapshot["minutes"]["grocery"]) # {'value': 6, 'reason': 'ok'}
|
|
96
|
+
|
|
97
|
+
# A list of points is sent 100 at a time (keyed) and returns a list in the same order.
|
|
98
|
+
results = client.access([(43.25, -79.82), (43.65, -79.38)], include="minutes")
|
|
99
|
+
|
|
100
|
+
client.amenities() # [{'type': 'grocery', 'label': {...}}, ...]
|
|
101
|
+
client.search("Hamilton") # {'places': [...]}
|
|
102
|
+
client.reference("canale", id="35250773")
|
|
103
|
+
client.routes((43.25085, -79.81809), ["grocery", "school"]) # GeoJSON, keyed
|
|
104
|
+
client.compass((43.25085, -79.81809)) # {'cell': ..., 'trips': [...], 'meta': ...}
|
|
105
|
+
client.me() # your tier and what is left of today's limit
|
|
106
|
+
|
|
107
|
+
# A map image with your own points on it (keyed): up to 20 pairs go in the query, more
|
|
108
|
+
# (up to 500), labels or a GeoJSON FeatureCollection are sent as a POST.
|
|
109
|
+
png = client.image(53.5465, -113.555, zoom=15, markers=[(53.5465, -113.555, "Permit 1")])
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Results are plain dicts and lists. With pandas installed, `to_frame` flattens them into a
|
|
113
|
+
DataFrame with dotted columns such as `minutes.grocery.value`:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from aportee import to_frame
|
|
117
|
+
|
|
118
|
+
frame = to_frame(results)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
A failed call raises `aportee.ApiError` with `status`, `code` and `detail`.
|
|
122
|
+
`Client().login()` runs the same browser sign-in as `aportee login` and keeps the new key on
|
|
123
|
+
the client.
|
|
124
|
+
|
|
125
|
+
## Development
|
|
126
|
+
|
|
127
|
+
`cli/` is its own uv project, separate from the repository's root Python project (the data
|
|
128
|
+
pipeline). Inside the root venv, the `aportee` command is the pipeline's; run the client with
|
|
129
|
+
`uv run --project cli aportee`. From the repository root:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
uv sync --project cli
|
|
133
|
+
uv run --project cli aportee access 43.25 -79.82 --base http://localhost:4321
|
|
134
|
+
uv run --project cli pytest cli
|
|
135
|
+
uv run --project cli ruff check cli && uv run --project cli ruff format --check cli
|
|
136
|
+
uv run --project cli ty check --project cli
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Releases are published to PyPI by `.github/workflows/publish-python.yml` when a `py-v*` tag
|
|
140
|
+
is pushed; the tag must match `version` in `cli/pyproject.toml`.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "aportee"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Python client and command-line tool for the à portée access API for Canada: walking, cycling and transit."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
keywords = [
|
|
10
|
+
"aportee",
|
|
11
|
+
"walkability",
|
|
12
|
+
"accessibility",
|
|
13
|
+
"canada",
|
|
14
|
+
"api",
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"Environment :: Console",
|
|
22
|
+
"Topic :: Scientific/Engineering :: GIS",
|
|
23
|
+
"Typing :: Typed",
|
|
24
|
+
]
|
|
25
|
+
dependencies = []
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
Homepage = "https://aportee.ca/dev/tools/cli/"
|
|
29
|
+
Documentation = "https://aportee.ca/dev/api/overview/"
|
|
30
|
+
Repository = "https://github.com/ammil-industries/aportee"
|
|
31
|
+
|
|
32
|
+
[project.scripts]
|
|
33
|
+
aportee = "aportee.cli:main"
|
|
34
|
+
|
|
35
|
+
[dependency-groups]
|
|
36
|
+
dev = [
|
|
37
|
+
"pandas==3.0.6",
|
|
38
|
+
"pytest==9.1.1",
|
|
39
|
+
"ruff==0.17.0",
|
|
40
|
+
"ty==0.0.86",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[build-system]
|
|
44
|
+
requires = ["uv_build==0.13.0"]
|
|
45
|
+
build-backend = "uv_build"
|
|
46
|
+
|
|
47
|
+
[tool.ruff]
|
|
48
|
+
line-length = 100
|
|
49
|
+
target-version = "py311"
|
|
50
|
+
|
|
51
|
+
[tool.ruff.lint]
|
|
52
|
+
select = [
|
|
53
|
+
"E",
|
|
54
|
+
"F",
|
|
55
|
+
"I",
|
|
56
|
+
"UP",
|
|
57
|
+
"B",
|
|
58
|
+
"SIM",
|
|
59
|
+
"D",
|
|
60
|
+
]
|
|
61
|
+
ignore = ["D107"]
|
|
62
|
+
|
|
63
|
+
[tool.ruff.lint.pydocstyle]
|
|
64
|
+
convention = "google"
|
|
65
|
+
|
|
66
|
+
[tool.ruff.lint.per-file-ignores]
|
|
67
|
+
"tests/**" = ["D"]
|
|
68
|
+
|
|
69
|
+
[tool.pytest.ini_options]
|
|
70
|
+
testpaths = ["tests"]
|
|
71
|
+
addopts = "-ra"
|
|
72
|
+
|
|
73
|
+
[tool.ty.environment]
|
|
74
|
+
python-version = "3.11"
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "aportee"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Python client and command-line tool for the à portée access API for Canada: walking, cycling and transit."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
keywords = ["aportee", "walkability", "accessibility", "canada", "api"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Programming Language :: Python :: 3",
|
|
12
|
+
"Programming Language :: Python :: 3.11",
|
|
13
|
+
"Programming Language :: Python :: 3.12",
|
|
14
|
+
"Programming Language :: Python :: 3.13",
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Topic :: Scientific/Engineering :: GIS",
|
|
17
|
+
"Typing :: Typed",
|
|
18
|
+
]
|
|
19
|
+
dependencies = []
|
|
20
|
+
|
|
21
|
+
[project.urls]
|
|
22
|
+
Homepage = "https://aportee.ca/dev/tools/cli/"
|
|
23
|
+
Documentation = "https://aportee.ca/dev/api/overview/"
|
|
24
|
+
Repository = "https://github.com/ammil-industries/aportee"
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
aportee = "aportee.cli:main"
|
|
28
|
+
|
|
29
|
+
[dependency-groups]
|
|
30
|
+
dev = [
|
|
31
|
+
# to_frame's optional dependency, for its tests.
|
|
32
|
+
"pandas==3.0.6",
|
|
33
|
+
"pytest==9.1.1",
|
|
34
|
+
"ruff==0.17.0",
|
|
35
|
+
"ty==0.0.86",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[build-system]
|
|
39
|
+
requires = ["uv_build==0.13.0"]
|
|
40
|
+
build-backend = "uv_build"
|
|
41
|
+
|
|
42
|
+
[tool.ruff]
|
|
43
|
+
line-length = 100
|
|
44
|
+
target-version = "py311"
|
|
45
|
+
|
|
46
|
+
[tool.ruff.lint]
|
|
47
|
+
select = ["E", "F", "I", "UP", "B", "SIM", "D"]
|
|
48
|
+
# Google style documents constructor arguments on the class.
|
|
49
|
+
ignore = ["D107"]
|
|
50
|
+
|
|
51
|
+
[tool.ruff.lint.pydocstyle]
|
|
52
|
+
convention = "google"
|
|
53
|
+
|
|
54
|
+
[tool.ruff.lint.per-file-ignores]
|
|
55
|
+
"tests/**" = ["D"]
|
|
56
|
+
|
|
57
|
+
[tool.pytest.ini_options]
|
|
58
|
+
testpaths = ["tests"]
|
|
59
|
+
addopts = "-ra"
|
|
60
|
+
|
|
61
|
+
[tool.ty.environment]
|
|
62
|
+
python-version = "3.11"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Python client and command-line tool for the à portée access API: walk, bike and transit.
|
|
2
|
+
|
|
3
|
+
Example:
|
|
4
|
+
>>> from aportee import Client
|
|
5
|
+
>>> Client().access((43.25085, -79.81809), types=["grocery"])["minutes"]["grocery"]
|
|
6
|
+
{'value': 6, 'reason': 'ok'}
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from aportee.client import ApiError, Client, LoginError, to_frame
|
|
10
|
+
|
|
11
|
+
__all__ = ["ApiError", "Client", "LoginError", "to_frame"]
|