API Reference

class korona.html.tags.A(charset=None, coords=None, download=None, href=None, hreflang=None, name=None, rel=None, rev=None, shape=None, target=None, type=None, text=None)[source]

Class for constructing anchor tag.

Parameters:
  • charset (str) – Specifies the character-set of a linked document.
  • coords (mixed) – A list/tuple/string of coordinate values.
  • download (str) – Specifies that the target will be downloaded when a user clicks on the hyper link.
  • href (str) – Specifies the URL of the page the link goes to.
  • hreflang (str) – Specifies the language of the linked document.
  • name (str) – Specifies the name of an anchor.
  • rel (str) – Specifies the relationship between the current document and the linked document.
  • rev (str) – Specifies the relationship between the linked document and the current document.
  • shape (str) – Specifies the shape of a link.
  • target (str) – Specifies where to open the linked document.
  • type (str) – Specifies the media type of the linked document.
  • text (str) – Anchor tag text. (Ex. <a>text</a>)

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

Changed in version 0.3.1: Added URL validation for href attribute.

Changed in version 0.4.3-dev: Now the user can be displayed with warnings for charset attribute. Used custom exceptions for all the attributes. Removed the method validate_values().

construct()[source]

Returns the constructed anchor tag <a></a>.

get_coords(shape, coords)[source]

Returns coordinates after a series of validations.

Parameters:
  • shape (str) – Shape of a link (Ex. rect/circle/poly/etc.)
  • coords (mixed) – A list/tuple/str of coordinate values.
Returns:

A string of coordinate values.

Return type:

str

pre_validate(href, attribute_name, value)[source]

Validates whether an attribute is dependant on another attribute or not. Some of the attributes requires href attribute to be set.

validate_charset(charset)[source]

Validates charset attribute. Warn the user showing the common character sets used.

class korona.html.tags.Abbr(text=None)[source]

Class for constructing abbr tag.

Parameters:text (str) – Abbr tag text. (Ex. <abbr>text</abbr>)

New in version 0.1.0.

Changed in version 0.2.0: Renamed construct_tag() to construct().

construct()[source]

Returns the constructed abbr tag <abbr></abbr>.

class korona.html.tags.Acronym(text=None)[source]

Class for constructing acronym tag.

Parameters:text (str) – Acronym tag text. (Ex. <acronym>text</acronym>)

New in version 0.1.0.

Changed in version 0.2.0: Renamed construct_tag() to construct().

construct()[source]

Returns the constructed acronym tag <acronym></acronym>.

class korona.html.tags.Address(text=None)[source]

Class for constructing address tag.

Parameters:text (str) – Address tag text. (Ex. <address>text</address>)

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

construct()[source]

Returns the constructed address tag <address></address>.

class korona.html.tags.Area(alt=None, coords=None, download=None, href=None, hreflang=None, media=None, nohref=False, rel=None, shape=None, target=None, type=None)[source]

Class for constructing area tag.

Parameters:
  • alt (str) – Specifies an alternate text for the area. Required if the href attribute is present.
  • coords (mixed) – Specifies the coordinates of the area.
  • download (str) – Specifies that the target will be downloaded when a user clicks on the hyper link.
  • href (str) – Specifies the hyperlink target for the area.
  • hreflang (str) – Specifies the language of the target URL.
  • media (str) – Specifies what media/device the target URL is optimized for.
  • nohref (bool) – Specifies that an area has no associated link.
  • rel (str) – Specifies the relationship between the current document and the target URL.
  • shape (str) – Specifies the shape of the area.
  • target (str) – Specifies where to open the target URL.
  • type (str) – Specifies the media type of the target URL.

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

Changed in version 0.3.1: Added URL validation for href attribute.

construct()[source]

Returns the constructed area tag <area></area>.

get_coords(shape, coords)[source]

Returns coordinates after a series of validations.

Parameters:
  • shape (str) – Shape of a link (Ex. rect/circle/poly/etc.)
  • coords (mixed) – A list/tuple/str of coordinate values.
Returns:

A string of coordinate values.

Return type:

str

pre_validate(href, attribute_name, value)[source]

Validates whether an attribute is dependant on another attribute or not. Some of the attributes requires href attribute to be set.

validate_alt(href, attribute_name, value)[source]

Validates area’s alt attribute.

validate_values(href, attribute_name, value)[source]

Validates whether the given attribute value is a valid value or not. Some of the attributes have confined values. Even if we give some other value, the html output would not be correct.

class korona.html.tags.Article(text=None)[source]

Class for constructing article tag.

Parameters:text (str) – Article tag text. (Ex. <article>text</article>)

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

construct()[source]

Returns the constructed article tag <article></article>.

class korona.html.tags.B(text=None)[source]

Class for constructing bold tag.

Parameters:text (str) – Bold tag text. (Ex. <b>text</b>)

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

construct()[source]

Returns the constructed bold tag <b></b>.

class korona.html.tags.Base(href=None, target=None)[source]

Class for constructing base tag.

Parameters:
  • href (str) – Specifies the base URL for all relative URLs in the page.
  • target (str) – Specifies the default target for all hyperlinks and forms in the page.

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

Changed in version 0.3.1: Added URL validation for href attribute.

construct()[source]

Returns the constructed base tag <base>.

validate_values(href, target)[source]

Validates the following: - Either of href or target attribute value is given. - Check whether both href and target attribute values are strings or not.

class korona.html.tags.Button(autofocus=False, disabled=False, form=None, formaction=None, formenctype=None, formmethod=None, formnovalidate=False, formtarget=None, name=None, type=None, value=None, text=None)[source]

Class for constructing button tag.

Parameters:
  • autofocus (bool) – Specifies that a button should automatically get focus when the page loads.
  • disabled (bool) – Specifies that a button should be disabled.
  • form (str) – Specifies one or more forms the button belongs to.
  • formaction (str) – Specifies where to send the form-data when a form is submitted. Only for type=”submit”.
  • formenctype (str) – Specifies how form-data should be encoded before sending it to a server. Only for type=”submit”.
  • formmethod (str) – Specifies how to send the form-data (which HTTP method to use). Only for type=”submit”.
  • formnovalidate (bool) – Specifies that the form-data should not be validated on submission. Only for type=”submit”.
  • formtarget (str) – Specifies where to display the response after submitting the form. Only for type=”submit”.
  • name (str) – Specifies a name for the button.
  • type (str) – Specifies the type of button.
  • value (str) – Specifies an initial value for the button.

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

Changed in version 0.4.3-dev: Removed validate_values() method.

construct()[source]

Returns the constructed base tag <button>.

pre_validate(type, attribute_name, value)[source]

Validates whether an attribute is dependant on another attribute or not. Some of the attributes requires type attribute to be set to ‘submit’.

validate_type(value)[source]

Validate the type attribute for a <button> element. Different browsers use different default types for the <button> element.

class korona.html.tags.Canvas(height=None, width=None)[source]

Class for constructing canvas tag.

Parameters:
  • height (str) – Specifies the height of the canvas.
  • width (str) – Specifies the width of the canvas.

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

construct()[source]

Returns the constructed canvas tag <canvas>.

class korona.html.tags.Caption(align=None, text=None)[source]

Class for constructing caption tag.

Parameters:
  • align (str) – Defines the alignment of the caption.
  • text (str) – Specifies the caption text.

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

construct()[source]

Returns the constructed caption tag <caption>.

class korona.html.tags.Cite(text)[source]

Class for constructing cite tag.

Parameters:text (str) – Specifies the citation text.

New in version 0.1.0.

Changed in version 0.2.0: Renamed the method construct_tag to construct.

construct()[source]

Returns the constructed cite tag <cite>.

class korona.html.tags.Col(align=None, char=None, charoff=None, span=None, valign=None, width=None)[source]

Class for constructing col tag.

Parameters:
  • align (str) – Specifies the alignment of the content related to a <col> element.
  • char (str) – Specifies the alignment of the content related to a <col> element to a character.
  • charoff (int) – Specifies the number of characters the content will be aligned from the character specified by the char attribute.
  • span (int) – Specifies the number of columns a <col> element should span.
  • valign (str) – Specifies the vertical alignment of the content related to a <col> element.
  • width (str) – Specifies the width of a <col> element.

New in version 0.2.0.

construct()[source]

Returns the constructed col tag <col>.

validate_char_attribute(align, value)[source]

Validates char attribute. The char attribute can only be used if the align attribute is set to “char”.

validate_charoff_attribute(align, char, value)[source]

