[Python-modules-commits] [python-uritools] 01/12: import python_uritools_1.0.1.orig.tar.gz
Stein Magnus Jodal
jodal at moszumanska.debian.org
Thu Nov 5 23:15:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
jodal pushed a commit to branch master
in repository python-uritools.
commit 327533f27686d65c3e08742e8f65fca3f9f491d7
Author: Stein Magnus Jodal <jodal at debian.org>
Date: Fri Nov 6 00:02:12 2015 +0100
import python_uritools_1.0.1.orig.tar.gz
---
.gitignore | 7 +
.travis.yml | 12 ++
CHANGES.rst | 174 ++++++++++++++++++++++++
LICENSE | 20 +++
MANIFEST.in | 6 +
README.rst | 100 ++++++++++++++
docs/.gitignore | 1 +
docs/Makefile | 153 +++++++++++++++++++++
docs/conf.py | 245 +++++++++++++++++++++++++++++++++
docs/index.rst | 202 ++++++++++++++++++++++++++++
setup.cfg | 17 +++
setup.py | 50 +++++++
tests/__init__.py | 0
tests/test_compose.py | 217 ++++++++++++++++++++++++++++++
tests/test_defrag.py | 45 +++++++
tests/test_encoding.py | 86 ++++++++++++
tests/test_join.py | 100 ++++++++++++++
tests/test_split.py | 357 +++++++++++++++++++++++++++++++++++++++++++++++++
tests/test_unsplit.py | 29 ++++
uritools/__init__.py | 33 +++++
uritools/chars.py | 23 ++++
uritools/compose.py | 207 ++++++++++++++++++++++++++++
uritools/defrag.py | 41 ++++++
uritools/encoding.py | 66 +++++++++
uritools/join.py | 16 +++
uritools/split.py | 348 +++++++++++++++++++++++++++++++++++++++++++++++
26 files changed, 2555 insertions(+)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..e9c535c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+*.egg-info
+*.pyc
+*.swp
+.coverage
+MANIFEST
+build/
+dist/
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..81a8f8a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,12 @@
+language: python
+python:
+- 2.7
+- 3.2
+- 3.3
+- 3.4
+install:
+- pip install . coverage coveralls
+script:
+- python setup.py nosetests
+after_success:
+- coveralls
diff --git a/CHANGES.rst b/CHANGES.rst
new file mode 100644
index 0000000..fc561b6
--- /dev/null
+++ b/CHANGES.rst
@@ -0,0 +1,174 @@
+1.0.1 2015-07-09
+----------------
+
+- Encode semicolon in query values passed to ``uricompose()``.
+
+
+1.0.0 2015-06-12
+----------------
+
+- Fix use of URI references as base URIs in ``urijoin()`` and
+ ``SplitResult.transform()``.
+
+- Remove ``SplitResult.getaddrinfo()``.
+
+- Remove ``SplitResult.getauthority()``.
+
+- Remove ``SplitResult.gethostip()``; return ``ipaddress`` address
+objects from ``SplitResult.gethost()`` instead.
+
+- Remove ``SplitResult.gethost()`` `encoding` parameter.
+
+- Remove query delimiter parameters.
+
+- Return normalized paths from ``SplitResult.getpath()``.
+
+- Convert character constants to strings.
+
+
+0.12.0 2015-04-03
+-----------------
+
+- Deprecate ``SplitResult.getaddrinfo()``.
+
+- Deprecate ``SplitResult.getauthority()``.
+
+- Deprecate ``SplitResult.gethost()`` and ``SplitResult.gethostip()``
+ `encoding` parameter; always use `utf-8` instead.
+
+- Drop support for "bytes-like objects".
+
+- Remove ``DefragResult.base``.
+
+
+0.11.1 2015-03-25
+-----------------
+
+- Fix ``uricompose()`` for relative-path references with colons in the
+ first path segment.
+
+
+0.11.0 2014-12-16
+-----------------
+
+- Support `encoding=None` for ``uriencode()`` and ``uridecode()``.
+
+- Add optional `errors` parameter to decoding methods.
+
+
+0.10.1 2014-11-30
+-----------------
+
+- Make ``uricompose()`` return ``str`` on all Python versions.
+
+
+0.10.0 2014-11-30
+-----------------
+
+- Use ``ipaddress`` module for handling IPv4/IPv6 host addresses.
+
+- Add `userinfo`, `host` and `port` keyword arguments to
+ ``uricompose()``.
+
+- Deprecate ``DefragResult.base``.
+
+- Feature freeze for `v1.0`.
+
+
+0.9.0 2014-11-21
+----------------
+
+- Improve Python 3 support.
+
+
+0.8.0 2014-11-04
+----------------
+
+- Fix ``uriencode()`` and ``uridecode()``.
+
+- Deprecate ``RE``, ``urinormpath()``, ``DefragResult.getbase()``.
+
+- Support non-string query values in ``uricompose()``.
+
+
+0.7.0 2014-10-12
+----------------
+
+- Add optional port parameter to ``SplitResult.getaddrinfo()``.
+
+- Cache ``SplitResult.authority`` subcomponents.
+
+
+0.6.0 2014-09-17
+----------------
+
+- Add basic IPv6 support.
+
+- Change ``SplitResult.port`` back to string, to distinguish between
+ empty and absent port components.
+
+- Remove ``querysep`` and ``sep`` parameters.
+
+- Do not raise ``ValueError`` if scheme is not well-formed.
+
+- Improve Python 3 support.
+
+
+0.5.2 2014-08-06
+----------------
+
+- Fix empty port handling.
+
+
+0.5.1 2014-06-22
+----------------
+
+- Add basic Python 3 support.
+
+
+0.5.0 2014-06-21
+----------------
+
+- Add ``SplitResult.getaddrinfo()``.
+
+- Support query mappings and sequences in ``uricompose()``.
+
+
+0.4.0 2014-03-20
+----------------
+
+- Fix ``SplitResult.port`` to return int (matching urlparse).
+
+- Add ``SplitResult.getquerylist(), SplitResult.getquerydict()``.
+
+
+0.3.0 2014-03-02
+----------------
+
+- Add result object accessor methods.
+
+- Update documentation.
+
+
+0.2.1 2014-02-24
+----------------
+
+- Fix IndexError in ``urinormpath()``.
+
+- Integrate Python 2.7.6 ``urlparse`` unit tests.
+
+
+0.2.0 2014-02-18
+----------------
+
+- Add authority subcomponent attributes.
+
+- Return ``DefragResult`` from ``uridefrag()``.
+
+- Improve edge case behavior.
+
+
+0.1.0 2014-02-14
+----------------
+
+- Initial beta release.
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..380c344
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Thomas Kemmer
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..8b3684f
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,6 @@
+include CHANGES.rst
+include LICENSE
+include MANIFEST.in
+include README.rst
+
+recursive-include tests *.py
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..725366b
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,100 @@
+uritools
+========================================================================
+
+This module defines RFC 3986 compliant replacements for the most
+commonly used functions of the Python 2.7 Standard Library urlparse_
+and Python 3 `urllib.parse`_ modules.
+
+.. code-block:: pycon
+
+ >>> from uritools import urisplit, uriunsplit, urijoin, uridefrag
+ >>> parts = urisplit('foo://user@example.com:8042/over/there?name=ferret#nose')
+ >>> parts
+ SplitResult(scheme='foo', authority='user at example.com:8042',
+ path='/over/there', query='name=ferret', fragment='nose')
+ >>> parts.scheme
+ 'foo'
+ >>> parts.authority
+ 'user at example.com:8042'
+ >>> parts.userinfo
+ 'user'
+ >>> parts.host
+ 'example.com'
+ >>> parts.port
+ '8042'
+ >>> uriunsplit(parts[:3] + ('name=swallow&type=African', 'beak'))
+ 'foo://user@example.com:8042/over/there?name=swallow&type=African#beak'
+ >>> urijoin('http://www.cwi.nl/~guido/Python.html', 'FAQ.html')
+ 'http://www.cwi.nl/~guido/FAQ.html'
+ >>> uridefrag('http://pythonhosted.org/uritools/index.html#constants')
+ DefragResult(uri='http://pythonhosted.org/uritools/index.html',
+ fragment='constants')
+
+For various reasons, the Python 2 urlparse_ module is not compliant
+with current Internet standards, does not include Unicode support, and
+is generally unusable with proprietary URI schemes. Python 3's
+`urllib.parse`_ improves on Unicode support, but the other issues
+still remain. As stated in `Lib/urllib/parse.py`_::
+
+ RFC 3986 is considered the current standard and any future changes
+ to urlparse module should conform with it. The urlparse module is
+ currently not entirely compliant with this RFC due to defacto
+ scenarios for parsing, and for backward compatibility purposes,
+ some parsing quirks from older RFCs are retained.
+
+This module aims to provide fully RFC 3986 compliant replacements for
+some commonly used functions found in urlparse_ and `urllib.parse`_,
+plus additional functions for conveniently composing URIs from their
+individual components.
+
+
+Installation
+------------------------------------------------------------------------
+
+Install uritools using pip::
+
+ pip install uritools
+
+
+Project Resources
+------------------------------------------------------------------------
+
+.. image:: http://img.shields.io/pypi/v/uritools.svg?style=flat
+ :target: https://pypi.python.org/pypi/uritools/
+ :alt: Latest PyPI version
+
+.. image:: http://img.shields.io/pypi/dm/uritools.svg?style=flat
+ :target: https://pypi.python.org/pypi/uritools/
+ :alt: Number of PyPI downloads
+
+.. image:: http://img.shields.io/travis/tkem/uritools/master.svg?style=flat
+ :target: https://travis-ci.org/tkem/uritools/
+ :alt: Travis CI build status
+
+.. image:: http://img.shields.io/coveralls/tkem/uritools/master.svg?style=flat
+ :target: https://coveralls.io/r/tkem/uritools
+ :alt: Test coverage
+
+- `Documentation`_
+- `Issue Tracker`_
+- `Source Code`_
+- `Change Log`_
+
+
+License
+------------------------------------------------------------------------
+
+Copyright (c) 2014, 2015 Thomas Kemmer.
+
+Licensed under the `MIT License`_.
+
+
+.. _urlparse: http://docs.python.org/2/library/urlparse.html
+.. _urllib.parse: http://docs.python.org/3/library/urllib.parse.html
+.. _Lib/urllib/parse.py: https://hg.python.org/cpython/file/3.4/Lib/urllib/parse.py
+
+.. _Documentation: http://pythonhosted.org/uritools/
+.. _Issue Tracker: https://github.com/tkem/uritools/issues/
+.. _Source Code: https://github.com/tkem/uritools/
+.. _Change Log: https://github.com/tkem/uritools/blob/master/CHANGES.rst
+.. _MIT License: http://raw.github.com/tkem/uritools/master/LICENSE
diff --git a/docs/.gitignore b/docs/.gitignore
new file mode 100644
index 0000000..e35d885
--- /dev/null
+++ b/docs/.gitignore
@@ -0,0 +1 @@
+_build
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..4cb3cbd
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,153 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/uritools.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/uritools.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/uritools"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/uritools"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..8b155b8
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,245 @@
+# -*- coding: utf-8 -*-
+#
+# uritools documentation build configuration file, created by
+# sphinx-quickstart on Mon Feb 10 09:15:34 2014.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('..'))
+from uritools import __version__
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'uritools'
+copyright = u'2014, Thomas Kemmer'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = __version__
+# The full version, including alpha/beta/rc tags.
+release = version
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+#html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'uritoolsdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+ # The paper size ('letterpaper' or 'a4paper').
+ #'papersize': 'letterpaper',
+
+ # The font size ('10pt', '11pt' or '12pt').
+ #'pointsize': '10pt',
+
+ # Additional stuff for the LaTeX preamble.
+ #'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'uritools.tex', u'uritools Documentation',
+ u'Thomas Kemmer', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'uritools', u'uritools Documentation',
+ [u'Thomas Kemmer'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'uritools', u'uritools Documentation',
+ u'Thomas Kemmer', 'uritools', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..53b9bc0
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,202 @@
+:mod:`uritools` --- RFC 3986 compliant replacement for :mod:`urlparse`
+=======================================================================
+
+.. module:: uritools
+
+This module defines RFC 3986 compliant replacements for the most
+commonly used functions of the Python 2.7 Standard Library
+:mod:`urlparse` and Python 3 :mod:`urllib.parse` modules.
+
+.. code-block:: pycon
+
+ >>> from uritools import urisplit, uriunsplit, urijoin, uridefrag
+ >>> parts = urisplit('foo://user@example.com:8042/over/there?name=ferret#nose')
+ >>> parts
+ SplitResult(scheme='foo', authority='user at example.com:8042',
+ path='/over/there', query='name=ferret', fragment='nose')
+ >>> parts.scheme
+ 'foo'
+ >>> parts.authority
+ 'user at example.com:8042'
+ >>> parts.userinfo
+ 'user'
+ >>> parts.host
+ 'example.com'
+ >>> parts.port
+ '8042'
+ >>> uriunsplit(parts[:3] + ('name=swallow&type=African', 'beak'))
+ 'foo://user@example.com:8042/over/there?name=swallow&type=African#beak'
+ >>> urijoin('http://www.cwi.nl/~guido/Python.html', 'FAQ.html')
+ 'http://www.cwi.nl/~guido/FAQ.html'
+ >>> uridefrag('http://pythonhosted.org/uritools/index.html#constants')
+ DefragResult(uri='http://pythonhosted.org/uritools/index.html',
+ fragment='constants')
+
+For various reasons, the Python 2 :mod:`urlparse` module is not
+compliant with current Internet standards, does not include Unicode
+support, and is generally unusable with proprietary URI schemes.
+Python 3's :mod:`urllib.parse` improves on Unicode support, but the
+other issues still remain. As stated in `Lib/urllib/parse.py`_::
+
+ FC 3986 is considered the current standard and any future changes
+ to urlparse module should conform with it. The urlparse module is
+ currently not entirely compliant with this RFC due to defacto
+ scenarios for parsing, and for backward compatibility purposes,
+ some parsing quirks from older RFCs are retained.
+
+This module aims to provide fully RFC 3986 compliant replacements for
+the most commonly used functions found in :mod:`urlparse` and
+:mod:`urllib.parse`, plus additional functions for conveniently
+composing URIs from their individual components.
+
+.. seealso::
+
+ :rfc:`3986` - Uniform Resource Identifier (URI): Generic Syntax
+ The current Internet standard (STD66) defining URI syntax, to
+ which any changes to :mod:`uritools` should conform. If
+ deviations are observed, the module's implementation should be
+ changed, even if this means breaking backward compatiblity.
+
+
+URI Decomposition
+------------------------------------------------------------------------
+
+.. autofunction:: uridefrag
+
+ The return value is an instance of a subclass of
+ :class:`collections.namedtuple` with the following read-only
+ attributes:
+
+ +-------------------+-------+---------------------------------------------+
+ | Attribute | Index | Value |
+ +===================+=======+=============================================+
+ | :attr:`uri` | 0 | Absolute URI or relative URI reference |
+ | | | without the fragment identifier |
+ +-------------------+-------+---------------------------------------------+
+ | :attr:`fragment` | 1 | Fragment identifier, |
+ | | | or :const:`None` if not present |
+ +-------------------+-------+---------------------------------------------+
+
+.. autofunction:: urisplit
+
+ The return value is an instance of a subclass of
+ :class:`collections.namedtuple` with the following read-only
+ attributes:
+
+ +-------------------+-------+---------------------------------------------+
+ | Attribute | Index | Value |
+ +===================+=======+=============================================+
+ | :attr:`scheme` | 0 | URI scheme, or :const:`None` if not present |
+ +-------------------+-------+---------------------------------------------+
+ | :attr:`authority` | 1 | Authority component, |
+ | | | or :const:`None` if not present |
+ +-------------------+-------+---------------------------------------------+
+ | :attr:`path` | 2 | Path component, always present but may be |
+ | | | empty |
+ +-------------------+-------+---------------------------------------------+
+ | :attr:`query` | 3 | Query component, |
+ | | | or :const:`None` if not present |
+ +-------------------+-------+---------------------------------------------+
+ | :attr:`fragment` | 4 | Fragment identifier, |
+ | | | or :const:`None` if not present |
+ +-------------------+-------+---------------------------------------------+
+ | :attr:`userinfo` | | Userinfo subcomponent of authority, |
+ | | | or :const:`None` if not present |
+ +-------------------+-------+---------------------------------------------+
+ | :attr:`host` | | Host subcomponent of authority, |
+ | | | or :const:`None` if not present |
+ +-------------------+-------+---------------------------------------------+
+ | :attr:`port` | | Port subcomponent of authority as a |
+ | | | (possibly empty) string, |
+ | | | or :const:`None` if not present |
+ +-------------------+-------+---------------------------------------------+
+
+
+URI Composition
+------------------------------------------------------------------------
+
+.. autofunction:: uricompose
+
+ `authority` may be a Unicode string, :class:`bytes` object, or a
+ three-item iterable specifying userinfo, host and port
+ subcomponents. If both `authority` and any of the `userinfo`,
+ `host` or `port` keyword arguments are given, the keyword argument
+ will override the corresponding `authority` subcomponent.
+
+ If `query` is a mapping object or a sequence of two-element tuples,
+ it will be converted to a string of `name=value` pairs seperated by
+ `&`.
+
+ The returned value is of type :class:`str`.
+
+.. autofunction:: urijoin
+
+ If `strict` is :const:`False`, a scheme in the reference is
+ ignored if it is identical to the base URI's scheme.
+
+.. autofunction:: uriunsplit
+
+
+URI Encoding
+------------------------------------------------------------------------
+
+.. autofunction:: uridecode
+
+ If `encoding` is set to :const:`None`, return the percent-decoded
+ `uristring` as a :class:`bytes` object. Otherwise, replace any
+ percent-encodings and decode `uristring` using the codec registered
+ for `encoding`, returning a Unicode string.
+
+.. autofunction:: uriencode
+
+ If `uristring` is a :class:`bytes` object, replace any characters
+ not in :const:`UNRESERVED` or `safe` with their corresponding
+ percent-encodings and return the result as a :class:`bytes` object.
+ Otherwise, encode `uristring` using the codec registered for
+ `encoding` before replacing any percent encodings.
+
+ Note that `uristring` may be either a Unicode string or a
+ :class:`bytes` object, while `safe` must be a :class:`bytes` object
+ containg ASCII characters only.
+
+
+Character Constants
+------------------------------------------------------------------------
+
+.. data:: GEN_DELIMS
+
+ A string containing all general delimiting characters specified in
+ RFC 3986.
+
+.. data:: RESERVED
+
+ A string containing all reserved characters specified in RFC 3986.
+
+.. data:: SUB_DELIMS
+
+ A string containing all subcomponent delimiting characters
+ specified in RFC 3986.
+
+.. data:: UNRESERVED
+
+ A string containing all unreserved characters specified in
+ RFC 3986.
+
+
+Structured Parse Results
+------------------------------------------------------------------------
+
... 1742 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-uritools.git
More information about the Python-modules-commits
mailing list