Module ImportFrom alias Import alias ImportFrom alias FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad ListLoad ListLoad Str body Expr Str Assign NameStore ListLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr If NameLoad body Expr Call AttributeLoad NameLoad attr Str If NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str If NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Str Str Str Str Str Str For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body TryExcept body Return Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Pass orelse Raise Call NameLoad Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args defaults vararg body Expr Str FunctionDef arguments args NameParam NameParam defaults body Return Lambda arguments args NameParam defaults Call NameLoad Call NameLoad NameLoad decorator_list Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list
N/A datetime datetime N/A functools openelex.lib.text slugify build_github_url N/A N/A state generated_filename N/A N/A N/A 
    Generate a URL to a preprocessed result file hosted on GitHub

    Args:
        generated_filename: Standardized filename of an election result file.

    Returns:
        String containing a URL to the preprocessed result file on GitHub.

     N/A tpl https://raw.githubusercontent.com/openelections/openelections-data-{}/master/{} N/A N/A N/A tpl format N/A N/A state lower generated_filename N/A build_raw_github_url N/A N/A state datestring raw_filename N/A N/A N/A 
    Generate a URL to a raw result file hosted on GitHub

    Args:
        raw_filename: Raw filename of an election result file.

    Returns:
        String containing a URL to the raw result file on GitHub.

     N/A tpl https://raw.githubusercontent.com/openelections/openelections-data-{}/master/{}/{} N/A N/A N/A tpl format N/A N/A state lower datestring raw_filename N/A standardized_filename N/A N/A state start_date extension party special race_type reporting_level jurisdiction office office_district prefix_bits suffix_bits sep N/A None False None None None None None N/A N/A __ N/A N/A 
    Standardize an election-related filename.

    For more on filename standardization conventions, see
    http://docs.openelections.net/archive-standardization/.

    Args:
        state (string): State abbreviation, for example "md".
        start_date (string): String representing the election's start date
            in YYYY-MM-DD format.
        extension (string): Filename extension, including the leading '.'.  For
            example, ".csv".
        party (string, optional): Slug representing the political party of
            information in the file.
        special (boolean, optional): Whether the file contains data related to a
            special election.  Default is False.
        race_type (string, optional): Slug representing the type of election
            contest.  For example, "general", "primary", etc.
        reporting_level (string, optional): Slug representing the reporting level of
            the data file.  This could be something like 'county' or
            'precinct'.
        jurisdiction (string, optional): The jurisdiction of the data
            covered in the file.
        office (string, optional): Office if results are for a single office.
        office_district (string, optional): Office district number if
           the data in the file are for a single office.
        prefix_bits (list, optional): List of strings that will be prepended to
            the generated filename and separated by the value of ``sep``.
        suffix_bits (list, optional): List of strings that will be appended
            to the generated filename and separated by the value of ``sep``.
        sep (string, optional): Separator between filename elements.  Default
            is "__".

    Returns:
        A string representing the standardized filename for
        election-related data.

     N/A bits N/A N/A N/A N/A bits extend prefix_bits N/A N/A N/A bits extend N/A N/A N/A start_date replace - N/A N/A state lower N/A special N/A N/A N/A N/A bits append special N/A party N/A N/A N/A N/A bits append N/A slugify party N/A race_type N/A N/A N/A N/A bits append N/A N/A race_type replace - _ N/A jurisdiction N/A N/A N/A N/A bits append N/A slugify jurisdiction N/A office N/A N/A N/A N/A bits append N/A slugify office N/A office_district N/A N/A N/A N/A bits append N/A slugify office_district N/A reporting_level N/A N/A N/A N/A bits append reporting_level N/A N/A N/A bits extend suffix_bits N/A N/A N/A N/A sep join bits extension N/A format_date N/A N/A datestr N/A N/A N/A 
    Convert date string into a format used within a searchable data field.

    This is needed because calling code, likely an invoke task uses dates
    in "%Y%m%d" format and the data store uses dates in "%Y-%m-%d" format.

    Args:
        datestr (string): Date string in "%Y%m%d" format.

    Returns:
        Date string in "%Y-%m-%d" format.

    Raises:
        ValueError if date string is not in an expected format.

     N/A datefilter_formats N/A %Y %Y%m %Y%m%d %Y %Y-%m %Y-%m-%d N/A N/A infmt outfmt N/A N/A datefilter_formats items N/A N/A N/A N/A N/A N/A N/A N/A datetime strptime datestr infmt strftime outfmt N/A N/A N/A ValueError N/A N/A N/A N/A N/A ValueError N/A N/A Invalid date format '{}' format datestr N/A compose N/A N/A N/A functions N/A N/A 
    Compose an arbitary number of functions

    Implementation by Mathieu Larose
    https://mathieularose.com/function-composition-in-python

     compose2 N/A N/A f g N/A N/A N/A N/A N/A N/A x N/A N/A f N/A g x N/A N/A N/A N/A functools reduce compose2 functions N/A