A library that enables programmatic interaction with daft.ie.
Project description
A library that enables programmatic interaction with daft.ie. Tested on Python 2.7 and Python 3.5.2
Install
pip install daftlistings
Developing Locally
git clone https://github.com/AnthonyBloomer/daftlistings.git cd daftlistings virtualenv env source env/bin/activate pip install -r requirements.txt
Examples
Get the current properties for rent in Dublin that are between €1000 and €1500 per month.
from daftlistings import Daft, CommercialType, SaleType, RentType
daft = Daft()
listings = daft.get_listings(
county='Dublin City',
area='Dublin 15',
listing_type=RentType.APARTMENTS,
min_price=1000,
max_price=1500,
)
for listing in listings:
print(listing.get_formalised_address())
print(listing.get_daft_link())
Retrieve commercial office listings in Dublin.
listings = daft.get_listings(
county='Dublin',
listing_type=SaleType.COMMERCIAL,
commercial_property_type=CommercialType.OFFICE
)
for listing in listings:
print(listing.get_formalised_address())
print(listing.get_daft_link())
Get the current sale agreed prices for properties in Dublin.
listings = daft.get_listings(
county='Dublin City',
area='Dublin 15',
listing_type=SaleType.PROPERTIES,
sale_agreed=True,
min_price=200000,
max_price=250000
)
for listing in listings:
print(listing.get_formalised_address())
print(listing.get_daft_link())
You can sort the listings by price, distance, upcoming viewing or date using the SortType object. The SortOrder object allows you to sort the listings descending or ascending. For example:
from daftlistings import SortOrder, SortType
listings = daft.get_listings(
county='Dublin City',
area='Dublin 15',
listing_type=SaleType.PROPERTIES,
sort_order=SortOrder.ASCENDING,
sort_by=SortType.PRICE,
min_price=150000,
max_price=175000
)
for listing in listings:
print(listing.get_formalised_address())
print(listing.get_daft_link())
print(listing.get_price())
Retrieve all properties for sale in Dublin 15. This example loops through each page of listings and prints the result.
offset = 0
pages = True
while pages:
listings = daft.get_listings(
county='Dublin City',
area='Dublin 15',
offset=offset,
listing_type=SaleType.PROPERTIES
)
if not listings:
pages = False
for listing in listings:
print(listing.get_agent_url())
print(listing.get_price())
print(listing.get_formalised_address())
print(listing.get_daft_link())
print(' ')
offset += 10
Full Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file daftlistings-1.0.0.tar.gz.
File metadata
- Download URL: daftlistings-1.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
657369c97caeaff0465e40e620c3c3bb83eefa601a5f3da89cd17bd908c0d63c
|
|
| MD5 |
0362c5b7996e8da015c3dbe0483b3e26
|
|
| BLAKE2b-256 |
e798a8bba1c08117e974591f8b84a69cb44ff15deab38fc02334b098454d8225
|
File details
Details for the file daftlistings-1.0.0-py2-none-any.whl.
File metadata
- Download URL: daftlistings-1.0.0-py2-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f6219f5bc3cf4fcd4b9f398267bfcbecd3af115b365471ce2a7fd0dbb2b3962
|
|
| MD5 |
2f0f29e628628cf2f5c6496dd154f1ae
|
|
| BLAKE2b-256 |
121149b2c1d8eece36842afb28c1b4f57c9020d5d00fb92c4dd6319fe51dba3a
|