This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 69
/
validators.py
90 lines (74 loc) · 2.56 KB
/
validators.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from schematics.models import Model
from schematics.types import (
DateTimeType,
DateType,
DictType,
IntType,
ListType,
StringType,
URLType,
)
class BaseModel(Model):
crawled_at = DateTimeType(required=True)
crawled_from = URLType(required=True)
class LegacyGazetteItem(BaseModel):
title = StringType(required=True)
published_on = StringType(required=False)
# important info but not available in years like 2010
date = DateType(required=False)
details = StringType(required=True)
file_urls = ListType(StringType)
file_content = StringType()
class GazetteItem(BaseModel):
date = DateType()
power = StringType(required=True)
year_and_edition = StringType(required=True)
events = ListType(DictType(StringType), required=True)
file_urls = ListType(StringType, required=True)
file_content = StringType()
class CityCouncilAgendaItem(BaseModel):
date = DateType()
details = StringType()
title = StringType(required=True)
event_type = StringType(required=True)
class CityCouncilAttendanceListItem(BaseModel):
date = DateType()
description = StringType()
council_member = StringType(required=True)
status = StringType(required=True)
class CityHallContractItem(BaseModel):
contract_id = StringType(required=True)
starts_at = DateType(formats=("%d/%m/%Y", "%d/%m/%y"))
summary = StringType()
contractor_document = StringType()
contractor_name = StringType()
value = StringType()
ends_at = DateType(formats=("%d/%m/%Y", "%d/%m/%y"))
file_urls = ListType(StringType)
file_content = StringType()
class CityHallBidItem(BaseModel):
category = StringType()
month = IntType(min_value=1, max_value=12)
year = IntType(min_value=1873) # quando Feira virou cidade :)
description = StringType()
history = ListType(DictType(StringType))
modality = StringType()
date = DateTimeType(formats=("%d/%m/%Y %Hh%M"))
file_urls = ListType(StringType)
file_content = StringType()
class CityHallPaymentsItem(BaseModel):
published_at = DateType(formats=("%d/%m/%Y", "%d/%m/%y"))
phase = StringType()
company_or_person = StringType(required=True)
value = StringType(required=True)
number = StringType()
document = StringType(required=True)
date = DateType(formats=("%d/%m/%Y", "%d/%m/%y"))
process_number = StringType()
summary = StringType()
group = StringType()
action = StringType()
function = StringType()
subfunction = StringType()
type_of_process = StringType()
resource = StringType()