Cross-source join keys for Australian public data — postcode ↔ state crosswalks, state-code normalisation, more coming. Foundation for tools that talk to multiple AU government data sources.
Project description
aus-identity
Cross-source join keys for Australian public data. The foundation layer for tools that need to talk to multiple AU government data sources at once (ABS demographics + ATO income + APRA banking + au-weather climate + ASIC company register + RBA monetary stats), or for any application that has to map between Australia's postcode and state/territory conventions.
What it does today (v0.1.0)
- Postcode → state:
postcode_to_state("2000")→"NSW". Handles the three ACT-inside-NSW carve-outs (0200-0299,2600-2618,2900-2920) correctly. - Postcode normalisation: accept
"2000",2000," 2000 ","0800",800— all return canonical 4-digit string form. - Postcode validation:
is_valid_postcode(x)returns a boolean and never raises — safe for filtering arbitrary input. - State code normalisation:
normalize_state("nsw")/normalize_state("New South Wales")/normalize_state("AU-VIC")/normalize_state("Tassie")→ canonical short code. - Full state name:
state_full_name("NSW")→"New South Wales".
Install
pip install aus-identity
# or
uv add aus-identity
Zero runtime dependencies. Pure Python. Wheel is < 20 KB.
Quick examples
from aus_identity import (
postcode_to_state,
normalize_postcode,
is_valid_postcode,
normalize_state,
state_full_name,
)
# Postcode → state
postcode_to_state("2000") # "NSW" (Sydney CBD)
postcode_to_state("3000") # "VIC" (Melbourne CBD)
postcode_to_state("2600") # "ACT" (Parliament House — not NSW)
postcode_to_state("0800") # "NT" (Darwin)
postcode_to_state(6000) # "WA" (int input also accepted)
# Normalisation
normalize_postcode(" 2000 ") # "2000"
normalize_postcode(800) # "0800" (3-digit shorthand padded)
# Validation (never raises)
is_valid_postcode("2000") # True
is_valid_postcode("ABCD") # False
is_valid_postcode(None) # False
# State normalisation
normalize_state("nsw") # "NSW"
normalize_state("New South Wales") # "NSW"
normalize_state("AU-VIC") # "VIC"
normalize_state("Tassie") # "TAS"
normalize_state("New_South_Wales") # "NSW" (LLM payload form)
# Full names
state_full_name("NSW") # "New South Wales"
state_full_name("act") # "Australian Capital Territory"
Why this exists
The AU public-data MCP stack (abs-mcp, rba-mcp, ato-mcp, apra-mcp, aihw-mcp, asic-mcp, au-weather-mcp) lets an LLM agent talk to any single Australian government data source. But each agency uses its own identifier conventions:
- ABS uses ASGS region codes (
1GSYDfor Greater Sydney,101011001for an SA1) - ATO uses 4-digit postcodes
- APRA uses ABNs
- ASIC uses licence numbers
- au-weather uses location keys and lat/long
- RBA uses F-table IDs and series codes
To use any two of these together — "what's the median household income vs unemployment rate in postcode 2000?" — something has to translate between identifier systems. aus-identity is that something. v0.1 starts with the most-used crosswalk (postcode ↔ state); v0.2+ will extend to ASGS / ABN / ANZSIC / ANZSCO.
Source of truth
Postcode → state mappings are sourced from Australia Post's public postcode boundary publication and cross-checked against ABS ASGS Edition 3 (2021) state-of-residence assignments. The three ACT-inside-NSW ranges and the Vic/Qld PO Box blocks are handled explicitly. Coverage is 99%+ of currently-active AU postcodes.
For exact suburb-level precision (e.g. which side of an ACT/NSW boundary a specific delivery address falls), use ABS ASGS sub-state codes — planned for v0.2 of this package.
Roadmap
- v0.1.0 (this release) — postcode + state crosswalks
- v0.2 — ASGS 2021 sub-state crosswalk (SA1 ↔ SA2 ↔ SA3 ↔ SA4 ↔ GCCSA ↔ state)
- v0.3 — ABN ↔ ACN ↔ ACNC charity-ID crosswalk
- v0.4 — ANZSIC industry codes + ANZSCO occupation codes
License
MIT.
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 aus_identity-0.1.0.tar.gz.
File metadata
- Download URL: aus_identity-0.1.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04b4d648b9181f11a09b9e9e54ed78a0719820846930f0154ab7d722e2f8b7ab
|
|
| MD5 |
1a026ed921597ef26f386a62427a767e
|
|
| BLAKE2b-256 |
957ab2606392c2e9943336751855fecb925a9c1319c0123d06c0c71d114d0beb
|
Provenance
The following attestation bundles were made for aus_identity-0.1.0.tar.gz:
Publisher:
release.yml on Bigred97/aus-identity
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aus_identity-0.1.0.tar.gz -
Subject digest:
04b4d648b9181f11a09b9e9e54ed78a0719820846930f0154ab7d722e2f8b7ab - Sigstore transparency entry: 1541593124
- Sigstore integration time:
-
Permalink:
Bigred97/aus-identity@bc1ea1c6f6652d7675c0585748c23f4b3d4a27d5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Bigred97
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bc1ea1c6f6652d7675c0585748c23f4b3d4a27d5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aus_identity-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aus_identity-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 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 |
1c95f2522a9d7244232854cd0af3aeeb0a526c70db56ceb3e9fdf6a1257c8218
|
|
| MD5 |
9bc71d95df2fb68b9a126e41f9277383
|
|
| BLAKE2b-256 |
1f4bd9db0cbb5800cbd9558e4f11ea5e5cf3cf5f80d3f554aa698c48ff05036b
|
Provenance
The following attestation bundles were made for aus_identity-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Bigred97/aus-identity
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aus_identity-0.1.0-py3-none-any.whl -
Subject digest:
1c95f2522a9d7244232854cd0af3aeeb0a526c70db56ceb3e9fdf6a1257c8218 - Sigstore transparency entry: 1541593197
- Sigstore integration time:
-
Permalink:
Bigred97/aus-identity@bc1ea1c6f6652d7675c0585748c23f4b3d4a27d5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Bigred97
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bc1ea1c6f6652d7675c0585748c23f4b3d4a27d5 -
Trigger Event:
push
-
Statement type: