Skip to main content

The Propertia SDK helps users integrate easily with the SmartScore services

Project description

Propertia SDK

PyPI version Python support Unit Tests

The Propertia SDK helps users integrate easily with the SmartScore services

Installation

Install Propertia SDK using pip

pip install propertia

SDK set up

In order to authenticate with Propertia, you will have to supply the API Key.

from propertia.client import PropertiaClient

with PropertiaClient(api_key="your_api_key") as client:
    ...

Client Usage

Get Scores

Given coordinates and needs, return the scores

Takes:

  • properties
  • needs

Returns:

  • List of properties sorted by descending scores

Example:

from propertia.client import PropertiaClient

properties = [
    {
        "id": "Property A",
        "latitude": "43.70558",
        "longitude": "-79.530985"
    },
    {
        "id": "Property B",
        "latitude": "43.640971",
        "longitude": "-79.579119"
    },
    {
        "id": "Property C",
        "latitude": "43.704711",
        "longitude": "-79.287965"
    }
]

needs = {
    "food-and-drink": {
        "importance": 5,
        "categories": [
            "fast-food"
        ]
    }
}

with PropertiaClient(api_key="your_api_key") as client:
    scores = client.get_scores(properties, needs, region)
    # Do something with your scores

Get Isochrones

Given a list of one or two destinations and a boolean, return the isochrones (polygon)

Takes:

  • destinations
  • aggregated

Returns:

  • A polygon in GeoJSON format

Example:

from propertia.client import PropertiaClient

destinations = [
    {
        "id": "destination",
        "latitude": 25.197197,
        "longitude": 55.27437639999999,
        "time": 10,
        "methods": [
            "walking"
        ]
    }
]

aggregated = True

with PropertiaClient(api_key="your_api_key") as client:
    polygon = client.get_isochrones(destinations, aggregated)
    # Do something with your isochrones

Get Commute Times

Given a list of one or two destinations and a list of properties, returns the time it takes to commute to each property

Takes:

  • destinations
  • properties

Returns:

  • A dictionary of properties with the time it takes to commute to each property

Example:

from propertia.client import PropertiaClient

destinations = [
    {
        "id": "destination",
        "latitude": 25.197197,
        "longitude": 55.27437639999999,
        "time": 10,
        "methods": [
            "walking"
        ]
    }
]

properties = [
    {
        "id": "Property A",
        "latitude": "43.70558",
        "longitude": "-79.530985"
    },
    {
        "id": "Property B",
        "latitude": "43.640971",
        "longitude": "-79.579119"
    },
    {
        "id": "Property C",
        "latitude": "43.704711",
        "longitude": "-79.287965"
    }
]

with PropertiaClient(api_key="your_api_key") as client:
    results = client.get_commute_time(destinations, properties)
    # Do something with your results

Use category tree

from propertia.categories import CATEGORY_TREE

Get user categories

from propertia.client import PropertiaClient

with PropertiaClient(api_key="your_api_key") as client:
    categories = client.get_user_categories()
    # Do something with your results

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

propertia-0.1.18.tar.gz (4.4 kB view details)

Uploaded Source

File details

Details for the file propertia-0.1.18.tar.gz.

File metadata

  • Download URL: propertia-0.1.18.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for propertia-0.1.18.tar.gz
Algorithm Hash digest
SHA256 09718a7d0846053622e75ec822b48d5dc49bb2389b3b5b53cc1262a6c6c6653a
MD5 4bf77afc791efa5213425ae4028fc4f7
BLAKE2b-256 705c6ca95d25f98d79688dcd80e86aaf4ae74735860aa655b72fbf2632977671

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page