Python connector for the public and professional 1dex API surface: overview, subscriber address details, autocomplete, score, preview, account usage, and map routes.
Project description
1dex-connector
Python connector for the public and professional 1dex.fr API surface.
Install the PyPI distribution:
python -m pip install 1dex-connector
The distribution name is 1dex-connector; the Python import package is onedex.
from onedex import OneDexClient
Public reads
Public endpoints such as overview, autocomplete, score, preview, communes, and map can be called without an API key within public quotas.
from onedex import OneDexClient
client = OneDexClient()
overview = client.overview.address({
"address": "10 rue des cordeliers aix",
"dvf_radius_m": 600,
})
suggestions = client.autocomplete.address({
"q": "10 rue des cordeliers aix",
"limit": 5,
})
score = client.score.address({
"items": [{"address": "10 rue des cordeliers aix"}],
})
viewport = client.map.viewport({
"layers": "context,iris",
"address": "10 rue des cordeliers aix",
})
Auth, purchase, and detailed reads
Complete address details and unlock flows require an active professional 1dex subscription. Purchase and checkout happen on 1dex.fr; once the professional account is active, create an API key at https://1dex.fr/compte/api.
Pass the key explicitly or through ONEDEX_API_KEY:
import os
from onedex import OneDexApiError, OneDexClient
client = OneDexClient(api_key=os.getenv("ONEDEX_API_KEY"))
Recommended subscriber flow:
- Check subscription state, quota windows, credits, active grants, and recent consumptions with
client.account.usage(). - Try
client.address.details(...)with an address, parcel, coordinates, or anormalized_address_key. - If the API raises
address_unlock_required, callclient.address.unlock(...)with the returnednormalized_address_key, or post the returnedunlock_requestobject when present. - Read the detailed address again, or follow the returned
details_url.
usage = client.account.usage()
try:
details = client.address.details({
"address": "10 rue des cordeliers aix",
"fields": ["summary", "rail"],
})
except OneDexApiError as error:
if error.status != 402 or error.body.get("error") != "address_unlock_required":
raise
unlock_request = error.body.get("unlock_request")
if unlock_request:
unlock = client.address.unlock(unlock_request)
else:
unlock = client.address.unlock({
"normalized_address_key": error.body["normalized_address_key"],
})
details_url = unlock.get("details_url")
if details_url:
details = client.request("GET", details_url)
else:
details = client.address.details({
"normalized_address_key": unlock["normalized_address_key"],
"fields": ["summary", "rail"],
})
Common professional API errors:
invalid_api_key: the API key is missing, invalid, or revoked.api_subscription_required: the account needs an active subscription.api_professional_required: the endpoint requires a professional plan.address_unlock_required: the detailed address must be unlocked before reading.insufficient_credits: the account has no remaining address credits for the requested unlock.
Helpers
The client exposes helpers for the current /api/v1 routes:
client.overview.address(...)client.address.details(...)client.address.unlock(...)client.account.usage()client.autocomplete.address(...)client.communes.search(...)client.score.address(...),client.score.compare(...),client.score.grid(...),client.score.addressSuggest(...)client.preview.byPath(...)client.addressPages.state(...)client.map.layer(...),client.map.viewport(...),client.map.focus.address(...),client.map.focus.public_location(...),client.map.focus.publicLocation(...),client.map.focus.parcelle(...),client.map.focus.parcelles(...),client.map.focus.feature(...)
Project details
Release history Release notifications | RSS feed
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 1dex_connector-0.1.3.tar.gz.
File metadata
- Download URL: 1dex_connector-0.1.3.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed4f4817e837f8151531628bebbe4adbcd4800c0a28b0850f03b06557851abb3
|
|
| MD5 |
5d7ea0a7d4ebe4f34c7846b6c5f28eea
|
|
| BLAKE2b-256 |
0a126fbca56ff86ea9b581e050fc158c63d4466d9dff1986390d1ef947ad7167
|
Provenance
The following attestation bundles were made for 1dex_connector-0.1.3.tar.gz:
Publisher:
pypi-publish.yml on blipn/1dex-connector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
1dex_connector-0.1.3.tar.gz -
Subject digest:
ed4f4817e837f8151531628bebbe4adbcd4800c0a28b0850f03b06557851abb3 - Sigstore transparency entry: 1851312165
- Sigstore integration time:
-
Permalink:
blipn/1dex-connector@e3e053caf954e86b4e207423b43c9d50c6a14abc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/blipn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@e3e053caf954e86b4e207423b43c9d50c6a14abc -
Trigger Event:
push
-
Statement type:
File details
Details for the file 1dex_connector-0.1.3-py3-none-any.whl.
File metadata
- Download URL: 1dex_connector-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6da8522e37579cff01e601b45ab419bb44be863c3ec43485a4eb2be5a1a7318e
|
|
| MD5 |
ff01d8e090bb731cab096a074e3a53ef
|
|
| BLAKE2b-256 |
46d66fecd961c7f67640412c0b004ef8c0e119fb1be2ea26f8ecdd4211853e8c
|
Provenance
The following attestation bundles were made for 1dex_connector-0.1.3-py3-none-any.whl:
Publisher:
pypi-publish.yml on blipn/1dex-connector
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
1dex_connector-0.1.3-py3-none-any.whl -
Subject digest:
6da8522e37579cff01e601b45ab419bb44be863c3ec43485a4eb2be5a1a7318e - Sigstore transparency entry: 1851312429
- Sigstore integration time:
-
Permalink:
blipn/1dex-connector@e3e053caf954e86b4e207423b43c9d50c6a14abc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/blipn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@e3e053caf954e86b4e207423b43c9d50c6a14abc -
Trigger Event:
push
-
Statement type: