Metadata-Version: 2.1
Name: auspost
Version: 0.1.0
Summary: A quick module for searching and pulling suburb data from the Australia Post website.
Keywords: australia post,suburb,postcode
Author-Email: James Hodgkinson <james@terminaloutcomes.com>
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <4.0,>=3.12
Requires-Dist: MechanicalSoup>=1.1.0
Requires-Dist: lxml>=4.8
Description-Content-Type: text/markdown

# Australia Post data grabber

A quick module for searching and pulling suburb data from the Australia Post website.

## Development

This repository now uses `uv` for package management.

```bash
uv sync --dev
uv run ruff check .
uv run ty check
uv run pytest
```

## Usage

Example below, it's pretty simple and yields namedtuples:

```python
import auspost
for data in auspost.search_postcode("Sydney"):
        print(data)
AusPostData(postcode='2055', suburb='NORTH SYDNEY', state='NSW')
AusPostData(postcode='2059', suburb='NORTH SYDNEY', state='NSW')
AusPostData(postcode='2060', suburb='NORTH SYDNEY', state='NSW')
AusPostData(postcode='2060', suburb='NORTH SYDNEY SHOPPINGWORLD', state='NSW')
AusPostData(postcode='2001', suburb='SYDNEY', state='NSW')
AusPostData(postcode='2000', suburb='SYDNEY', state='NSW')
AusPostData(postcode='2020', suburb='SYDNEY DOMESTIC AIRPORT', state='NSW')
AusPostData(postcode='2020', suburb='SYDNEY INTERNATIONAL AIRPORT', state='NSW')
AusPostData(postcode='2129', suburb='SYDNEY MARKETS', state='NSW')
AusPostData(postcode='2127', suburb='SYDNEY OLYMPIC PARK', state='NSW')
AusPostData(postcode='1235', suburb='SYDNEY SOUTH', state='NSW')
AusPostData(postcode='2000', suburb='SYDNEY SOUTH', state='NSW')
AusPostData(postcode='2006', suburb='SYDNEY UNIVERSITY', state='NSW')
AusPostData(postcode='2006', suburb='THE UNIVERSITY OF SYDNEY', state='NSW')
AusPostData(postcode='1466', suburb='UNSW SYDNEY', state='NSW')
```

## Errors

It'll raise a `RunTimeError` if something goes wrong with fetching the data

## Changelog

* 2019-11-16 - Changed from a namedtuple response to a dict because... I don't even know why I was returning them at the time.
* 2021-01-23 - Fixed example code typo
* 2022-03-28 - Adding typing, bumped to 0.0.10
* 2022-06-04 - v0.0.11 - Added more typing, more testing.
* 2026-03-24 - v0.1.0 - Switched package management to uv and replaced validation with ruff, ty, and pytest.
