Skip to content

Standalone transaction-history queries

HistoryTransactionalClient remains exported from wfrmls. It is a standalone compatibility class: WFRMLSClient has no history attribute. The interface is covered by mocked request tests; current provider availability and account access have not been verified.

Construct the client and query a page

HistoryTransactionalClient(bearer_token=None, base_url=None) requires an explicit token or WFRMLS_BEARER_TOKEN at construction. Missing credentials raise AuthenticationError. Shared transport and response behavior is described in BaseClient.

get_history_transactions(top=None, skip=None, filter_query=None, select=None, orderby=None, expand=None, count=None) requests the HistoryTransactional collection. It returns handled provider JSON, commonly a dictionary with value.

Parameter Type Default Request behavior
top int \| None None $top; values above 200 are clamped
skip int \| None None $skip, unchanged
filter_query str \| None None Raw $filter
select list[str] \| str \| None None $select; lists are joined with commas
orderby str \| None None Raw $orderby
expand list[str] \| str \| None None $expand; lists are joined with commas
count bool \| None None Lowercase $count value

Omitted arguments are not sent. There is no automatic pagination, date validation, filter escaping, or guarantee that the server accepts the named fields.

This mocked example checks an inclusive sale-date filter without a provider call:

from datetime import date
from unittest.mock import patch
from wfrmls import HistoryTransactionalClient

with patch.object(HistoryTransactionalClient, "get", return_value={"value": []}) as request:
    history = HistoryTransactionalClient(bearer_token="example-token")
    response = history.get_sales_by_date_range(
        date(2026, 1, 1), date(2026, 1, 31), top=10
    )
    assert response == {"value": []}
    request.assert_called_once_with(
        "HistoryTransactional",
        params={
            "$top": 10,
            "$filter": (
                "TransactionType eq 'Sale' and CloseDate ge '2026-01-01' "
                "and CloseDate le '2026-01-31'"
            ),
        },
    )

Transaction and sale helpers

Method Parameters and defaults Request behavior
get_history_transaction transaction_key: str Quoted key URL HistoryTransactional('<key>'), without response normalization
get_transactions_for_property listing_key: str, **kwargs Quoted ListingKey filter
get_sales_by_price_range min_price=None, max_price=None, **kwargs Sale type plus inclusive ClosePrice ge/le bounds
get_sales_by_date_range start_date, end_date, **kwargs Sale type plus inclusive quoted CloseDate ge/le bounds
get_recent_sales days_back=30, **kwargs Sale type and CloseDate ge a local naive datetime cutoff
get_transactions_by_city city: str, **kwargs Quoted City filter
get_closed_transactions **kwargs Status eq 'Closed'
get_transactions_with_property **kwargs $expand=Property
get_modified_transactions since: str \| date \| datetime, **kwargs Quoted ModificationTimestamp gt cutoff

Except for the single-key lookup, these helpers return one collection response. Property, price, date, recent-sale, and city helpers combine an existing filter_query with and without added grouping. They do not calculate market trends or retrieve every sale.

start_date and end_date accept strings, dates, or datetimes. Dates and datetimes use isoformat(); strings are unchanged, and the bounds are quoted. get_recent_sales() subtracts days from local datetime.now(), without UTC conversion.

Modification and fixed-keyword limits

get_modified_transactions() sends strings unchanged, expands dates to midnight with Z, and appends Z to datetime isoformat() without converting its timezone. Prefer a normalized UTC string; an aware datetime can produce two timezone designators.

Do not pass filter_query to get_closed_transactions() or get_modified_transactions(), or expand to get_transactions_with_property(). Those helpers supply the keyword themselves; duplicate keywords raise TypeError. Other **kwargs must match get_history_transactions().

Keys and string filter values are interpolated without escaping. HistoryTransactionType and HistoryStatus contain package constants; they do not certify current provider values. Pass .value when using them as filter text.

See compatibility clients, provider verification, and response conventions.

Generated signatures and constants

HistoryTransactional client for WFRMLS API.

Classes

HistoryStatus

Bases: Enum

History status options.

HistoryTransactionType

Bases: Enum

History transaction type options.

HistoryTransactionalClient

HistoryTransactionalClient(
    bearer_token: Optional[str] = None, base_url: Optional[str] = None
)

Bases: BaseClient

Standalone compatibility interface for HistoryTransactional requests.

WFRMLSClient has no history attribute. Exported methods and mocked tests establish request behavior, not current provider availability or permissions.

Parameters:

Name Type Description Default
bearer_token Optional[str]

Explicit token, or None to use WFRMLS_BEARER_TOKEN.

None
base_url Optional[str]

OData service root, or None for the package default.

None

Raises:

Type Description
AuthenticationError

If neither an explicit nor environment token exists.

Methods:

get_closed_transactions
get_closed_transactions(**kwargs: Any) -> Dict[str, Any]

Filter Status eq 'Closed' on a history collection page.

Parameters:

Name Type Description Default
**kwargs Any

Collection parameters, excluding filter_query.

{}

Returns:

Type Description
Dict[str, Any]

