civics-cdf-validator 1.67.dev7__tar.gz → 1.67.dev8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {civics_cdf_validator-1.67.dev7/civics_cdf_validator.egg-info → civics_cdf_validator-1.67.dev8}/PKG-INFO +1 -1
  2. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
  3. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/civics_cdf_validator.egg-info/SOURCES.txt +1 -0
  4. civics_cdf_validator-1.67.dev8/rules.py +59 -0
  5. civics_cdf_validator-1.67.dev7/rules.py → civics_cdf_validator-1.67.dev8/rulesets/metadata_rules.py +1 -40
  6. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/version.py +1 -1
  7. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/CONTRIBUTING.md +0 -0
  8. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/LICENSE-2.0.txt +0 -0
  9. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/MANIFEST.in +0 -0
  10. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/README.md +0 -0
  11. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/__init__.py +0 -0
  12. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/base.py +0 -0
  13. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
  14. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
  15. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/civics_cdf_validator.egg-info/requires.txt +0 -0
  16. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/civics_cdf_validator.egg-info/top_level.txt +0 -0
  17. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/gpunit_rules.py +0 -0
  18. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/loggers.py +0 -0
  19. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/office_utils.py +0 -0
  20. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/rulesets/__init__.py +0 -0
  21. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/rulesets/committee_rules.py +0 -0
  22. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/rulesets/common_rules.py +0 -0
  23. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/rulesets/election_dates_rules.py +0 -0
  24. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/rulesets/election_rules.py +0 -0
  25. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/rulesets/officeholder_rules.py +0 -0
  26. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/rulesets/rule_util.py +0 -0
  27. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/rulesets/voter_information_rules.py +0 -0
  28. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/setup.cfg +0 -0
  29. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/setup.py +0 -0
  30. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/stats.py +0 -0
  31. {civics_cdf_validator-1.67.dev7 → civics_cdf_validator-1.67.dev8}/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: civics_cdf_validator
3
- Version: 1.67.dev7
3
+ Version: 1.67.dev8
4
4
  Summary: Checks if an election feed follows best practices
5
5
  Home-page: https://github.com/google/civics_cdf_validator
6
6
  Author: Google Civics
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: civics_cdf_validator
3
- Version: 1.67.dev7
3
+ Version: 1.67.dev8
4
4
  Summary: Checks if an election feed follows best practices
5
5
  Home-page: https://github.com/google/civics_cdf_validator
6
6
  Author: Google Civics
@@ -20,6 +20,7 @@ setup.py
20
20
  ./rulesets/common_rules.py
21
21
  ./rulesets/election_dates_rules.py
22
22
  ./rulesets/election_rules.py
23
+ ./rulesets/metadata_rules.py
23
24
  ./rulesets/officeholder_rules.py
24
25
  ./rulesets/rule_util.py
25
26
  ./rulesets/voter_information_rules.py
@@ -0,0 +1,59 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """Validation rules for the CDF XML validator."""
15
+
16
+ from __future__ import print_function
17
+
18
+ import enum
19
+
20
+ from civics_cdf_validator.rulesets import committee_rules
21
+ from civics_cdf_validator.rulesets import common_rules
22
+ from civics_cdf_validator.rulesets import election_dates_rules
23
+ from civics_cdf_validator.rulesets import election_rules
24
+ from civics_cdf_validator.rulesets import metadata_rules
25
+ from civics_cdf_validator.rulesets import officeholder_rules
26
+ from civics_cdf_validator.rulesets import voter_information_rules
27
+
28
+
29
+ class RuleSet(enum.Enum):
30
+ """Names for sets of rules used to validate a particular feed type."""
31
+
32
+ ELECTION = 1
33
+ OFFICEHOLDER = 2
34
+ COMMITTEE = 3
35
+ ELECTION_DATES = 4
36
+ ELECTION_RESULTS = 5
37
+ METADATA = 6
38
+ VOTER_INFORMATION = 7
39
+
40
+
41
+ # To add new rules, create a new class in the matching file under rulesets/,
42
+ # inherit the base rule, and add it to that file's rule list.
43
+ COMMON_RULES = common_rules.COMMON_RULES
44
+ ELECTION_RULES = election_rules.ELECTION_RULES
45
+ OFFICEHOLDER_RULES = officeholder_rules.OFFICEHOLDER_RULES
46
+ COMMITTEE_RULES = committee_rules.COMMITTEE_RULES
47
+ ELECTION_DATES_RULES = election_dates_rules.ELECTION_DATES_RULES
48
+ METADATA_RULES = metadata_rules.METADATA_RULES
49
+ VOTER_INFORMATION_RULES = voter_information_rules.VOTER_INFORMATION_RULES
50
+
51
+ ALL_RULES = frozenset(
52
+ COMMON_RULES
53
+ + ELECTION_RULES
54
+ + OFFICEHOLDER_RULES
55
+ + COMMITTEE_RULES
56
+ + ELECTION_DATES_RULES
57
+ + VOTER_INFORMATION_RULES
58
+ + METADATA_RULES
59
+ )
@@ -11,23 +11,17 @@
11
11
  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
