"""
This type stub file was generated by pyright.
"""

import copy
import csv
import itertools
import json
import math
import random
import re
import sys
import textwrap
import pkg_resources
import wcwidth
from html import escape
from html.parser import HTMLParser
from io import StringIO
from cgi import escape
from HTMLParser import HTMLParser
from StringIO import StringIO

__version__ = pkg_resources.get_distribution(__name__).version
py3k = sys.version_info[0] >= 3
if py3k:
    unicode = str
    basestring = str
    itermap = map
    iterzip = zip
    uni_chr = chr
else:
    itermap = itertools.imap
    iterzip = itertools.izip
    uni_chr = unichr
FRAME = 0
ALL = 1
NONE = 2
HEADER = 3
DEFAULT = 10
MSWORD_FRIENDLY = 11
PLAIN_COLUMNS = 12
MARKDOWN = 13
ORGMODE = 14
RANDOM = 20
_re = re.compile(r"\033\[[0-9;]*m")
class PrettyTable(object):
    def __init__(self, field_names=..., **kwargs) -> None:
        """Return a new PrettyTable instance

        Arguments:

        encoding - Unicode encoding scheme used to decode any encoded input
        title - optional table title
        field_names - list or tuple of field names
        fields - list or tuple of field names to include in displays
        start - index of first data row to include in output
        end - index of last data row to include in output PLUS ONE (list slice style)
        header - print a header showing field names (True or False)
        header_style - stylisation to apply to field names in header
            ("cap", "title", "upper", "lower" or None)
        border - print a border around the table (True or False)
        hrules - controls printing of horizontal rules after rows.
            Allowed values: FRAME, HEADER, ALL, NONE
        vrules - controls printing of vertical rules between columns.
            Allowed values: FRAME, ALL, NONE
        int_format - controls formatting of integer data
        float_format - controls formatting of floating point data
        min_table_width - minimum desired table width, in characters
        max_table_width - maximum desired table width, in characters
        padding_width - number of spaces on either side of column data
            (only used if left and right paddings are None)
        left_padding_width - number of spaces on left hand side of column data
        right_padding_width - number of spaces on right hand side of column data
        vertical_char - single character string used to draw vertical lines
        horizontal_char - single character string used to draw horizontal lines
        junction_char - single character string used to draw line junctions
        sortby - name of field to sort rows by
        sort_key - sorting key function, applied to data points before sorting
        valign - default valign for each row (None, "t", "m" or "b")
        reversesort - True or False to sort in descending or ascending order
        oldsortslice - Slice rows before sorting in the "old style" """
        ...
    
    def __getattr__(self, name):
        ...
    
    def __getitem__(self, index):
        ...
    
    if py3k:
        def __str__(self) -> str:
            ...
        
    else:
        def __str__(self) -> str:
            ...
        
    def __unicode__(self):
        ...
    
    @property
    def field_names(self):
        """List or tuple of field names

        When setting field_names, if there are already field names the new list
        of field names must be the same length. Columns are renamed and row data
        remains unchanged."""
        ...
    
    @field_names.setter
    def field_names(self, val):
        ...
    
    @property
    def align(self):
        """Controls alignment of fields
        Arguments:

        align - alignment, one of "l", "c", or "r" """
        ...
    
    @align.setter
    def align(self, val):
        ...
    
    @property
    def valign(self):
        """Controls vertical alignment of fields
        Arguments:

        valign - vertical alignment, one of "t", "m", or "b" """
        ...
    
    @valign.setter
    def valign(self, val):
        ...
    
    @property
    def max_width(self):
        """Controls maximum width of fields
        Arguments:

        max_width - maximum width integer"""
        ...
    
    @max_width.setter
    def max_width(self, val):
        ...
    
    @property
    def min_width(self):
        """Controls minimum width of fields
        Arguments:

        min_width - minimum width integer"""
        ...
    
    @min_width.setter
    def min_width(self, val):
        ...
    
    @property
    def min_table_width(self):
        ...
    
    @min_table_width.setter
    def min_table_width(self, val):
        ...
    
    @property
    def max_table_width(self):
        ...
    
    @max_table_width.setter
    def max_table_width(self, val):
        ...
    
    @property
    def fields(self):
        """List or tuple of field names to include in displays"""
        ...
    
    @fields.setter
    def fields(self, val):
        ...
    
    @property
    def title(self):
        """Optional table title

        Arguments:

        title - table title"""
        ...
    
    @title.setter
    def title(self, val):
        ...
    
    @property
    def start(self):
        """Start index of the range of rows to print

        Arguments:

        start - index of first data row to include in output"""
        ...
    
    @start.setter
    def start(self, val):
        ...
    
    @property
    def end(self):
        """End index of the range of rows to print

        Arguments:

        end - index of last data row to include in output PLUS ONE (list slice style)"""
        ...
    
    @end.setter
    def end(self, val):
        ...
    
    @property
    def sortby(self):
        """Name of field by which to sort rows

        Arguments:

        sortby - field name to sort by"""
        ...
    
    @sortby.setter
    def sortby(self, val):
        ...
    
    @property
    def reversesort(self):
        """Controls direction of sorting (ascending vs descending)

        Arguments:

        reveresort - set to True to sort by descending order, or False to sort by
            ascending order"""
        ...
    
    @reversesort.setter
    def reversesort(self, val):
        ...
    
    @property
    def sort_key(self):
        """Sorting key function, applied to data points before sorting

        Arguments:

        sort_key - a function which takes one argument and returns something to be
        sorted"""
        ...
    
    @sort_key.setter
    def sort_key(self, val):
        ...
    
    @property
    def header(self):
        """Controls printing of table header with field names

        Arguments:

        header - print a header showing field names (True or False)"""
        ...
    
    @header.setter
    def header(self, val):
        ...
    
    @property
    def header_style(self):
        """Controls stylisation applied to field names in header

        Arguments:

        header_style - stylisation to apply to field names in header
            ("cap", "title", "upper", "lower" or None)"""
        ...
    
    @header_style.setter
    def header_style(self, val):
        ...
    
    @property
    def border(self):
        """Controls printing of border around table

        Arguments:

        border - print a border around the table (True or False)"""
        ...
    
    @border.setter
    def border(self, val):
        ...
    
    @property
    def hrules(self):
        """Controls printing of horizontal rules after rows

        Arguments:

        hrules - horizontal rules style.  Allowed values: FRAME, ALL, HEADER, NONE"""
        ...
    
    @hrules.setter
    def hrules(self, val):
        ...
    
    @property
    def vrules(self):
        """Controls printing of vertical rules between columns

        Arguments:

        vrules - vertical rules style.  Allowed values: FRAME, ALL, NONE"""
        ...
    
    @vrules.setter
    def vrules(self, val):
        ...
    
    @property
    def int_format(self):
        """Controls formatting of integer data
        Arguments:

        int_format - integer format string"""
        ...
    
    @int_format.setter
    def int_format(self, val):
        ...
    
    @property
    def float_format(self):
        """Controls formatting of floating point data
        Arguments:

        float_format - floating point format string"""
        ...
    
    @float_format.setter
    def float_format(self, val):
        ...
    
    @property
    def padding_width(self):
        """The number of empty spaces between a column's edge and its content

        Arguments:

        padding_width - number of spaces, must be a positive integer"""
        ...
    
    @padding_width.setter
    def padding_width(self, val):
        ...
    
    @property
    def left_padding_width(self):
        """The number of empty spaces between a column's left edge and its content

        Arguments:

        left_padding - number of spaces, must be a positive integer"""
        ...
    
    @left_padding_width.setter
    def left_padding_width(self, val):
        ...
    
    @property
    def right_padding_width(self):
        """The number of empty spaces between a column's right edge and its content

        Arguments:

        right_padding - number of spaces, must be a positive integer"""
        ...
    
    @right_padding_width.setter
    def right_padding_width(self, val):
        ...
    
    @property
    def vertical_char(self):
        """The character used when printing table borders to draw vertical lines

        Arguments:

        vertical_char - single character string used to draw vertical lines"""
        ...
    
    @vertical_char.setter
    def vertical_char(self, val):
        ...
    
    @property
    def horizontal_char(self):
        """The character used when printing table borders to draw horizontal lines

        Arguments:

        horizontal_char - single character string used to draw horizontal lines"""
        ...
    
    @horizontal_char.setter
    def horizontal_char(self, val):
        ...
    
    @property
    def junction_char(self):
        """The character used when printing table borders to draw line junctions

        Arguments:

        junction_char - single character string used to draw line junctions"""
        ...
    
    @junction_char.setter
    def junction_char(self, val):
        ...
    
    @property
    def format(self):
        """Controls whether or not HTML tables are formatted to match styling options

        Arguments:

        format - True or False"""
        ...
    
    @format.setter
    def format(self, val):
        ...
    
    @property
    def print_empty(self):
        """Controls whether or not empty tables produce a header and frame or just an
        empty string

        Arguments:

        print_empty - True or False"""
        ...
    
    @print_empty.setter
    def print_empty(self, val):
        ...
    
    @property
    def attributes(self):
        """A dictionary of HTML attribute name/value pairs to be included in the
        <table> tag when printing HTML

        Arguments:

        attributes - dictionary of attributes"""
        ...
    
    @attributes.setter
    def attributes(self, val):
        ...
    
    @property
    def oldsortslice(self):
        """ oldsortslice - Slice rows before sorting in the "old style" """
        ...
    
    @oldsortslice.setter
    def oldsortslice(self, val):
        ...
    
    def set_style(self, style):
        ...
    
    def add_row(self, row):
        """Add a row to the table

        Arguments:

        row - row of data, should be a list with as many elements as the table
        has fields"""
        ...
    
    def del_row(self, row_index):
        """Delete a row from the table

        Arguments:

        row_index - The index of the row you want to delete.  Indexing starts at 0."""
        ...
    
    def add_column(self, fieldname, column, align=..., valign=...):
        """Add a column to the table.

        Arguments:

        fieldname - name of the field to contain the new column of data
        column - column of data, should be a list with as many elements as the
        table has rows
        align - desired alignment for this column - "l" for left, "c" for centre and
            "r" for right
        valign - desired vertical alignment for new columns - "t" for top,
            "m" for middle and "b" for bottom"""
        ...
    
    def del_column(self, fieldname):
        """Delete a column from the table

        Arguments:

        fieldname - The field name of the column you want to delete."""
        ...
    
    def clear_rows(self):
        """Delete all rows from the table but keep the current field names"""
        ...
    
    def clear(self):
        """Delete all rows and field names from the table, maintaining nothing but
        styling options"""
        ...
    
    def copy(self):
        ...
    
    def get_string(self, **kwargs):
        """Return string representation of table in current state.

        Arguments:

        title - optional table title
        start - index of first data row to include in output
        end - index of last data row to include in output PLUS ONE (list slice style)
        fields - names of fields (columns) to include
        header - print a header showing field names (True or False)
        border - print a border around the table (True or False)
        hrules - controls printing of horizontal rules after rows.
            Allowed values: ALL, FRAME, HEADER, NONE
        vrules - controls printing of vertical rules between columns.
            Allowed values: FRAME, ALL, NONE
        int_format - controls formatting of integer data
        float_format - controls formatting of floating point data
        padding_width - number of spaces on either side of column data (only used if
            left and right paddings are None)
        left_padding_width - number of spaces on left hand side of column data
        right_padding_width - number of spaces on right hand side of column data
        vertical_char - single character string used to draw vertical lines
        horizontal_char - single character string used to draw horizontal lines
        junction_char - single character string used to draw line junctions
        sortby - name of field to sort rows by
        sort_key - sorting key function, applied to data points before sorting
        reversesort - True or False to sort in descending or ascending order
        print empty - if True, stringify just the header for an empty table,
            if False return an empty string"""
        ...
    
    def paginate(self, page_length=..., **kwargs):
        ...
    
    def get_csv_string(self, **kwargs):
        """Return string representation of CSV formatted table in the current state

        Keyword arguments are first interpreted as table formatting options, and
        then any unused keyword arguments are passed to csv.writer(). For
        example, get_csv_string(header=False, delimiter='\t') would use
        header as a PrettyTable formatting option (skip the header row) and
        delimiter as a csv.writer keyword argument.
        """
        ...
    
    def get_json_string(self, **kwargs):
        """Return string representation of JSON formatted table in the current state

        Arguments:

        none yet"""
        ...
    
    def get_html_string(self, **kwargs):
        """Return string representation of HTML formatted version of table in current
        state.

        Arguments:

        title - optional table title
        start - index of first data row to include in output
        end - index of last data row to include in output PLUS ONE (list slice style)
        fields - names of fields (columns) to include
        header - print a header showing field names (True or False)
        border - print a border around the table (True or False)
        hrules - controls printing of horizontal rules after rows.
            Allowed values: ALL, FRAME, HEADER, NONE
        vrules - controls printing of vertical rules between columns.
            Allowed values: FRAME, ALL, NONE
        int_format - controls formatting of integer data
        float_format - controls formatting of floating point data
        padding_width - number of spaces on either side of column data (only used if
            left and right paddings are None)
        left_padding_width - number of spaces on left hand side of column data
        right_padding_width - number of spaces on right hand side of column data
        sortby - name of field to sort rows by
        sort_key - sorting key function, applied to data points before sorting
        attributes - dictionary of name/value pairs to include as HTML attributes in the
            <table> tag
        xhtml - print <br/> tags if True, <br> tags if false"""
        ...
    


def from_csv(fp, field_names=..., **kwargs):
    ...

def from_db_cursor(cursor, **kwargs):
    ...

def from_json(json_string, **kwargs):
    ...

class TableHandler(HTMLParser):
    def __init__(self, **kwargs) -> None:
        ...
    
    def handle_starttag(self, tag, attrs):
        ...
    
    def handle_endtag(self, tag):
        ...
    
    def handle_data(self, data):
        ...
    
    def generate_table(self, rows):
        """
        Generates from a list of rows a PrettyTable object.
        """
        ...
    
    def make_fields_unique(self, fields):
        """
        iterates over the row and make each field unique
        """
        ...
    


def from_html(html_code, **kwargs):
    """
    Generates a list of PrettyTables from a string of HTML code. Each <table> in
    the HTML becomes one PrettyTable object.
    """
    ...

def from_html_one(html_code, **kwargs):
    """
    Generates a PrettyTables from a string of HTML code which contains only a
    single <table>
    """
    ...

def main():
    ...

if __name__ == "__main__":
    ...