Provider JSON; use the collection method for a combined custom filter.

get_history_transaction
get_history_transaction(transaction_key: str) -> Dict[str, Any]

Request HistoryTransactional('') without response normalization.

Parameters:

Name Type Description Default
transaction_key str

String inserted without escaping into a quoted key URL.

required

Returns:

Type Description
Dict[str, Any]

Handled provider JSON.

get_history_transactions
get_history_transactions(
    top: Optional[int] = None,
    skip: Optional[int] = None,
    filter_query: Optional[str] = None,
    select: Optional[Union[List[str], str]] = None,
    orderby: Optional[str] = None,
    expand: Optional[Union[List[str], str]] = None,
    count: Optional[bool] = None,
) -> Dict[str, Any]

Request one HistoryTransactional page with named OData parameters.

Parameters:

Name Type Description Default
top Optional[int]

Optional $top; values above 200 are clamped to 200.

None
skip Optional[int]

Optional $skip offset, passed unchanged.

None
filter_query Optional[str]

Optional raw $filter expression.

None
select Optional[Union[List[str], str]]

Optional field list or comma-separated $select string.

None
orderby Optional[str]

Optional raw $orderby expression.

None
expand Optional[Union[List[str], str]]

Optional relationship list or comma-separated $expand string.

None
count Optional[bool]

Optional $count, converted to lowercase true or false.

None

Returns:

Type Description
Dict[str, Any]

Parsed JSON dictionary from one request, commonly containing value.

Dict[str, Any]

Counts, next links, and individual fields are server-provided and optional.

Raises:

Type Description
WFRMLSError

For shared HTTP or transport failures.

get_modified_transactions
get_modified_transactions(
    since: Union[str, date, datetime], **kwargs: Any
) -> Dict[str, Any]

Filter ModificationTimestamp after a quoted cutoff.

Parameters:

Name Type Description Default
since Union[str, date, datetime]

String sent unchanged; date becomes midnight Z; datetime becomes isoformat() plus Z without converting its timezone.

required
**kwargs Any

Collection parameters, excluding filter_query.

{}

Returns:

Type Description
Dict[str, Any]

Provider JSON from one page. Prefer a normalized UTC string.

get_recent_sales
get_recent_sales(days_back: int = 30, **kwargs: Any) -> Dict[str, Any]

Filter Sale transactions since a local naive datetime cutoff.

Parameters:

Name Type Description Default
days_back int

Number of days subtracted from datetime.now(), default 30.

30
**kwargs Any

Collection parameters, including optional filter_query.

{}

Returns:

Type Description
Dict[str, Any]

Provider JSON from one page; this does not retrieve all sales or use UTC.

get_sales_by_date_range
get_sales_by_date_range(
    start_date: Union[str, date, datetime],
    end_date: Union[str, date, datetime],
    **kwargs: Any
) -> Dict[str, Any]

Filter Sale transactions by inclusive quoted CloseDate bounds.

Parameters:

Name Type Description Default
start_date Union[str, date, datetime]

String or date/datetime serialized with isoformat().

required
end_date Union[str, date, datetime]

String or date/datetime serialized with isoformat().

required
**kwargs Any

Collection parameters, including optional filter_query.

{}

Returns:

Type Description
Dict[str, Any]

Provider JSON from one page; no timezone conversion or date validation occurs.

get_sales_by_price_range
get_sales_by_price_range(
    min_price: Optional[int] = None,
    max_price: Optional[int] = None,
    **kwargs: Any
) -> Dict[str, Any]

Filter Sale transactions by optional inclusive ClosePrice bounds.

Parameters:

Name Type Description Default
min_price Optional[int]

Inclusive minimum, default None.

None
max_price Optional[int]

Inclusive maximum, default None.

None
**kwargs Any

Collection parameters, including optional filter_query.

{}

Returns:

Type Description
Dict[str, Any]

Provider JSON from one page; combines an existing filter with and.

get_transactions_by_city
get_transactions_by_city(city: str, **kwargs: Any) -> Dict[str, Any]

Filter City and combine optional filter_query with and.

Parameters:

Name Type Description Default
city str

City text interpolated without escaping into a quoted literal.

required
**kwargs Any

Collection parameters, including optional filter_query.

{}

Returns:

Type Description
Dict[str, Any]

Provider collection JSON from one page.

get_transactions_for_property
get_transactions_for_property(
    listing_key: str, **kwargs: Any
) -> Dict[str, Any]

Filter a history collection by quoted ListingKey.

Parameters:

Name Type Description Default
listing_key str

String inserted without escaping into a quoted literal.

required
**kwargs Any

get_history_transactions parameters, including optional filter_query.

{}

Returns:

Type Description
Dict[str, Any]

Provider collection JSON; additional filters are joined with and.

get_transactions_with_property
get_transactions_with_property(**kwargs: Any) -> Dict[str, Any]

Query history with $expand=Property.

Parameters:

Name Type Description Default
**kwargs Any

Collection parameters, excluding expand.

{}

Returns:

Type Description
Dict[str, Any]

Provider JSON if the server accepts the relationship.