generated from City-Bureau/city-scrapers-template
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
prod.py
44 lines (34 loc) · 1.27 KB
/
prod.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
from .base import * # noqa
USER_AGENT = "City Scrapers [production mode]. Learn more and say hello at https://citybureau.org/city-scrapers" # noqa
ITEM_PIPELINES = {
"city_scrapers_core.pipelines.AzureDiffPipeline": 200,
"city_scrapers_core.pipelines.MeetingPipeline": 300,
"city_scrapers_core.pipelines.OpenCivicDataPipeline": 400,
}
SENTRY_DSN = os.getenv("SENTRY_DSN")
EXTENSIONS = {
"city_scrapers_core.extensions.AzureBlobStatusExtension": 100,
"scrapy_sentry_errors.extensions.Errors": 10,
"scrapy.extensions.closespider.CloseSpider": None,
}
FEED_EXPORTERS = {
"json": "scrapy.exporters.JsonItemExporter",
"jsonlines": "scrapy.exporters.JsonLinesItemExporter",
}
FEED_FORMAT = "jsonlines"
FEED_STORAGES = {
"azure": "city_scrapers_core.extensions.AzureBlobFeedStorage",
}
AZURE_ACCOUNT_NAME = os.getenv("AZURE_ACCOUNT_NAME")
AZURE_ACCOUNT_KEY = os.getenv("AZURE_ACCOUNT_KEY")
AZURE_CONTAINER = os.getenv("AZURE_CONTAINER")
CITY_SCRAPERS_STATUS_CONTAINER = os.getenv("AZURE_STATUS_CONTAINER")
FEED_URI = (
"azure://{account_name}:{account_key}@{container}"
"/%(year)s/%(month)s/%(day)s/%(hour_min)s/%(name)s.json"
).format(
account_name=AZURE_ACCOUNT_NAME,
account_key=AZURE_ACCOUNT_KEY,
container=AZURE_CONTAINER,
)