Validates charoff attribute. The charoff attribute can only be used if the char attribute is specified and the align attribute is set to “char”.

class korona.html.tags.ColGroup(align=None, char=None, charoff=None, span=None, valign=None, width=None)[source]

Class for constructing colgroup tag.

Parameters:
  • align (str) – Aligns the content in a column group.
  • char (str) – Aligns the content in a column group to a character.
  • charoff (int) – Sets the number of characters the content will be aligned from the character specified by the char attribute.
  • span (int) – Specifies the number of columns a column group should span.
  • valign (str) – Vertical aligns the content in a column group.
  • width (str) – Specifies the width of a column group.

New in version 0.2.0.

construct()[source]

Returns the constructed colgroup tag <colgroup>.

validate_char_attribute(align, value)[source]

Validates char attribute. The char attribute can only be used if the align attribute is set to “char”.

validate_charoff_attribute(align, char, value)[source]

Validates charoff attribute. The charoff attribute can only be used if the char attribute is specified and the align attribute is set to “char”.

class korona.html.tags.DD(text=None)[source]

Class for constructing dd tag.

Parameters:text (str) – Specifies the dd text. (As in <dd>{text}</dd>)

New in version 0.2.0.

construct()[source]

Returns the constructed dd tag <dd></dd>.

class korona.html.tags.Del(cite=None, datetime=None, text=None)[source]

Class for constructing del tag.

Parameters:
  • cite (str) – Specifies a URL to a document that explains the reason why the text was deleted.
  • datetime (datetime) – Specifies the date and time of when the text was deleted.

New in version 0.2.0.

construct()[source]

Returns the constructed del tag <del>.

class korona.html.tags.Details(open=False, text=None)[source]

Class for constructing details tag.

Parameters:
  • open (bool) – Specifies that the details should be visible (open) to the user.
  • text (str) – Specifies the details text. (As in <details>{text}</details>)

New in version 0.2.0.

construct()[source]

Returns the constructed details tag <details></details>.

class korona.html.tags.Dialog(open=False, text=None)[source]

Class for constructing dialog tag.

Parameters:
  • open (bool) – Specifies that the dialog element is active and that the user can interact with it.
  • text (str) – Specifies the dialog text. (As in <dialog>{text}</dialog>)

New in version 0.2.0.

construct()[source]

Returns the constructed dialog tag <dialog></dialog>.

class korona.html.tags.Div(align=None, text=None)[source]

Class for constructing div tag.

Parameters:
  • align (str) – Specifies the alignment of the content inside a <div> element.
  • text (str) – Specifies the div text. (As in <div>{text}</div>)

New in version 0.2.0.

construct()[source]

Returns the constructed div tag <div></div>.

class korona.html.tags.DL(text=None)[source]

Class for constructing dl tag.

Parameters:text (str) – Specifies the dl text. (As in <dl>{text}</dl>)

New in version 0.2.0.

construct()[source]

Returns the constructed dl tag <dl></dl>.

class korona.html.tags.DT(text=None)[source]

Class for constructing dt tag.

Parameters:text (str) – Specifies the dt text. (As in <dt>{text}</dt>)

New in version 0.2.0.

construct()[source]

Returns the constructed dt tag <dt></dt>.

class korona.html.tags.Embed(height=None, width=None, src=None, type=None)[source]

Class for constructing embed tag.

Parameters:
  • height (str) – Specifies the height of the embedded content (in pixels).
  • width (str) – Specifies the width of the embedded content (in pixels).
  • src (str) – Specifies the address of the external file to embed.
  • type (str) – Specifies the media type of the embedded content.

New in version 0.2.0.

construct()[source]

Returns the constructed embed tag <embed>.

class korona.html.tags.FieldSet(disabled=False, form=None, name=None)[source]

Class for constructing fieldset tag.

Parameters:
  • disabled (bool) – Specifies that a group of related form elements should be disabled.
  • form (str) – Specifies one or more forms the fieldset belongs to.
  • name (str) – Specifies a name for the fieldset.

New in version 0.2.0.

construct()[source]

Returns the constructed fieldset tag <fieldset></fieldset>.

class korona.html.tags.Figure(text=None)[source]

Class for constructing figure tag.

Parameters:text (str) – Specifies the figure text. (As in <figure>{text}</figure>)

New in version 0.2.0.

construct()[source]

Returns the constructed figure tag <figure></figure>.

class korona.html.tags.Footer(text=None)[source]

Class for constructing the footer tag.

Parameters:text (str) – Specifies the footer text. (As in <footer>{text}</footer>)

New in version 0.2.0.

construct()[source]

Returns the constructed footer tag <footer></footer>.

class korona.html.tags.Form(accept=None, action=None, autocomplete=None, enctype=None, method=None, name=None, novalidate=False, target=None, text=None)[source]

Class for constructing <form> tag.

Parameters:
  • accept (str) – Specifies a comma-separated list of file types that the server accepts (that can be submitted through the file upload).
  • action (str) – Specifies where to send the form-data when a form is submitted.
  • autocomplete (str) – Specifies whether a form should have autocomplete on or off.
  • enctype (str) – Specifies how the form-data should be encoded when submitting it to the server (only for method=”post”).
  • method (str) – Specifies the HTTP method to use when sending form-data.
  • name (str) – Specifies the name of a form.
  • novalidate (bool) – Specifies that the form should not be validated when submitted.
  • target (str) – Specifies where to display the response that is received after submitting the form.
  • text (str) – Specifies the form text. (As in <form>{text}</form>)

New in version 0.2.0.

construct()[source]

Returns the constructed form tag <form></form>.

validate_enctype_attribute(method, enctype)[source]

Validates enctype attribute. The enctype attribute can be used only if method is post.

class korona.html.tags.Frame(frameborder=None, longdesc=None, marginheight=None, marginwidth=None, name=None, noresize=None, scrolling=None, src=None)[source]

Class for constructing <frame> tag.

Parameters:
  • frameborder (str) – Specifies whether or not to display a border around a frame.
  • longdesc (str) – Specifies a page that contains a long description of the content of a frame.
  • marginheight (str) – Specifies the top and bottom margins of a frame.
  • marginwidth (str) – Specifies the left and right margins of a frame.
  • name (str) – Specifies the name of a frame.
  • noresize (str) – Specifies that a frame is not resizable.
  • scrolling (str) – Specifies whether or not to display scrollbars in a frame.
  • src (str) – Specifies the URL of the document to show in a frame.

New in version 0.2.0.

Changed in version 0.3.1: Added URL validation for src attribute.

construct()[source]

Returns the constructed tag <frame>.

class korona.html.tags.FrameSet(cols=None, rows=None)[source]

Class for constructing <frameset> tag.

Parameters:
  • cols (str) – Specifies the number and size of columns in a frameset.
  • rows (str) – Specifies the number and size of rows in a frameset.

New in version 0.2.0.

construct()[source]

Returns the constructed tag <frameset>.

class korona.html.tags.H1(align=None, text=None)[source]

Class for constructing <h1> tag.

Parameters:
  • align (str) – Specifies the alignment of a heading.
  • text (str) – Specifies the <h1> text. (As in <h1>{text}</h1>)

New in version 0.3.0.

construct()[source]

Returns the constructed tag <h1>.

class korona.html.tags.H2(align=None, text=None)[source]

Class for constructing <h2> tag.

Parameters:
  • align (str) – Specifies the alignment of a heading.
  • text (str) – Specifies the <h2> text. (As in <h2>{text}</h2>)

New in version 0.3.0.

construct()[source]

Returns the constructed tag <h2>.

class korona.html.tags.H3(align=None, text=None)[source]

Class for constructing <h3> tag.

Parameters:
  • align (str) – Specifies the alignment of a heading.
  • text (str) – Specifies the <h3> text. (As in <h3>{text}</h3>)

New in version 0.3.0.

construct()[source]

Returns the constructed tag <h3>.

class korona.html.tags.H4(align=None, text=None)[source]

Class for constructing <h4> tag.

Parameters:
  • align (str) – Specifies the alignment of a heading.
  • text (str) – Specifies the <h4> text. (As in <h4>{text}</h4>)

New in version 0.3.0.

construct()[source]

Returns the constructed tag <h4>.

class korona.html.tags.H5(align=None, text=None)[source]

Class for constructing <h5> tag.

Parameters:
  • align (str) – Specifies the alignment of a heading.
  • text (str) – Specifies the <h5> text. (As in <h5>{text}</h5>)

New in version 0.3.0.

construct()[source]

Returns the constructed tag <h5>.

class korona.html.tags.H6(align=None, text=None)[source]

Class for constructing <h6> tag.

Parameters:
  • align (str) – Specifies the alignment of a heading.
  • text (str) – Specifies the <h6> text. (As in <h6>{text}</h6>)

New in version 0.3.0.

construct()[source]

Returns the constructed tag <h6>.

class korona.html.tags.Head(text=None)[source]

Class for constructing <head> tag.

Parameters:text (str) – Specifies the head text. (As in <head>{text}</head>)

New in version 0.3.0.

construct()[source]

Returns the constructed tag <head>.

class korona.html.tags.Header(text=None)[source]

Class for constructing the header tag.

Parameters:text (str) – Specifies the header text. (As in <header>{text}</header>)

New in version 0.3.0.

construct()[source]

Returns the constructed header tag <header></header>.

class korona.html.tags.HR(align=None, noshade=False, size=None, width=None)[source]

Class for constructing hr tag.

Parameters:
  • align (str) – Specifies the alignment of a <hr> element.
  • noshade (bool) – Specifies that a <hr> element should render in one solid color (noshaded), instead of a shaded color.
  • size (str) – Specifies the height of a <hr> element.
  • width (str) – Specifies the width of a <hr> element

New in version 0.3.0.

construct()[source]

Returns the constructed hr tag <hr>.

class korona.html.tags.Html(manifest=None, xmlns=None, text=None)[source]

Class for constructing html tag.

Parameters:
  • manifest (str) – Specifies the address of the document’s cache manifest (for offline browsing)
  • xmlns (str) – Specifies the XML namespace attribute (If you need your content to conform to XHTML)
  • text (str) – Specifies the html text. (As in <html>{text}</html>)

New in version 0.4.0.

construct()[source]

Returns the constructed html tag <html>.

class korona.html.tags.I(text=None)[source]

Class for constructing <i> tag.

Parameters:text (str) – Specifies the italics text. (As in <i>{text}</i>)

New in version 0.4.0.

construct()[source]

Returns the constructed italics tag <i>.

class korona.html.tags.IFrame(align=None, frameborder=None, height=None, longdesc=None, marginheight=None, marginwidth=None, name=None, sandbox=None, scrolling=None, src=None, srcdoc=None, width=None)[source]

Class for constructing <iframe> tag.

Parameters:
  • align (str) – Specifies the alignment of an <iframe> according to surrounding elements.
  • frameborder (str) – Specifies whether or not to display a border around an <iframe>.
  • height (str) – Specifies the height of an <iframe>.
  • longdesc (str) – Specifies a page that contains a long description of the content of an <iframe>.
  • marginheight (str) – Specifies the top and bottom margins of the content of an <iframe>.
  • marginwidth (str) – Specifies the left and right margins of the content of an <iframe>.
  • name (str) – Specifies the name of an <iframe>.
  • sandbox (str) – Enables an extra set of restrictions for the content in an <iframe>.
  • scrolling (str) – Specifies whether or not to display scrollbars in an <iframe>.
  • src (str) – Specifies the address of the document to embed in the <iframe>.
  • srcdoc (str) – Specifies the HTML content of the page to show in the <iframe>.
  • width (str) – Specifies the width of an <iframe>.

New in version 0.4.0.

construct()[source]

Returns the constructed iframe tag <iframe>.

validate_sandbox(sandbox)[source]

Validates sandbox attribute. The value of the sandbox attribute can either be just sandbox (then all restrictions are applied), or a space-separated list of pre-defined values that will REMOVE the particular restrictions.

class korona.html.tags.Img(align=None, alt=None, border=None, crossorigin=None, height=None, hspace=None, ismap=False, longdesc=None, src=None, usemap=None, vspace=None, width=None)[source]

Class for constructing <img> tag.

Parameters:
  • align (str) – Specifies the alignment of an image according to surrounding elements.
  • alt (str) – Specifies an alternate text for an image.
  • border (str) – Specifies the width of the border around an image.
  • crossorigin (str) – Allow images from third-party sites that allow cross-origin access to be used with canvas.
  • height (str) – Specifies the height of an image.
  • hspace (str) – Specifies the whitespace on left and right side of an image.
  • ismap (bool) – Specifies an image as a server-side image-map.
  • longdesc (str) – Specifies a URL to a detailed description of an image.
  • src (str) – Specifies the URL of an image.
  • usemap (str) – Specifies an image as a client-side image-map.
  • vspace (str) – Specifies the whitespace on top and bottom of an image.
  • width (str) – Specifies the width of an image.

