Skip to main content

Realestate Data

Project description

Realestate Data

A tool to request real estate data from an unofficial realestate.com.au "API".

Installation

pip install realestate-data

Usage

Build out schematics to represent the search query you are after.

See here for available options, or take a look at ./realestate_data/schematics.py

The below creates a search object that represents

  • Units and apartments for sale
  • in Melbourne Victoria, 3000
  • and surrounding suburbs
  • price between $500,000 and $1,000,000
  • minimum of 1 parking space
  • minimum of 1 bathroom
  • minimum of 2 bedrooms
>>> from realestate_data import Search, Locality, PriceRange, Filters
>>>
>>> p = PriceRange()
>>> p.minimum = 500000
>>> p.maximum = 1000000
>>>
>>> l = Locality()
>>> l.locality = 'Melbourne'
>>> l.subdivision = Locality.SUBDIVISION_VIC
>>> l.postcode = '3000'
>>>
>>> f = Filters()
>>> f.property_types = [Filters.PROPERTY_TYPE_APARTMENT, Filters.PROPERTY_TYPE_UNIT]
>>> f.surrounding_suburbs = True
>>> f.minimum_bedrooms = 2
>>> f.minimum_bathrooms = 1
>>> f.minimum_parking_spaces = 1
>>> f.price_range = p
>>>
>>> s.channel = Search.CHANNEL_BUY
>>> s.localities = [l]
>>> s.filters = f

Call validate() on the search object to ensure its valid. It will return nothing if valid and an error if not

>>> s.validate()

Call to_primitive() to view the search object

>>> s.to_primitive()
{'channel': 'buy', 'localities': [{'locality': 'Melbourne', 'subdivision': 'VIC', 'postcode': '3000'}], 'filters': {'property-types': ['apartment', 'unit'], 'minimum-bedrooms': 1, 'minimum-bathrooms': 1, 'minimum-parking-spaces': 1, 'surrounding-suburbs': True, 'price-range': {'minimum': 500000, 'maximum': 1000000}}}

Pass the created Search object to the paged_results generator. The generator yields the json returned from each paged request.

>>> from realestate_data import paged_results
>>> paged_data = [page for page in paged_results(s)]

Or use the Generator how ever you want

>>> paged_data = paged_results(s)
>>> page_one = next(paged_data)
>>> page_two = next(paged_data)
>>> for page in paged_results(s):
>>>     print(page)

Todo

  • Testing

Author

Jeremy Storer storerjeremy@gmail.com

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

realestate-data-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

File details

Details for the file realestate-data-0.1.0.tar.gz.

File metadata

  • Download URL: realestate-data-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.7.0

File hashes

Hashes for realestate-data-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a2432abfa99eda4ac677d3b4775ba03715ae7b19a94f05819460410642f95411
MD5 5ed3610624833cb767630ba8e946e419
BLAKE2b-256 854e49ec3f51f2932ed237b32437918f2513004799c64bc2639d3685f358694a

See more details on using hashes here.

Supported by

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