GithubHelp home page GithubHelp logo

civics_cdf_validator's Introduction

civics_cdf_validator is a script that checks if a NIST 1500-100 data feed follows best practices. It will output errors, warnings, and info messages for common issues.

This is not an official Google product.

INSTALLATION

The package is available from PyPi and can be installed using the command below.

pip install civics_cdf_validator

civics_cdf_validator relies on lxml which will be installed if it isn't already installed. You may need to install libxslt development libraries in order to build lxml.

USAGE

Supported feeds

You can use civics_cdf_validator to check different types of feed:

  • Officeholder
  • Candidate / results

List rules

You can list the default validation rules attached with a brief desciption of each by using the "list" command:

civics_cdf_validator list

You can also customize the displayed list by specifing your set of rules or at least you can filter the default list using paramters as the feed type / ignore rules flag.

For more details, you can use the command help :

civics_cdf_validator list --help

Validate a file

The validate command has 2 required arguments:

  • the election file to be validated
  • the XSD file to validate against

The command to validate the election file against all the rules in the file is

civics_cdf_validator validate election_file.xml --xsd civics_cdf_spec.xsd

The validator is capable of validating either election or officeholder data feeds, depending on the value of the --rule_set flag (election is the default). To validate an officeholder feed:

civics_cdf_validator validate election_file.xml --xsd civics_cdf_spec.xsd --rule_set officeholder

One can choose to only validate one or more comma separated rules by using the -i flag

civics_cdf_validator validate election_file.xml --xsd civics_cdf_spec.xsd -i Schema

Or choose to exclude one or more comma separated rules using the -e flag

civics_cdf_validator validate election_file.xml --xsd civics_cdf_spec.xsd -e Schema

By default, the script only shows a summary of issues found. You can get a verbose report by adding the -v flag

civics_cdf_validator validate election_file.xml --xsd civics_cdf_spec.xsd -v

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.