<!DOCTYPE html> <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>API Submodule — rfc3986 1.0.0 documentation</title> <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="../_static/language_data.js"></script> <script type="text/javascript" src="../_static/js/theme.js"></script> <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="URI Builder Module" href="builder.html" /> <link rel="prev" title="API Reference" href="index.html" /> </head> <body class="wy-body-for-nav"> <div class="wy-grid-for-nav"> <nav data-toggle="wy-nav-shift" class="wy-nav-side"> <div class="wy-side-scroll"> <div class="wy-side-nav-search" > <a href="../index.html" class="icon icon-home"> rfc3986 </a> <div class="version"> 1.0.0 </div> <div role="search"> <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> <input type="text" name="q" placeholder="Search docs" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> <p class="caption"><span class="caption-text">Contents:</span></p> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../narrative.html">User Documentation</a></li> <li class="toctree-l1 current"><a class="reference internal" href="index.html">API Reference</a><ul class="current"> <li class="toctree-l2 current"><a class="current reference internal" href="#">API Submodule</a></li> <li class="toctree-l2"><a class="reference internal" href="builder.html">URI Builder Module</a></li> <li class="toctree-l2"><a class="reference internal" href="uri.html">URI Submodule</a></li> <li class="toctree-l2"><a class="reference internal" href="validators.html">Validators Submodule</a></li> <li class="toctree-l2"><a class="reference internal" href="iri.html">IRI Submodule</a></li> <li class="toctree-l2"><a class="reference internal" href="miscellaneous.html">Miscellaneous Submodules</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../release-notes/index.html">Release Notes and History</a></li> </ul> </div> </div> </nav> <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> <nav class="wy-nav-top" aria-label="top navigation"> <i data-toggle="wy-nav-top" class="fa fa-bars"></i> <a href="../index.html">rfc3986</a> </nav> <div class="wy-nav-content"> <div class="rst-content"> <div role="navigation" aria-label="breadcrumbs navigation"> <ul class="wy-breadcrumbs"> <li><a href="../index.html">Docs</a> »</li> <li><a href="index.html">API Reference</a> »</li> <li>API Submodule</li> <li class="wy-breadcrumbs-aside"> <a href="../_sources/api-ref/api.rst.txt" rel="nofollow"> View page source</a> </li> </ul> <hr/> </div> <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> <div itemprop="articleBody"> <div class="section" id="api-submodule"> <h1>API Submodule<a class="headerlink" href="#api-submodule" title="Permalink to this headline">¶</a></h1> <dl class="function"> <dt id="rfc3986.api.urlparse"> <code class="descclassname">rfc3986.api.</code><code class="descname">urlparse</code><span class="sig-paren">(</span><em>uri</em>, <em>encoding='utf-8'</em><span class="sig-paren">)</span><a class="headerlink" href="#rfc3986.api.urlparse" title="Permalink to this definition">¶</a></dt> <dd><p>Parse a given URI and return a ParseResult.</p> <p>This is a partial replacement of the standard library’s urlparse function.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>uri</strong> (<em>str</em>) – The URI to be parsed.</li> <li><strong>encoding</strong> (<em>str</em>) – The encoding of the string provided.</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A parsed URI</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal notranslate"><span class="pre">ParseResult</span></code></p> </td> </tr> </tbody> </table> </dd></dl> <dl class="function"> <dt id="rfc3986.api.uri_reference"> <code class="descclassname">rfc3986.api.</code><code class="descname">uri_reference</code><span class="sig-paren">(</span><em>uri</em>, <em>encoding='utf-8'</em><span class="sig-paren">)</span><a class="headerlink" href="#rfc3986.api.uri_reference" title="Permalink to this definition">¶</a></dt> <dd><p>Parse a URI string into a URIReference.</p> <p>This is a convenience function. You could achieve the same end by using <code class="docutils literal notranslate"><span class="pre">URIReference.from_string(uri)</span></code>.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>uri</strong> (<em>str</em>) – The URI which needs to be parsed into a reference.</li> <li><strong>encoding</strong> (<em>str</em>) – The encoding of the string provided</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A parsed URI</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last"><code class="xref py py-class docutils literal notranslate"><span class="pre">URIReference</span></code></p> </td> </tr> </tbody> </table> </dd></dl> <dl class="function"> <dt id="rfc3986.api.normalize_uri"> <code class="descclassname">rfc3986.api.</code><code class="descname">normalize_uri</code><span class="sig-paren">(</span><em>uri</em>, <em>encoding='utf-8'</em><span class="sig-paren">)</span><a class="headerlink" href="#rfc3986.api.normalize_uri" title="Permalink to this definition">¶</a></dt> <dd><p>Normalize the given URI.</p> <p>This is a convenience function. You could use either <code class="docutils literal notranslate"><span class="pre">uri_reference(uri).normalize().unsplit()</span></code> or <code class="docutils literal notranslate"><span class="pre">URIReference.from_string(uri).normalize().unsplit()</span></code> instead.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> <li><strong>uri</strong> (<em>str</em>) – The URI to be normalized.</li> <li><strong>encoding</strong> (<em>str</em>) – The encoding of the string provided</li> </ul> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The normalized URI.</p> </td> </tr> <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">str</p> </td> </tr> </tbody> </table> </dd></dl> </div> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <a href="builder.html" class="btn btn-neutral float-right" title="URI Builder Module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> <a href="index.html" class="btn btn-neutral float-left" title="API Reference" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> </div> <hr/> <div role="contentinfo"> <p> © Copyright 2017, Ian Stapleton Cordasco </p> </div> Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. </footer> </div> </div> </section> </div> <script type="text/javascript"> jQuery(function () { SphinxRtdTheme.Navigation.enable(true); }); </script> </body> </html>