Skip to content

Commit d366858

Browse files
committed
new feature /version bump - send date_min and date_max
1 parent 695c430 commit d366858

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import evernetpy
7474
evernetpy.get_all_active_mls_numbers(username, password)
7575
```
7676

77-
This gives you an iterator with all the active MLS numbers in it.
77+
This gives you an iterator with all the active MLS numbers in it. You can also optionally pass the date_min and date_max fields. They should be python datetime objects.
7878

7979
## Get a single property by mls_number
8080

@@ -115,6 +115,7 @@ logging.getLogger().setLevel(logging.INFO)
115115

116116
# Changelog
117117

118+
* 2.3.0: You can now pass in date_min and date max to the `get_all_active_mls_nubmers` function
118119
* 2.2.1: Bugfix: now you can actually use the status parameter to get all active listings
119120
* 2.2.0: Add the ability to get all active listings
120121
* 2.1.0: Add the ability to grab a single listing by MLS number

evernetpy/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ def get_all_listings(username, password, property_types=[], areas=[], cities=[],
1818
)
1919

2020

21-
def get_all_active_mls_numbers(username, password, property_types=[], areas=[], cities=[]):
22-
for criteria in iterate_criteria('1990-01-01T00:00:00', '3000-01-01T00:00:00', status=['A'], property_types=property_types, areas=areas, cities=cities):
21+
def get_all_active_mls_numbers(username, password, property_types=[], areas=[], cities=[], date_min=None, date_max=None):
22+
if not date_min:
23+
date_min = datetime.datetime(year=1990, month=1, day=1, hour=0, minute=0, second=0)
24+
if not date_max:
25+
date_max = datetime.datetime(year=3000, month=1, day=1, hour=0, minute=0, second=0)
26+
date_min = date_min.strftime('%Y-%m-%dT%H:%M:%S')
27+
date_max = date_max.strftime('%Y-%m-%dT%H:%M:%S')
28+
for criteria in iterate_criteria(date_min, date_max, status=['A'], property_types=property_types, areas=areas, cities=cities):
2329
for row in execute_listing_query(username, password, 'RetrieveListingData', criteria, filter="LN,ST"):
2430
info = dict([(c.tag.replace('{http://www.nwmls.com/Schemas/Standard/StandardXML1_2.xsd}', ''), c.text) for c in row.getchildren()])
2531
yield info.get('LN')

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def run_tests(self):
1919
sys.exit(errno)
2020

2121
setup(name='evernetpy',
22-
version='2.2.2',
22+
version='2.3.0',
2323
description="A Python library for interacting with the EverNet listing service",
2424
author='Kevin McCarthy',
2525
author_email='[email protected]',

0 commit comments

Comments
 (0)