From db9f862778879cb1c95417ef0273d7d461a4d5dc Mon Sep 17 00:00:00 2001 From: Geobio Boo <9601962+geobio@users.noreply.github.com> Date: Sun, 2 Aug 2020 00:19:47 -0700 Subject: [PATCH 01/21] Update decoder.py to support new RESO "Point" type (#54) --- rets/client/decoder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rets/client/decoder.py b/rets/client/decoder.py index 69c3f34..e54ceb0 100644 --- a/rets/client/decoder.py +++ b/rets/client/decoder.py @@ -113,4 +113,6 @@ def _decode_date(value: str, include_tz: bool) -> datetime: 'Long': int, 'Decimal': Decimal, 'Number': int, + # Point is new "Edm.GeographyPoint" from RESO, look online for spec. Can store as Postgres Point, see https://bit.ly/2BDPgUS + 'Point': str, } From 154ccaee238838444ecf3cc64048d3abff5bec07 Mon Sep 17 00:00:00 2001 From: Geobio Boo Date: Sun, 2 Aug 2020 00:27:51 -0700 Subject: [PATCH 02/21] =?UTF-8?q?Bump=20version:=200.4.4=20=E2=86=92=200.4?= =?UTF-8?q?.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- rets/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 9be8643..8f79416 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 0.4.4 +current_version = 0.4.5 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? serialize = {major}.{minor}.{patch}-{release} diff --git a/rets/__init__.py b/rets/__init__.py index 7ea4115..94bfda6 100644 --- a/rets/__init__.py +++ b/rets/__init__.py @@ -3,7 +3,7 @@ from rets.http.data import Metadata, Object, SearchResult, SystemMetadata __title__ = 'rets' -__version__ = '0.4.4' +__version__ = '0.4.5' __author__ = 'Martin Liu ' __license__ = 'MIT License' diff --git a/setup.py b/setup.py index b651ffa..343c6a5 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ setup( name='rets-python', - version='0.4.4', + version='0.4.5', description='rets-python', long_description=long_desc, author='Martin Liu', From afbf9ea0cab77cd957759b3603dad49a32b2d1a3 Mon Sep 17 00:00:00 2001 From: Geobio Boo <9601962+geobio@users.noreply.github.com> Date: Sun, 2 Aug 2020 01:14:18 -0700 Subject: [PATCH 03/21] Update README.md --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index ada8d5b..f6792d2 100644 --- a/README.md +++ b/README.md @@ -147,3 +147,15 @@ objects = client.get_object( location=True, ) ``` +# Developing/Releasing +To release a new version, use `bin/release ` + +This package is deployed to: https://pypi.org/manage/project/rets-python/releases/ + +To deploy, you can try `bin/deploy`, but it may give you a SSL error. Alternatively, to deploy, see: https://packaging.python.org/tutorials/packaging-projects/ or in summary: +``` +python3 -m pip install --user --upgrade setuptools wheel +python3 setup.py sdist bdist_wheel +python3 -m pip install --user --upgrade twine +python3 -m twine upload dist/* +``` From 09fbabfe7827f86a266f73ad7830c9bb68880c11 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Fri, 13 Nov 2020 10:29:06 -0800 Subject: [PATCH 04/21] Delete resource key from record (#56) --- README.md | 14 +++++--------- rets/client/record.py | 9 +-------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index f6792d2..c785b78 100644 --- a/README.md +++ b/README.md @@ -67,9 +67,6 @@ The values returned by the search query will be automatically decoded into Pytho ```python >>> listing = search_result.data[0] ->>> listing.resource_key -'20170104191513476022000000' - >>> listing.data { 'internal_listing_id': '20170104191513476022000000', @@ -79,17 +76,16 @@ The values returned by the search query will be automatically decoded into Pytho 'list_price': 250000, ... } + +>>> listing.data[listing.resource_class.resource.key_field] +'20170104191513476022000000' ``` -Photos and other object types for a record can be retrieved directly from the record object. They -can also be retrieved in bulk from the ObjectType object using the resource keys of the records. +Photos can also be retrieved in bulk from the ObjectType object using the resource keys of the records. ```python ->>> listing.get_objects('HiRes', location=True) -(Object(mime_type='image/jpeg', content_id='20170104191513476022000000', description='Front', object_id='1', url='...', preferred=True, data=None), ...) - >>> all_photos = photo_object_type.get( - resource_keys=[listing.resource_key for listing in listings], + resource_keys=[listing.data[listing.resource_class.resource.key_field] for listing in listings], location=True, ) diff --git a/rets/client/record.py b/rets/client/record.py index f69dee9..ff7e155 100644 --- a/rets/client/record.py +++ b/rets/client/record.py @@ -6,18 +6,11 @@ class Record: def __init__(self, resource_class, data: dict): - self.resource = resource_class.resource self.resource_class = resource_class - self.resource_key = str(data[resource_class.resource.key_field]) self.data = data - def get_objects(self, name: str, **kwargs) -> Sequence[Object]: - resource_object = self.resource.get_object_type(name) - return resource_object.get(self.resource_key, **kwargs) - def __repr__(self) -> str: - return '' % ( + return '' % ( self.resource_class.resource.name, self.resource_class.name, - self.resource_key, ) From 382e0f3df4101c0f8a26354af8c0c24fdd9ddab9 Mon Sep 17 00:00:00 2001 From: Geobio Boo <9601962+geobio@users.noreply.github.com> Date: Tue, 12 Jan 2021 00:14:19 -0800 Subject: [PATCH 05/21] use dateutil parser for datetime parsing (#57) --- rets/client/decoder.py | 2 +- tests/client/decoder_test.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rets/client/decoder.py b/rets/client/decoder.py index e54ceb0..5792fd0 100644 --- a/rets/client/decoder.py +++ b/rets/client/decoder.py @@ -69,7 +69,7 @@ def _get_decoder(data_type: str, interpretation: str, include_tz: bool = False): def _decode_datetime(value: str, include_tz: bool) -> datetime: # Correct `0000-00-00 00:00:00` to `0000-00-00T00:00:00` - if re.match(r'^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$', value): + if value[10] == ' ': value = '%sT%s' % (value[0:10], value[11:]) # Correct `0000-00-00` to `0000-00-00T00:00:00` elif re.match(r'^\d{4}-\d{2}-\d{2}$', value): diff --git a/tests/client/decoder_test.py b/tests/client/decoder_test.py index 059ea50..ade6ee4 100644 --- a/tests/client/decoder_test.py +++ b/tests/client/decoder_test.py @@ -106,6 +106,8 @@ def test_decode_datetime(): # digit, however udatetime only permits 3 or 6 digits. assert _decode_datetime('2017-01-02T03:04:05.600', True) == \ datetime(2017, 1, 2, 3, 4, 5, 600000, tzinfo=timezone(timedelta(0))) + assert _decode_datetime('2020-10-12 10:46:54.146488', True) == \ + datetime(2020, 10, 12, 10, 46, 54, 146488, tzinfo=timezone(timedelta(0))) assert _decode_datetime('2017-01-02T03:04:05Z', True) == \ datetime(2017, 1, 2, 3, 4, 5, tzinfo=timezone(timedelta(0))) assert _decode_datetime('2017-01-02T03:04:05+00:00', True) == \ From b975aca378e8d96ade0f2492dd410dcf60d852b6 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Wed, 13 Jan 2021 12:01:03 -0800 Subject: [PATCH 06/21] Fix date from RETS (#58) --- rets/client/decoder.py | 10 +++++----- tests/client/decoder_test.py | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/rets/client/decoder.py b/rets/client/decoder.py index 5792fd0..c76cc9e 100644 --- a/rets/client/decoder.py +++ b/rets/client/decoder.py @@ -68,12 +68,12 @@ def _get_decoder(data_type: str, interpretation: str, include_tz: bool = False): def _decode_datetime(value: str, include_tz: bool) -> datetime: - # Correct `0000-00-00 00:00:00` to `0000-00-00T00:00:00` - if value[10] == ' ': - value = '%sT%s' % (value[0:10], value[11:]) # Correct `0000-00-00` to `0000-00-00T00:00:00` - elif re.match(r'^\d{4}-\d{2}-\d{2}$', value): + if len(value) == 10: value = '%sT00:00:00' % value[0:10] + # Correct `0000-00-00 00:00:00` to `0000-00-00T00:00:00` + elif value[10] == ' ': + value = '%sT%s' % (value[0:10], value[11:]) decoded = udatetime.from_string(value) if not include_tz: @@ -114,5 +114,5 @@ def _decode_date(value: str, include_tz: bool) -> datetime: 'Decimal': Decimal, 'Number': int, # Point is new "Edm.GeographyPoint" from RESO, look online for spec. Can store as Postgres Point, see https://bit.ly/2BDPgUS - 'Point': str, + 'Point': str, } diff --git a/tests/client/decoder_test.py b/tests/client/decoder_test.py index ade6ee4..6d832c0 100644 --- a/tests/client/decoder_test.py +++ b/tests/client/decoder_test.py @@ -124,6 +124,8 @@ def test_decode_datetime(): datetime(2017, 1, 2, 3, 4, 5) assert _decode_datetime('2017-01-02T03:04:05.600', False) == \ datetime(2017, 1, 2, 3, 4, 5, 600000) + assert _decode_datetime('2017-01-02 03:04:05.600', False) == \ + datetime(2017, 1, 2, 3, 4, 5, 600000) assert _decode_datetime('2017-01-02T03:04:05Z', False) == datetime(2017, 1, 2, 3, 4, 5) assert _decode_datetime('2017-01-02T03:04:05+00:00', False) == datetime(2017, 1, 2, 3, 4, 5) assert _decode_datetime('2017-01-02T03:04:05-00:00', False) == datetime(2017, 1, 2, 3, 4, 5) From 03467a000b43e6b953407d52b8ae3fe0a4c45b61 Mon Sep 17 00:00:00 2001 From: Geobio Boo <9601962+geobio@users.noreply.github.com> Date: Mon, 24 May 2021 14:58:09 -0700 Subject: [PATCH 07/21] Update error message when decoding wrong data type (#60) Old error `invalid literal for int() with base 10: '5.6'` new error: `ValueError: Error decoding field ORM4_WID with value 5.6. Error: invalid literal for int() with base 10: '5.6'` --- rets/client/decoder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rets/client/decoder.py b/rets/client/decoder.py index c76cc9e..e55320c 100644 --- a/rets/client/decoder.py +++ b/rets/client/decoder.py @@ -29,7 +29,10 @@ def decode(self, rows: Sequence[dict]) -> Sequence[dict]: def decode_field(field: str, value: str) -> Any: if value == '': return None - return decoders[field](value) + try: + return decoders[field](value) + except Exception as e: + raise ValueError(f"Error decoding field {field} with value {value}. Error: {e}") from e return tuple(OrderedDict((field, decode_field(field, value)) for field, value in row.items()) for row in rows) From a8957fad73f7c0baa0c01a68bac377714ff5a14f Mon Sep 17 00:00:00 2001 From: Geobio Boo Date: Mon, 24 May 2021 15:03:58 -0700 Subject: [PATCH 08/21] =?UTF-8?q?manually=20bump=20version:=200.4.5=20?= =?UTF-8?q?=E2=86=92=200.4.6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- rets/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 8f79416..4c3d393 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 0.4.5 +current_version = 0.4.6 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? serialize = {major}.{minor}.{patch}-{release} diff --git a/rets/__init__.py b/rets/__init__.py index 94bfda6..58cfbd0 100644 --- a/rets/__init__.py +++ b/rets/__init__.py @@ -3,7 +3,7 @@ from rets.http.data import Metadata, Object, SearchResult, SystemMetadata __title__ = 'rets' -__version__ = '0.4.5' +__version__ = '0.4.6' __author__ = 'Martin Liu ' __license__ = 'MIT License' diff --git a/setup.py b/setup.py index 343c6a5..3772d8a 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ setup( name='rets-python', - version='0.4.5', + version='0.4.6', description='rets-python', long_description=long_desc, author='Martin Liu', From 007704e9ac120e65fb552e7ac7068c392d027985 Mon Sep 17 00:00:00 2001 From: Geobio Boo Date: Mon, 24 May 2021 15:06:37 -0700 Subject: [PATCH 09/21] =?UTF-8?q?Bump=20version:=200.4.6=20=E2=86=92=200.4?= =?UTF-8?q?.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- rets/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 4c3d393..e483713 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 0.4.6 +current_version = 0.4.7 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? serialize = {major}.{minor}.{patch}-{release} diff --git a/rets/__init__.py b/rets/__init__.py index 58cfbd0..51c2046 100644 --- a/rets/__init__.py +++ b/rets/__init__.py @@ -3,7 +3,7 @@ from rets.http.data import Metadata, Object, SearchResult, SystemMetadata __title__ = 'rets' -__version__ = '0.4.6' +__version__ = '0.4.7' __author__ = 'Martin Liu ' __license__ = 'MIT License' diff --git a/setup.py b/setup.py index 3772d8a..bd80709 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ setup( name='rets-python', - version='0.4.6', + version='0.4.7', description='rets-python', long_description=long_desc, author='Martin Liu', From b5f70e53e146b28ca84830ad70a7e6ea26654224 Mon Sep 17 00:00:00 2001 From: Geobio Boo <9601962+geobio@users.noreply.github.com> Date: Mon, 7 Jun 2021 16:35:22 -0700 Subject: [PATCH 10/21] Option to not pass 'RETS-UA-Authorization', and parse non-utf8 xml (#61) --- rets/http/client.py | 5 ++++- rets/http/parsers/parse.py | 9 ++++++++- tests/client/request_test.py | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 tests/client/request_test.py diff --git a/rets/http/client.py b/rets/http/client.py index 7f8a125..c5d2305 100644 --- a/rets/http/client.py +++ b/rets/http/client.py @@ -30,11 +30,13 @@ def __init__(self, capability_urls: str = None, cookie_dict: dict = None, use_get_method: bool = False, + send_rets_ua_authorization: bool = True, ): self._user_agent = user_agent self._user_agent_password = user_agent_password self._rets_version = rets_version self._use_get_method = use_get_method + self._send_rets_ua_authorization = send_rets_ua_authorization splits = urlsplit(login_url) self._base_url = urlunsplit((splits.scheme, splits.netloc, '', '', '')) @@ -297,8 +299,9 @@ def _http_request(self, url: str, headers: dict = None, payload: dict = None) -> **(headers or {}), 'User-Agent': self.user_agent, 'RETS-Version': self.rets_version, - 'RETS-UA-Authorization': self._rets_ua_authorization() } + if self._send_rets_ua_authorization: + request_headers['RETS-UA-Authorization'] = self._rets_ua_authorization() if self._use_get_method: if payload: diff --git a/rets/http/parsers/parse.py b/rets/http/parsers/parse.py index a068a99..814661b 100644 --- a/rets/http/parsers/parse.py +++ b/rets/http/parsers/parse.py @@ -16,7 +16,14 @@ def parse_xml(response: ResponseLike) -> etree.Element: encoding = response.encoding or DEFAULT_ENCODING - root = etree.fromstring(response.content.decode(encoding), parser=etree.XMLParser(recover=True)) + try: + root = etree.fromstring(response.content.decode(encoding), parser=etree.XMLParser(recover=True)) + except ValueError as e: + if str(e) == "Unicode strings with encoding declaration are not supported. Please use bytes input or XML fragments without declaration.": + # parse bytes directly, rather than from string + root = etree.XML(response.content) + else: + raise e if root is None: raise RetsResponseError(response.content, response.headers) diff --git a/tests/client/request_test.py b/tests/client/request_test.py new file mode 100644 index 0000000..44fbd5b --- /dev/null +++ b/tests/client/request_test.py @@ -0,0 +1,35 @@ +from unittest.mock import MagicMock, call + +from rets.http.client import ( + RetsHttpClient +) + + +def test_rets_ua_authorization_false(): + send_auth = False + + client = RetsHttpClient(login_url='test.url', + username='user', + password='pass', + send_rets_ua_authorization=send_auth, + ) + client._session = MagicMock() + client._http_request(url='test.url') + + assert client._send_rets_ua_authorization == send_auth + + assert client._session.post.called + assert 'RETS-UA-Authorization' not in client._session.post.call_args_list[0][1]['headers'] + + +def test_rets_ua_authorization_default(): + # by default, sends 'RETS-UA-Authorization' + client = RetsHttpClient(login_url='test.url', + username='user', + password='pass', + ) + client._session = MagicMock() + client._http_request(url='test.url') + + assert client._session.post.called + assert 'RETS-UA-Authorization' in client._session.post.call_args_list[0][1]['headers'] From 8933a2b4fb015644105dc078a3118f8e47f694f0 Mon Sep 17 00:00:00 2001 From: Geobio Boo Date: Mon, 7 Jun 2021 16:36:10 -0700 Subject: [PATCH 11/21] =?UTF-8?q?Bump=20version:=200.4.7=20=E2=86=92=200.4?= =?UTF-8?q?.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- rets/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index e483713..f47a4d1 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 0.4.7 +current_version = 0.4.8 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? serialize = {major}.{minor}.{patch}-{release} diff --git a/rets/__init__.py b/rets/__init__.py index 51c2046..9fc1e02 100644 --- a/rets/__init__.py +++ b/rets/__init__.py @@ -3,7 +3,7 @@ from rets.http.data import Metadata, Object, SearchResult, SystemMetadata __title__ = 'rets' -__version__ = '0.4.7' +__version__ = '0.4.8' __author__ = 'Martin Liu ' __license__ = 'MIT License' diff --git a/setup.py b/setup.py index bd80709..2e06c92 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ setup( name='rets-python', - version='0.4.7', + version='0.4.8', description='rets-python', long_description=long_desc, author='Martin Liu', From 4ac26fa29450497b769d5575b82cc5ff89df4544 Mon Sep 17 00:00:00 2001 From: Tim Cheeseman <97457896+queijeiro@users.noreply.github.com> Date: Wed, 2 Mar 2022 16:24:55 -0500 Subject: [PATCH 12/21] remove docopts from install_requires (#63) --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 2e06c92..e9c4cc0 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,6 @@ 'requests>=2.12.3', 'requests-toolbelt>=0.7.0,!=0.9.0', 'udatetime==0.0.16', - 'docopts', 'lxml>=4.3.0', ] From f0e455785569e76c029c92b8ef691da3a7db2ad6 Mon Sep 17 00:00:00 2001 From: Geobio Boo Date: Wed, 2 Mar 2022 13:28:41 -0800 Subject: [PATCH 13/21] =?UTF-8?q?Bump=20version:=200.4.8=20=E2=86=92=200.4?= =?UTF-8?q?.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- rets/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index f47a4d1..42854e6 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 0.4.8 +current_version = 0.4.9 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? serialize = {major}.{minor}.{patch}-{release} diff --git a/rets/__init__.py b/rets/__init__.py index 9fc1e02..0dbd6db 100644 --- a/rets/__init__.py +++ b/rets/__init__.py @@ -3,7 +3,7 @@ from rets.http.data import Metadata, Object, SearchResult, SystemMetadata __title__ = 'rets' -__version__ = '0.4.8' +__version__ = '0.4.9' __author__ = 'Martin Liu ' __license__ = 'MIT License' diff --git a/setup.py b/setup.py index e9c4cc0..0e0c6d2 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup( name='rets-python', - version='0.4.8', + version='0.4.9', description='rets-python', long_description=long_desc, author='Martin Liu', From 96839a4902168cefa7c822dad3f80e15740cc485 Mon Sep 17 00:00:00 2001 From: Oleksandr Date: Fri, 16 Sep 2022 02:11:31 +0300 Subject: [PATCH 14/21] Update udatetime to 0.0.17 (#67) --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0e0c6d2..b328ade 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ install_requires = [ 'requests>=2.12.3', 'requests-toolbelt>=0.7.0,!=0.9.0', - 'udatetime==0.0.16', + 'udatetime==0.0.17', 'lxml>=4.3.0', ] From a7830329bf76fcd6cd7294e07c98e237e7a48b9c Mon Sep 17 00:00:00 2001 From: Davidson Raj <91478211+oddavidson@users.noreply.github.com> Date: Wed, 30 Aug 2023 12:19:49 -0400 Subject: [PATCH 15/21] Handle null rows (#70) --- rets/client/resource_class.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rets/client/resource_class.py b/rets/client/resource_class.py index 6bff71e..1ab6187 100644 --- a/rets/client/resource_class.py +++ b/rets/client/resource_class.py @@ -70,7 +70,7 @@ def search(self, return SearchResult( count=result.count, max_rows=result.max_rows, - data=tuple(Record(self, row) for row in rows), + data=tuple(Record(self, row) for row in rows) if rows else tuple(), ) def _validate_query(self, query: Union[str, Mapping[str, str]]) -> str: From 6a7846dd9db5ba29c2c2482cce20555257f49747 Mon Sep 17 00:00:00 2001 From: Davidson Raj Date: Wed, 6 Sep 2023 14:30:23 -0400 Subject: [PATCH 16/21] bump up version to 0.4.10 --- .bumpversion.cfg | 2 +- rets/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 42854e6..c167183 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 0.4.9 +current_version = 0.4.10 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? serialize = {major}.{minor}.{patch}-{release} diff --git a/rets/__init__.py b/rets/__init__.py index 0dbd6db..3775915 100644 --- a/rets/__init__.py +++ b/rets/__init__.py @@ -3,7 +3,7 @@ from rets.http.data import Metadata, Object, SearchResult, SystemMetadata __title__ = 'rets' -__version__ = '0.4.9' +__version__ = '0.4.10' __author__ = 'Martin Liu ' __license__ = 'MIT License' diff --git a/setup.py b/setup.py index b328ade..c536307 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup( name='rets-python', - version='0.4.9', + version='0.4.10', description='rets-python', long_description=long_desc, author='Martin Liu', From 47c040c25bbb479411da13dcbb5b433df3c8c0d2 Mon Sep 17 00:00:00 2001 From: Davidson Raj <91478211+oddavidson@users.noreply.github.com> Date: Wed, 6 Sep 2023 15:02:21 -0400 Subject: [PATCH 17/21] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index c785b78..773fbd7 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,14 @@ To release a new version, use `bin/release ` This package is deployed to: https://pypi.org/manage/project/rets-python/releases/ To deploy, you can try `bin/deploy`, but it may give you a SSL error. Alternatively, to deploy, see: https://packaging.python.org/tutorials/packaging-projects/ or in summary: + + +Update version number in the following files (0.4.10 -> 0.4.11) +* setup.py +* build/lib/rets/__init__.py +* rets/__init__.py + + ``` python3 -m pip install --user --upgrade setuptools wheel python3 setup.py sdist bdist_wheel From cc670c8c05c6ee244241664a868ff7bfb02bf5e7 Mon Sep 17 00:00:00 2001 From: Mahesh Khetpal Date: Tue, 15 Oct 2024 15:58:20 +0530 Subject: [PATCH 18/21] fixing the issue for greenville mls --- rets/http/parsers/parse_object.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rets/http/parsers/parse_object.py b/rets/http/parsers/parse_object.py index 2b0df75..627c9d4 100644 --- a/rets/http/parsers/parse_object.py +++ b/rets/http/parsers/parse_object.py @@ -89,6 +89,8 @@ def _parse_body_part(part: ResponseLike) -> Optional[Object]: except RetsApiError as e: if e.reply_code == 20403: # No object found return None + elif e.reply_code == 20407: # Access to object not allowed + return None raise # All RETS responses _must_ have `Content-ID` and `Object-ID` headers. From 672a9b36f203311fb449347633c463edbbe801a8 Mon Sep 17 00:00:00 2001 From: Mahesh Khetpal <153089041+MaheshKhetpal@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:07:44 +0530 Subject: [PATCH 19/21] reverting the changes (#74) --- rets/http/parsers/parse_object.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/rets/http/parsers/parse_object.py b/rets/http/parsers/parse_object.py index 627c9d4..2b0df75 100644 --- a/rets/http/parsers/parse_object.py +++ b/rets/http/parsers/parse_object.py @@ -89,8 +89,6 @@ def _parse_body_part(part: ResponseLike) -> Optional[Object]: except RetsApiError as e: if e.reply_code == 20403: # No object found return None - elif e.reply_code == 20407: # Access to object not allowed - return None raise # All RETS responses _must_ have `Content-ID` and `Object-ID` headers. From 8245a3c505f1fa7769a9c582caaf477ba2919b15 Mon Sep 17 00:00:00 2001 From: Davidson Raj <91478211+oddavidson@users.noreply.github.com> Date: Tue, 15 Oct 2024 06:38:30 -0400 Subject: [PATCH 20/21] Update parse_object.py (#73) --- rets/http/parsers/parse_object.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rets/http/parsers/parse_object.py b/rets/http/parsers/parse_object.py index 2b0df75..627c9d4 100644 --- a/rets/http/parsers/parse_object.py +++ b/rets/http/parsers/parse_object.py @@ -89,6 +89,8 @@ def _parse_body_part(part: ResponseLike) -> Optional[Object]: except RetsApiError as e: if e.reply_code == 20403: # No object found return None + elif e.reply_code == 20407: # Access to object not allowed + return None raise # All RETS responses _must_ have `Content-ID` and `Object-ID` headers. From 40201b9bc4c0aa2c72ec0a2374e440bb6debbba4 Mon Sep 17 00:00:00 2001 From: Mahesh Khetpal Date: Tue, 15 Oct 2024 20:43:26 +0530 Subject: [PATCH 21/21] updating the version for rets-python --- .bumpversion.cfg | 2 +- rets/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index c167183..d110378 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = True tag = True -current_version = 0.4.10 +current_version = 0.4.12 parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? serialize = {major}.{minor}.{patch}-{release} diff --git a/rets/__init__.py b/rets/__init__.py index 3775915..2ab05fb 100644 --- a/rets/__init__.py +++ b/rets/__init__.py @@ -3,7 +3,7 @@ from rets.http.data import Metadata, Object, SearchResult, SystemMetadata __title__ = 'rets' -__version__ = '0.4.10' +__version__ = '0.4.12' __author__ = 'Martin Liu ' __license__ = 'MIT License' diff --git a/setup.py b/setup.py index c536307..013215f 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ setup( name='rets-python', - version='0.4.10', + version='0.4.12', description='rets-python', long_description=long_desc, author='Martin Liu',