Metadata-Version: 2.5
Name: property-radar
Version: 0.4.2
Summary: A safe, typed Python client for the PropertyRadar API
Project-URL: Documentation, https://theperrygroup.github.io/property_radar/
Project-URL: Issues, https://github.com/theperrygroup/property_radar/issues
Project-URL: Repository, https://github.com/theperrygroup/property_radar
Author: The Perry Group
License: MIT License
        
        Copyright (c) 2026 The Perry Group
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: api-client,property,propertyradar,real-estate
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.27
Provides-Extra: dev
Requires-Dist: build>=1.2.2; extra == 'dev'
Requires-Dist: detect-secrets>=1.5; extra == 'dev'
Requires-Dist: mypy>=1.15; extra == 'dev'
Requires-Dist: pytest-cov>=6; extra == 'dev'
Requires-Dist: pytest>=8.3; extra == 'dev'
Requires-Dist: pyyaml>=6; extra == 'dev'
Requires-Dist: ruff>=0.11; extra == 'dev'
Requires-Dist: twine>=6; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.6; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.29; extra == 'docs'
Description-Content-Type: text/markdown

# Property Radar Python Client

[![CI](https://github.com/theperrygroup/property_radar/actions/workflows/ci.yml/badge.svg)](https://github.com/theperrygroup/property_radar/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/property-radar.svg)](https://pypi.org/project/property-radar/)
[![Python](https://img.shields.io/pypi/pyversions/property-radar.svg)](https://pypi.org/project/property-radar/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/theperrygroup/property_radar/blob/main/LICENSE)

An unofficial, typed Python client for the
[PropertyRadar API](https://developers.propertyradar.com/api).

> **Important:** PropertyRadar documents its API for end users and restricts
> how its data may be used or redistributed. This library is not affiliated
> with or endorsed by PropertyRadar. Review the vendor terms and obtain any
> needed partner approval before using it in a product for third parties.

## Status

Version `0.4.2` fixes four response and request mismatches that live
PropertyRadar responses showed in `0.4.1`. `totalCost` is accepted as a JSON
integer, a finite JSON number or a decimal string. The bare `{"results": []}`
envelope of a zero-hit preview is accepted. Preview counts follow the provider
(`resultCount` counts purchased rows, `totalResultCount` counts matches).
Buyer-transfer previews request only the free `RadarID` field and restrict the
search to residential property types with the official `PropertyType`
criterion. Paid buyer-transfer calls keep the `0.4.1` criteria and
classification, and a record rejected after billing keeps its billing evidence.
Transaction history reports withheld preview rows and owners and truncated
responses. The four typed contracts get new fingerprints; see the changelog.
The base catalog covers all 37 operations in official API `5.2.0.0`; the
historical Buyer-criterion property/location interface binds separate official
API `5.3.1.0` evidence. The historical transaction interface separates preview
quotes from paid rows, with explicit date, document, and row-count bounds
before billing.
Releases are built once and published through the configured PyPI Trusted Publisher.

## Installation

```bash
pip install property-radar
```

## Safe Quickstart

```python
from property_radar import PropertyRadarClient

criteria = [{"name": "RadarID", "value": ["P0000000"]}]

with PropertyRadarClient(api_key="your-api-key") as client:  # pragma: allowlist secret
    preview = client.properties.search(criteria=criteria)
```

Preview-capable endpoints send `Purchase=0` by default. Persistent list,
import, automation, and webhook operations require `allow_mutations=True`.
Paid requests require both `allow_charges=True` on the client and
`purchase=True` on the method call.

## Typed Transaction Evidence

`client.properties.transactions()` remains the raw, backward-compatible
envelope method. Version `0.2.0` adds
`client.properties.transaction_history()` for immutable records and typed
billing evidence.

The provider documents transaction `Grantor` and `Grantee` as scalar display
strings, so the library preserves each whole value and reports party boundaries
as unknown. Structured current-owner identities can be composed from the
dedicated property-persons endpoint with
`PROPERTY_PERSON_IDENTITY_FIELDS`; they remain separate from any unsupported
person-to-transaction linkage. Pass the persons call's `purchase` choice as
`property_persons_purchase_requested`. `records_withheld` and
`current_owners_withheld` report a preview that withheld its rows or owners,
and `truncated` reports any other response with fewer rows than its total
count.

## Typed Buyer-Transfer Location Evidence

`client.properties.buyer_transfer_match()` builds a fixed
`POST /v1/properties` query with PropertyRadar's documented Buyer Name
(Grantee) criterion, an exact RadarID, bounded geography and recent windows, a
one-result limit, and typed property/location fields. A free preview
(`purchase=False`) requests only `RadarID`, because PropertyRadar returns no
record when a preview asks for any paid field, and adds the official
residential `PropertyType` criterion. A preview match is residential by the
criterion (`residential_basis="property_type_criterion"`); a returned preview
property type outside the five residential types fails closed. A paid call
(`purchase=True`) sends the `0.4.1` criteria without the `PropertyType`
criterion and classifies the returned property type as `0.4.1` did, so a
non-residential type gives `is_residential=False` and `Unknown` gives `None`.
A record rejected after billing raises `BuyerTransferResponseError`, whose
`billing_evidence` keeps the cost and counts. Its scope fingerprint binds the
exact paid criteria, the preview's `PropertyType` criterion, both field
catalogs, limit, and offset, so a preview and the paid request for the same
criteria share one value. The `PropertyType`
criterion on `Purchase=0` follows the official reference and has not been
probed live, so a preview's no-match can also mean a non-residential or
`Unknown` transfer.

`client.properties.historical_buyer_transfer_match()` is the separate
historical interface. It accepts `BuyerTransferMatchCriteria` with an inclusive
`BuyerTransferRecordingDateRange` and `publication_window=None`, including
ordered ranges across multiple years. Its API `5.3.1.0` contract produces
`HistoricalBuyerTransferMatchResult`, `HistoricalBuyerTransferLinkage`, and
`HistoricalBuyerTransferProperty`; historical `zip_five` is an optional exact
five-digit string, preserving leading zeros. Historical scopes bind the mode,
historical contract, and recording-date range. The request is limited to zero
or one result, without pagination; known optional envelope metadata is
validated and discarded rather than retained as raw data. Paid use remains
dual opt-in and single-attempt, with malformed purchase flags rejected before
network I/O.

The result proves only that the provider returned that property for the Buyer
criterion. It does not expose the matching document, structured grantees, or
exact/fuzzy name-match semantics, so it cannot by itself confirm a recorded
grantee or verified purchase.

## Authentication

Pass the token explicitly or set `PROPERTY_RADAR_API_KEY`. The library does not
load `.env` files and never needs an API credential for its test suite.

## Development

```bash
uv sync --all-extras --locked
uv run ruff format --check .
uv run ruff check .
uv run mypy
uv run pytest
uv run mkdocs build --strict --clean
uv build
uv run twine check dist/*
```

See
[CONTRIBUTING.md](https://github.com/theperrygroup/property_radar/blob/main/CONTRIBUTING.md)
and the
[development guide](https://theperrygroup.github.io/property_radar/development/).

## License

This client is licensed under the MIT License. PropertyRadar data and service
access remain governed by PropertyRadar's own agreements.