New in version 0.4.0.

construct()[source]

Returns the constructed image tag <img>.

class korona.html.tags.Input(accept=None, align=None, alt=None, autocomplete=None, autofocus=False, checked=False, name=None, dirname=None, disabled=False, form=None, formaction=None, formenctype=None, formmethod=None, formnovalidate=False, formtarget=None, height=None, list=None, max=None, min=None, maxlength=None, multiple=False, pattern=None, placeholder=None, readonly=False, required=False, size=None, src=None, step=None, type=None, value=None, width=None)[source]

Class for constructing <input> tag.

Parameters:
  • accept (str) – Specifies the types of files that the server accepts (only for type=”file”).
  • align (str) – Specifies the alignment of an image input (only for type=”image”).
  • alt (str) – Specifies an alternate text for images (only for type= “image”).
  • autocomplete (str) – Specifies whether an <input> element should have autocomplete enabled.
  • autofocus (bool) – Specifies that an <input> element should automatically get focus when the page loads.
  • checked (bool) – Specifies that an <input> element should be pre-selected when the page loads (for type=”checkbox” or type=”radio”).
  • dirname (str) – Specifies that the text direction will be submitted.
  • disabled (bool) – Specifies that an <input> element should be disabled.
  • form (str) – Specifies one or more forms the <input> element belongs to.
  • formaction (str) – Specifies the URL of the file that will process the input control when the form is submitted (for type=”submit” and type=”image”).
  • formenctype (str) – Specifies how the form-data should be encoded when submitting it to the server (for type=”submit” and type=”image”).
  • formmethod (str) – Defines the HTTP method for sending data to the action URL (for type=”submit” and type=”image”).
  • formnovalidate (bool) – Defines that form elements should not be validated when submitted.
  • formtarget (str) – Specifies where to display the response that is received after submitting the form (for type=”submit” and type=”image”).
  • height (int/float) – Specifies the height of an <input> element (only for type=”image”).
  • list (str) – Refers to a <datalist> element that contains pre-defined options for an <input> element.
  • max (int/date/time) – Specifies the maximum value for an <input> element.
  • maxlength (int) – Specifies the maximum number of characters allowed in an <input> element.
  • min (int/date/time) – Specifies a minimum value for an <input> element.
  • multiple (bool) – Specifies that a user can enter more than one value in an <input> element.
  • name (str) – Specifies the name of an <input> element.
  • pattern (str) – Specifies a regular expression that an <input> element’s value is checked against.
  • placeholder (str) – Specifies a short hint that describes the expected value of an <input> element.
  • readonly (bool) – Specifies that an input field is read-only.
  • required (bool) – Specifies that an input field must be filled out before submitting the form.
  • size (int) – Specifies the width, in characters, of an <input> element.
  • src (str) – Specifies the URL of the image to use as a submit button (only for type=”image”).
  • step (int) – Specifies the legal number intervals for an input field.
  • type (str) – Specifies the type <input> element to display.
  • value (str) – Specifies the value of an <input> element.
  • width (int/float) – Specifies the width of an <input> element (only for type=”image”).

New in version 0.4.2.

Changed in version 0.4.3-dev: Renamed the method validate_value() to validate_value_attribute().

construct()[source]

Constructs the <input> tag.

validate_dirname(name, dirname)[source]

Validates the dirname attribute for <input> tag. The dirname attribute’s value should always have the name of the input field, followed by ”.dir”.

validate_input_attribute(type, attribute_name, attribute_value)[source]

Validates input tag attribute. Some of the input attributes depend on the input type given by the consumer.

For example, max and min attributes works with the following input types: number, range, date, datetime, datetime-local, month, time and week.

validate_max_min_attributes(type, attribute_name, attribute_value)[source]

Validates the max attribute whether it is an integer/float/datetime value.

validate_value_attribute(type, value)[source]

Validates the value attribute for <input> tag. The value attribute cannot be used with <input type=”file”>.