From 419f054e2a108381b388b017314f846c4df7efc8 Mon Sep 17 00:00:00 2001 From: Daniel Simmons-Ritchie <37225902+SimmonsRitchie@users.noreply.github.com> Date: Tue, 30 Apr 2024 14:59:35 -0500 Subject: [PATCH] Deprecate spider chi_ssa_64 --- city_scrapers/spiders/chi_ssa_64.py | 107 ---------------------------- tests/files/chi_ssa_64.html | 39 ---------- tests/test_chi_ssa_64.py | 74 ------------------- 3 files changed, 220 deletions(-) delete mode 100644 city_scrapers/spiders/chi_ssa_64.py delete mode 100644 tests/files/chi_ssa_64.html delete mode 100644 tests/test_chi_ssa_64.py diff --git a/city_scrapers/spiders/chi_ssa_64.py b/city_scrapers/spiders/chi_ssa_64.py deleted file mode 100644 index 408480101..000000000 --- a/city_scrapers/spiders/chi_ssa_64.py +++ /dev/null @@ -1,107 +0,0 @@ -import html -import re -from datetime import datetime - -from city_scrapers_core.constants import COMMISSION -from city_scrapers_core.items import Meeting -from city_scrapers_core.spiders import CityScrapersSpider - - -class ChiSsa64Spider(CityScrapersSpider): - name = "chi_ssa_64" - agency = "Chicago Special Service Area #64 Walden Parkway" - timezone = "America/Chicago" - start_urls = ["https://www.mpbhba.org/business-resources/"] - - def parse(self, response): - meetings = self._parse_block(response) - for item in meetings: - meeting = Meeting( - title="Commission", - description="", - classification=COMMISSION, - start=self._parse_start(item), - end=None, - all_day=False, - time_notes="", - location=self._parse_location(item), - links=[], - source=self._parse_source(response), - ) - - meeting["status"] = self._get_status(meeting) - meeting["id"] = self._get_id(meeting) - - yield meeting - - def _parse_block(self, response): - """Parse data in specific SSA 20 meetings block.""" - result = [] - aux = [] - meetings = [] - count = 0 - general_block = response.xpath( - '//*[@class="et_pb_module et_pb_text et_pb_text_2 ' - 'et_pb_text_align_left et_pb_bg_layout_light"]' - ) - years = general_block.xpath( - './/*[@class="et_pb_text_inner"]/h3/text()' - ).extract() - specific_block = ( - general_block.xpath('.//*[@class="et_pb_text_inner"]') - .extract_first() - .split("") - ) - for line in specific_block: - if "SSA 64:" in line: - result.append(line.split("

")) - - for meetings_list in result: - year = years[count][0:4] - for meeting in meetings_list: - meeting = ( - meeting.replace("
", "").replace("SSA 64:
", "").strip() - ) - if meeting != "" and "

" not in meeting: - aux.append(year) - aux.append(html.unescape(meeting)) - count += 1 - - for i in range(0, len(aux), 2): - meetings.append(aux[i : i + 2]) - - return meetings - - def _parse_start(self, item): - """Parse start datetime as a naive datetime object.""" - time_zone = "AM" if ("a.m." in item[1]) else "PM" - result = re.split("a.m.|p.m.", item[1])[0].split(",") - date_string = ( - item[0] - + result[1] - + " " - + time_zone - + " " - + item[1].split("a.m.")[0].split(",")[2].strip() - ) - start = datetime.strptime(date_string, "%Y %B %d %p %H") - - return start - - def _parse_location(self, item): - """Parse or generate location.""" - result = ( - item[1].strip() + " Chicago, IL" - if ("Chicago, IL" not in item[1].strip()) - else item[1].strip() - ) - result = re.split("a.m.|p.m.", result)[1] - - return { - "address": ",".join(result.split(",")[1:]).strip(), - "name": result.split(",")[0].strip(), - } - - def _parse_source(self, response): - """Parse or generate source.""" - return response.url diff --git a/tests/files/chi_ssa_64.html b/tests/files/chi_ssa_64.html deleted file mode 100644 index 499e80f2c..000000000 --- a/tests/files/chi_ssa_64.html +++ /dev/null @@ -1,39 +0,0 @@ - Business Resources - Morgan Park Beverly Hills Business Association
773.779.2530

Why Beverly Hills/Morgan Park?

We are home to a variety of unique merchants and a blossoming restaurant and craft beer scene. These businesses, along with an abundance of professionals and service providers, make Beverly Hills/Morgan Park a vibrant hub of activity on the city’s South side.

Our commercial districts are supported by engaged and educated residents who are committed to shopping, dining and buying locally. Businesses in Beverly Hills/Morgan Park also bring customers from across the Chicagoland area and beyond. They are  drawn here by attractions including the Beverly Arts Center, the Morgan Park Sports Center, the South Side Irish St. Patrick’s Day Parade and the Beverly Art Walk.

Easily accessible via CTA rail and bus service, major interstates and the Metra commuter line, Beverly Hills/Morgan Park is located 20 minutes south of Chicago’s Loop and 20 minutes from Midway International Airport.

Business Data

Want to learn more about the consumers living in Beverly Hills/Morgan Park? The study, provided by Esri, uses 67 unique market segments to analyze our neighborhood.

SPECIAL SERVICE AREAS – SSA 20 / SSA 64

For more than 28 years, the Special Service Area (SSA) program in Chicago has provided communities with the financial means to create, maintain and manage competitive commercial districts.

​SSAs are local property tax districts that provide funding for enhanced services and programs—such as landscaping, sidewalk cleaning and debris removal, sidewalk snow removal, area branding and neighborhood identification—in communities across Chicago. The Chicago Department of Planning and Development (DPD) contracts with local nonprofits, typically chambers of commerce or business associations, as service providers to administer the program. The mayor appoints a local commission made up of SSA property owners and tenants to oversee the service provider and determine SSA services and budgets annually.

​SSA funds are controlled locally, must stay in the community and must be spent on services that achieve the mission of the particular SSA. Similar SSA programs operate in more than 50 areas throughout the city of Chicago and have been credited with enhancing neighborhood vitality.

​The MPBHBA is the service provider for both SSA 20 (Western Avenue) and SSA 64 (Walden Parkway). In this role, we work with each commission to determine and coordinated needed services. These tasks may include hiring subcontractors to fulfill the SSA services, We generate program reports to the DPD, SSA commissions, local aldermen and the community. We also assist with the recruitment of SSA commissioners, who determine the SSA budgets and services annually.

2019 SSA Meetings

SSA 20:
Wednesday, June 5, 9 a.m.
Beverly Bank & Trust, 10258 S. Western Ave.

Wednesday, July 10, 9 a.m.
Beverly Bank & Trust, 10258 S. Western Ave.

SSA 64:
Monday, July 8, 9 a.m.
Markland Hubbard, 1739 W. 99th St.

 

SSA 20 District Plan

SSA 20 / SSA 64 – Annual Reports (2017)

SSA 20 2017 audit

SSA 64 2017 audit

SSA 20 / SSA 64 – Quarterly Meeting Minutes

SSA 20 1st quarter 2018 meeting minutes

SSA 64 1st quarter 2018 meeting minutes

SSA 20 1st quarter 2019 meeting minutes

SSA 64 1st quarter 2019 meeting minutes

Available Property

- \ No newline at end of file diff --git a/tests/test_chi_ssa_64.py b/tests/test_chi_ssa_64.py deleted file mode 100644 index 1addc6450..000000000 --- a/tests/test_chi_ssa_64.py +++ /dev/null @@ -1,74 +0,0 @@ -from datetime import datetime -from os.path import dirname, join - -import pytest -from city_scrapers_core.constants import COMMISSION -from city_scrapers_core.utils import file_response -from freezegun import freeze_time - -from city_scrapers.spiders.chi_ssa_64 import ChiSsa64Spider - -test_response = file_response( - join(dirname(__file__), "files", "chi_ssa_64.html"), - url="https://www.mpbhba.org/business-resources/", -) -spider = ChiSsa64Spider() - -freezer = freeze_time("2020-05-26") -freezer.start() - -parsed_items = [item for item in spider.parse(test_response)] - -freezer.stop() - - -def test_title(): - assert parsed_items[0]["title"] == "Commission" - - -def test_description(): - assert parsed_items[0]["description"] == "" - - -def test_start(): - assert parsed_items[0]["start"] == datetime(2019, 7, 8, 9, 0) - - -def test_end(): - assert parsed_items[0]["end"] is None - - -def test_time_notes(): - assert parsed_items[0]["time_notes"] == "" - - -def test_id(): - assert parsed_items[0]["id"] == "chi_ssa_64/201907080900/x/commission" - - -def test_status(): - assert parsed_items[0]["status"] == "passed" - - -def test_location(): - assert parsed_items[0]["location"] == { - "name": "Markland Hubbard", - "address": "1739 W. 99th St. Chicago, IL", - } - - -def test_source(): - assert parsed_items[0]["source"] == "https://www.mpbhba.org/business-resources/" - - -def test_links(): - assert parsed_items[0]["links"] == [] - - -def test_classification(): - assert parsed_items[0]["classification"] == COMMISSION - - -@pytest.mark.parametrize("item", parsed_items) -def test_all_day(item): - assert item["all_day"] is False