- """Validation rules for the CDF XML validator."""
14
+ """Validation rules for metadata feeds of the CDF XML validator."""
15
15
 
16
16
  from __future__ import print_function
17
17
 
18
18
  import datetime
19
- import enum
20
19
 
21
20
  from botocore import utils as botocore_utils
22
21
  from civics_cdf_validator import base
23
22
  from civics_cdf_validator import loggers
24
- from civics_cdf_validator.rulesets import committee_rules
25
23
  from civics_cdf_validator.rulesets import common_rules
26
- from civics_cdf_validator.rulesets import election_dates_rules
27
- from civics_cdf_validator.rulesets import election_rules
28
- from civics_cdf_validator.rulesets import officeholder_rules
29
24
  from civics_cdf_validator.rulesets import rule_util
30
- from civics_cdf_validator.rulesets import voter_information_rules
31
25
  import dateutil
32
26
  from frozendict import frozendict
33
27
 
@@ -457,28 +451,6 @@ class FeedElementsShouldHaveSubElementsBasedOnType(base.BaseRule):
457
451
  )
458
452
 
459
453
 
460
- class RuleSet(enum.Enum):
461
- """Names for sets of rules used to validate a particular feed type."""
462
-
463
- ELECTION = 1
464
- OFFICEHOLDER = 2
465
- COMMITTEE = 3
466
- ELECTION_DATES = 4
467
- ELECTION_RESULTS = 5
468
- METADATA = 6
469
- VOTER_INFORMATION = 7
470
-
471
-
472
- # To add new rules, create a new class, inherit the base rule,
473
- # and add it to the correct rule list.
474
- COMMON_RULES = common_rules.COMMON_RULES
475
- OFFICEHOLDER_RULES = officeholder_rules.OFFICEHOLDER_RULES
476
- ELECTION_RULES = election_rules.ELECTION_RULES
477
- ELECTION_DATES_RULES = election_dates_rules.ELECTION_DATES_RULES
478
- COMMITTEE_RULES = committee_rules.COMMITTEE_RULES
479
- VOTER_INFORMATION_RULES = voter_information_rules.VOTER_INFORMATION_RULES
480
-
481
-
482
454
  METADATA_RULES = (
483
455
  # go/keep-sorted start
484
456
  ElectionEventDatesAreSequential,
@@ -503,14 +475,3 @@ METADATA_RULES = (
503
475
  common_rules.UniqueLabel,
504
476
  # go/keep-sorted end
505
477
  )
506
-
507
-
508
- ALL_RULES = frozenset(
509
- COMMON_RULES
510
- + ELECTION_RULES
511
- + OFFICEHOLDER_RULES
512
- + COMMITTEE_RULES
513
- + ELECTION_DATES_RULES
514
- + VOTER_INFORMATION_RULES
515
- + METADATA_RULES
516
- )
@@ -5,4 +5,4 @@ No dependencies should be added to this module.
5
5
  See https://packaging.python.org/guides/single-sourcing-package-version/
6
6
  """
7
7
 
8
- __version__ = '1.67.dev7'
8
+ __version__ = '1.67.dev8'