{"id":14037043,"url":"https://github.com/AnthonyBloomer/daftlistings","last_synced_at":"2025-07-27T04:33:47.896Z","repository":{"id":9357385,"uuid":"61705043","full_name":"AnthonyBloomer/daftlistings","owner":"AnthonyBloomer","description":"A library that enables programmatic interaction with daft.ie. Daft.ie has nationwide coverage and contains about 80% of the total available properties in Ireland.","archived":false,"fork":false,"pushed_at":"2023-11-16T14:40:07.000Z","size":458,"stargazers_count":173,"open_issues_count":0,"forks_count":54,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-29T00:08:20.977Z","etag":null,"topics":["daft","housing-prices","ireland","properties","property-market","python","real-estate"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnthonyBloomer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-22T09:07:37.000Z","updated_at":"2024-11-23T12:35:30.000Z","dependencies_parsed_at":"2023-11-16T15:48:09.461Z","dependency_job_id":"f8749eac-e729-4045-8708-4548f874376d","html_url":"https://github.com/AnthonyBloomer/daftlistings","commit_stats":{"total_commits":102,"total_committers":10,"mean_commits":10.2,"dds":0.607843137254902,"last_synced_commit":"b4588069bd31bfd084e4d652e3306ef64dd06ac3"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyBloomer%2Fdaftlistings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyBloomer%2Fdaftlistings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyBloomer%2Fdaftlistings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnthonyBloomer%2Fdaftlistings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnthonyBloomer","download_url":"https://codeload.github.com/AnthonyBloomer/daftlistings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227762414,"owners_count":17816024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["daft","housing-prices","ireland","properties","property-market","python","real-estate"],"created_at":"2024-08-12T03:02:25.891Z","updated_at":"2024-12-02T16:31:39.465Z","avatar_url":"https://github.com/AnthonyBloomer.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Daftlistings\n\n\n[![Build Status](https://travis-ci.org/AnthonyBloomer/daftlistings.svg?branch=master)](https://travis-ci.org/AnthonyBloomer/daftlistings)\n[![codecov](https://codecov.io/gh/AnthonyBloomer/daftlistings/branch/master/graph/badge.svg)](https://codecov.io/gh/AnthonyBloomer/daftlistings)\n\nA library that enables programmatic interaction with [Daft.ie](https://daft.ie). Daft.ie has nationwide coverage and contains about 80% of the total available properties in Ireland.\n\n\n## Installation\n\nDaftlistings is available on the [Python Package Index (PyPI)](https://pypi.org/project/daftlistings/). You can install daftlistings using pip.\n\n``` bash\nvirtualenv env\nsource env/bin/activate\npip install daftlistings\n```\n\nTo install the development version, run:\n\n``` bash\npip install https://github.com/AnthonyBloomer/daftlistings/archive/dev.zip\n```\n\n## Usage\n\n``` python\nfrom daftlistings import Daft\n\ndaft = Daft()\nlistings = daft.search()\n\nfor listing in listings:\n    print(listing.title)\n    print(listing.price)\n    print(listing.daft_link)\n    # ...\n```\n\nBy default, the Daft search function iterates over each page of results and appends each Listing object to the array that is returned. If you wish to limit the number of results that are returned you can use the `max_pages` argument.\n\n```python\ndaft.search(max_pages=1)\n```\n\n## Examples\n\nSearch for apartments for rent in Dublin.\n\n```python\nfrom daftlistings import Daft, Location, SearchType, PropertyType\n\ndaft = Daft()\ndaft.set_location(Location.DUBLIN)\ndaft.set_search_type(SearchType.RESIDENTIAL_RENT)\ndaft.set_property_type(PropertyType.APARTMENT)\n\nlistings = daft.search()\n\nfor listing in listings:\n    print(listing.title)\n    print(listing.price)\n    print(listing.daft_link)\n```\n\nSearch for houses for sale in Dublin between 400 and 500k.\n\n```python\nfrom daftlistings import Daft, Location, SearchType, PropertyType\n\ndaft = Daft()\ndaft.set_location(Location.DUBLIN)\ndaft.set_search_type(SearchType.RESIDENTIAL_SALE)\ndaft.set_property_type(PropertyType.HOUSE)\ndaft.set_min_price(400000)\ndaft.set_max_price(500000)\n\nlistings = daft.search()\n\nfor listing in listings:\n    print(listing.title)\n    print(listing.price)\n    print(listing.daft_link)\n```\n\nSearch for student accomodation near Dundalk IT.\n\n```python\nfrom daftlistings import Daft, Location, SearchType\n\ndaft = Daft()\ndaft.set_location(Location.DUNDALK_INSTITUTE_OF_TECHNOLOGY_LOUTH)\ndaft.set_search_type(SearchType.STUDENT_ACCOMMODATION)\n\nlistings = daft.search()\n\nfor listing in listings:\n    print(listing.title)\n    print(listing.price)\n    print(listing.daft_link)\n```\n\nSearch for commercial listings.\n\n```python\nfrom daftlistings import Daft, SearchType\n\ndaft = Daft()\ndaft.set_search_type(SearchType.COMMERCIAL_SALE)\n\nlistings = daft.search()\n\nfor listing in listings:\n    print(listing.title)\n    print(listing.price)\n    print(listing.daft_link)\n    print()\n```\n\nSearch properties according to criteria then sort by nearness to Dublin Castle\n\n```python\nfrom daftlistings import Daft, SearchType\n\ndaft = Daft()\n\ndaft.set_location(\"Dublin City\")\ndaft.set_search_type(SearchType.RESIDENTIAL_RENT)\ndaft.set_min_price(1000)\ndaft.set_max_price(1500)\n\nlistings = daft.search(max_pages=1)\n\ndublin_castle_coords = [53.3429, -6.2674]\nlistings.sort(key=lambda x: x.distance_to(dublin_castle_coords))\n\nfor listing in listings:\n    print(f'{listing.title}')\n    print(f'{listing.daft_link}')\n    print(f'{listing.price}')\n    print(f'{listing.distance_to(dublin_castle_coords):.3}km')\n    print('')\n\n```\n\nSearch properties within 10kms of Dublin city centre\n\n```python\nfrom daftlistings import Daft, SearchType\n\ndaft = Daft()\n\ndaft.set_location(\"Dublin City Centre\", Distance.KM10)\ndaft.set_search_type(SearchType.RESIDENTIAL_RENT)\n\nlistings = daft.search(max_pages=1)\n\nfor listing in listings:\n    print(f'{listing.title}')\n    print(f'{listing.daft_link}')\n    print(f'{listing.price}')\n    print('')\n\n```\n\nSearch rental properties in Dublin with monthly rent lower than 1500 euros and visualize it on a map\n\n```python\nimport pandas as pd\nfrom daftlistings import Daft, Location, SearchType, PropertyType, SortType, MapVisualization\n\n \ndaft = Daft()\ndaft.set_location(Location.DUBLIN)\ndaft.set_search_type(SearchType.RESIDENTIAL_RENT)\ndaft.set_sort_type(SortType.PRICE_ASC)\ndaft.set_max_price(1500)\n\nlistings = daft.search()\n\n# cache the listings in the local file\nwith open(\"result.txt\", \"w\") as fp:\n    fp.writelines(\"%s\\n\" % listing.as_dict_for_mapping() for listing in listings)\n\n# read from the local file\nwith open(\"result.txt\") as fp:\n  lines = fp.readlines()\n\nproperties = []\nfor line in lines:\n  properties.append(eval(line))\n\ndf = pd.DataFrame(properties)\nprint(df)\n\ndublin_map = MapVisualization(df)\ndublin_map.add_markers()\ndublin_map.add_colorbar()\ndublin_map.save(\"ireland_rent.html\")\nprint(\"Done, please checkout the html file\")\n```\n\nSearch for apartments for rent in Dublin with an alarm and parking.\n\n```python\nfrom daftlistings import Daft, Location, SearchType, PropertyType, Facility\n\ndaft = Daft()\ndaft.set_location(Location.DUBLIN)\ndaft.set_search_type(SearchType.RESIDENTIAL_RENT)\ndaft.set_property_type(PropertyType.APARTMENT)\ndaft.set_facility(Facility.PARKING)\ndaft.set_facility(Facility.ALARM)\n\nlistings = daft.search()\n\nfor listing in listings:\n    print(listing.title)\n    print(listing.price)\n    print(listing.daft_link)\n    print()\n```\n\n## Running Tests\n\nThe Python unittest module contains its own test discovery function, which you can run from the command line:\n\n```\npython -m unittest discover tests/\n```\n\n\n## Contributing\n\n  - Fork the project and clone locally.\n  - Create a new branch for what you're going to work on.\n  - Push to your origin repository.\n  - Create a new pull request in GitHub.\n\nNote: We use (Black)[https://github.com/psf/black] for code formatting. After making any changes to the code, it is important for you to ensure that it passes Black's lint check. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnthonyBloomer%2Fdaftlistings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAnthonyBloomer%2Fdaftlistings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnthonyBloomer%2Fdaftlistings/lists"}