Skip to content

Commit c9d708c

Browse files
committed
Cleaned up files (requirements.txt was modified by pre-commit)
1 parent e2d1b39 commit c9d708c

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ci:
22
autoupdate_schedule: quarterly
33
skip: [pip-compile]
44
default_language_version:
5-
python: python3.10
5+
python: python3.11
66
repos:
77
- repo: https://github.com/astral-sh/ruff-pre-commit
88
rev: v0.6.9

ca_qc_sainte_anne_de_bellevue/people.py

+6-15
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import re
2-
31
from utils import CanadianPerson as Person
42
from utils import CanadianScraper
53

64
COUNCIL_PAGE = "https://www.ville.sainte-anne-de-bellevue.qc.ca/fr/199/elus-municipaux"
75

6+
87
class SainteAnneDeBellevuePersonScraper(CanadianScraper):
98
def scrape(self):
109
def decode_email(e):
@@ -20,8 +19,8 @@ def decode_email(e):
2019

2120
councillors = page.xpath('//div[@class="col-md-12"]')[0]
2221
assert len(councillors), "No councillors found"
23-
24-
roles_and_districts = councillors.xpath('.//h2/text()')
22+
23+
roles_and_districts = councillors.xpath(".//h2/text()")
2524
roles = []
2625
districts = []
2726
names = []
@@ -32,30 +31,22 @@ def decode_email(e):
3231
role_and_district = role.split()
3332

3433
roles.append(role_and_district[0])
35-
34+
3635
if len(role_and_district) == 1:
3736
districts.append("Sainte-Anne-de-Bellevue")
3837
else:
3938
districts.append("District " + role_and_district[2])
40-
39+
4140
# Fill in contact info via p tags.
4241
contact_info = councillors.xpath('.//p[a[contains(@href, "@")]]')
4342
for contact in contact_info:
4443
contact = contact.text_content().split()
45-
print(contact)
46-
input()
4744
name = " ".join(contact[:2])
4845
names.append(name)
49-
46+
5047
email = contact[3]
5148
email = email.replace("Président", "")
5249
emails.append(email)
53-
54-
print(roles)
55-
print(districts)
56-
print(names)
57-
print(emails)
58-
input()
5950

6051
assert len(roles) == len(districts) == len(names) == len(emails), "Lists are not of equal length"
6152
for i in range(len(roles)):

requirements.txt

-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ sqlparse==0.5.1
6969
# via django
7070
text-unidecode==1.3
7171
# via python-slugify
72-
typing-extensions==4.12.2
73-
# via asgiref
7472
unidecode==0.4.14
7573
# via -r requirements.in
7674
urllib3==1.26.20

0 commit comments

Comments
 (0)