Metadata-Version: 2.1
Name: open-exchange
Version: 0.2.0
Summary: Open Exchange Python SDK.
Author-email: "Open Exchange Labs, Inc." <ox-data-eng@opendoor.com>
Requires-Python: >=3.6.2,<4.0.0
Description-Content-Type: text/markdown
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
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: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: cached-property>=1.5.2; python_version<'3.8'
Requires-Dist: pydantic>=1.9.2
Requires-Dist: requests>=2.27.1
Requires-Dist: urllib3>=1.21.1
Project-URL: Home, https://github.com/opendoor-labs/open-exchange-python

# Open Exchange Python SDK

The Open Exchange Python SDK provides access to the Open Exchange REST API from applications written in Python 3.6
and later.

## Documentation

The REST API documentation is available at [https://openexchange.readme.io/](https://openexchange.readme.io/).

## Installation

You can install the package via pip:

```bash
pip install open-exchange
```

## Usage

See the [examples][0] directory for examples of how to use the SDK.

```python
import open_exchange
from open_exchange.types.data import rental_comps_fetch_params, rental_comps_response
from typing import List

# get API KEY from environment variable OPEN_EXCHANGE_API_KEY
client = open_exchange.OpenExchangeClient()

addresses: List[rental_comps_fetch_params.Address] = [
    {
        "street": " 5201 S 44th St",
        "city": "Omaha",
        "state": "NE",
        "postal_code": "68107",
        "token": "client-provided-token-1",
    }
]

filters: rental_comps_fetch_params.Filters = {
    "bedrooms_total": {
        "relative": 1,
    }
}

# get rental comps for a iterable of addresses with filters
result: rental_comps_response.Result
for result in client.data.rental_comps.fetch(addresses=addresses, filters=filters):
    assert result.token == "client-provided-token-1"

    print("Subject property details:", result.subject_property_details)
    print("Number of rental comps:", len(result.rental_comps))
    print("Rental comps:", result.rental_comps)
```

## Logging

We use the Python standard library [`logging`](https://docs.python.org/3/library/logging.html) module.

## Requirements

Python 3.6 or higher.


[0]: https://github.com/opendoor-labs/open-exchange-python/tree/main/examples
