forked from freelawproject/juriscraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpinionSite.py
91 lines (65 loc) · 2.38 KB
/
OpinionSite.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
91
from AbstractSite import AbstractSite
class OpinionSite(AbstractSite):
"""Contains generic methods for scraping data. Should be extended by all
scrapers.
Should not contain lists that can't be sorted by the _date_sort function.
"""
def __init__(self):
super(OpinionSite, self).__init__()
# Order of attributes is important as it affects the order of parsing.
# Some methods rely on others having already been run.
self._opt_attrs = [
'adversary_numbers', 'causes', 'dispositions', 'divisions',
'docket_attachment_numbers', 'docket_document_numbers',
'docket_numbers', 'judges', 'lower_courts', 'lower_court_judges',
'lower_court_numbers', 'nature_of_suit', 'neutral_citations',
'summaries', 'west_citations', 'west_state_citations'
]
self._req_attrs = ['case_dates', 'case_names', 'download_urls',
'precedential_statuses']
# For date sorting to work, case_dates must be first in _all_attrs.
self._all_attrs = self._req_attrs + self._opt_attrs
# Set all metadata to None
for attr in self._all_attrs:
self.__setattr__(attr, None)
def _get_adversary_numbers(self):
# Common in bankruptcy cases where there are adversary proceedings.
return None
def _get_download_urls(self):
return None
def _get_case_dates(self):
return None
def _get_case_names(self):
return None
def _get_causes(self):
return None
def _get_dispositions(self):
return None
def _get_divisions(self):
return None
def _get_docket_attachment_numbers(self):
return None
def _get_docket_document_numbers(self):
return None
def _get_docket_numbers(self):
return None
def _get_judges(self):
return None
def _get_nature_of_suit(self):
return None
def _get_neutral_citations(self):
return None
def _get_lower_courts(self):
return None
def _get_lower_court_judges(self):
return None
def _get_lower_court_numbers(self):
return None
def _get_precedential_statuses(self):
return None
def _get_summaries(self):
return None
def _get_west_citations(self):
return None
def _get_west_state_citations(self):
return None