summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDavid Moss <drkjam@gmail.com>2012-05-30 22:42:11 +0100
committerDavid Moss <drkjam@gmail.com>2012-05-30 22:42:11 +0100
commit2ca61b1557aa976c6b99e8f71cb6474866e2073f (patch)
tree0d577df8ffb965801f86f325ad6e0a2b7db1b49c /docs
parentc33be80e7c282061c2579afea5cc624c4619371a (diff)
downloadnetaddr-2ca61b1557aa976c6b99e8f71cb6474866e2073f.tar.gz
- upgraded project documentation to use Sphinx
Diffstat (limited to 'docs')
-rw-r--r--docs/Makefile153
-rw-r--r--docs/make.bat190
-rw-r--r--docs/source/api.rst251
-rw-r--r--docs/source/authors.rst8
-rw-r--r--docs/source/changes.rst5
-rw-r--r--docs/source/conf.py246
-rw-r--r--docs/source/contributors.rst5
-rw-r--r--docs/source/copyright.rst5
-rw-r--r--docs/source/index.rst28
-rw-r--r--docs/source/installation.rst5
-rw-r--r--docs/source/introduction.rst5
-rw-r--r--docs/source/license.rst5
-rw-r--r--docs/source/references.rst5
-rw-r--r--docs/source/tutorial_01.rst6
-rw-r--r--docs/source/tutorial_02.rst5
-rw-r--r--docs/source/tutorial_03.rst5
16 files changed, 927 insertions, 0 deletions
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..6fdae39
--- /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) source
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+.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/netaddr.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/netaddr.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/netaddr"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/netaddr"
+ @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/make.bat b/docs/make.bat
new file mode 100644
index 0000000..8367ba1
--- /dev/null
+++ b/docs/make.bat
@@ -0,0 +1,190 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+ set SPHINXBUILD=sphinx-build
+)
+set BUILDDIR=build
+set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source
+set I18NSPHINXOPTS=%SPHINXOPTS% source
+if NOT "%PAPER%" == "" (
+ set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
+ set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
+)
+
+if "%1" == "" goto help
+
+if "%1" == "help" (
+ :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. text to make text files
+ echo. man to make manual pages
+ echo. texinfo to make Texinfo files
+ echo. gettext to make PO message catalogs
+ echo. changes to make an overview over 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
+ goto end
+)
+
+if "%1" == "clean" (
+ for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
+ del /q /s %BUILDDIR%\*
+ goto end
+)
+
+if "%1" == "html" (
+ %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+ goto end
+)
+
+if "%1" == "dirhtml" (
+ %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+ goto end
+)
+
+if "%1" == "singlehtml" (
+ %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+ goto end
+)
+
+if "%1" == "pickle" (
+ %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can process the pickle files.
+ goto end
+)
+
+if "%1" == "json" (
+ %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can process the JSON files.
+ goto end
+)
+
+if "%1" == "htmlhelp" (
+ %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can run HTML Help Workshop with the ^
+.hhp project file in %BUILDDIR%/htmlhelp.
+ goto end
+)
+
+if "%1" == "qthelp" (
+ %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+ echo.^> qcollectiongenerator %BUILDDIR%\qthelp\netaddr.qhcp
+ echo.To view the help file:
+ echo.^> assistant -collectionFile %BUILDDIR%\qthelp\netaddr.ghc
+ goto end
+)
+
+if "%1" == "devhelp" (
+ %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished.
+ goto end
+)
+
+if "%1" == "epub" (
+ %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The epub file is in %BUILDDIR%/epub.
+ goto end
+)
+
+if "%1" == "latex" (
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+ goto end
+)
+
+if "%1" == "text" (
+ %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The text files are in %BUILDDIR%/text.
+ goto end
+)
+
+if "%1" == "man" (
+ %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The manual pages are in %BUILDDIR%/man.
+ goto end
+)
+
+if "%1" == "texinfo" (
+ %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
+ goto end
+)
+
+if "%1" == "gettext" (
+ %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
+ goto end
+)
+
+if "%1" == "changes" (
+ %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.The overview file is in %BUILDDIR%/changes.
+ goto end
+)
+
+if "%1" == "linkcheck" (
+ %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Link check complete; look for any errors in the above output ^
+or in %BUILDDIR%/linkcheck/output.txt.
+ goto end
+)
+
+if "%1" == "doctest" (
+ %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+ goto end
+)
+
+:end
diff --git a/docs/source/api.rst b/docs/source/api.rst
new file mode 100644
index 0000000..53e0f63
--- /dev/null
+++ b/docs/source/api.rst
@@ -0,0 +1,251 @@
+=================
+API Documentation
+=================
+
+.. toctree::
+ :maxdepth: 2
+
+------------------
+IP Class Hierarchy
+------------------
+
+Here the class hierarchy for IP related classes ::
+
+ +--------+ +-------------+
+ | BaseIP | | IPListMixin |
+ +---------+ +--------+ +-------------+ +---------+
+ | ipv4(M) | | | | | ipv6(M) |
+ +---------+ | | | +---------+
+ | +----------------+----------------+ | |
+ (HAS A) | | | | | (HAS A)
+ | | | | | | |
+ +-----+----------------+-----------------+ | | |
+ | | +--------|-------+---------|--------+--------+
+ | | | | | | | | | | |
+ | | | | | | | | | | |
+ v v v v v v | | | | |
+ +-----------+ +-----------+ | | | | |
+ | IPAddress | | IPNetwork |<---+ | | | |
+ +-----------+ +-----------+ | | | |
+ | | | | | |
+ (HAS A) (HAS A) | | | |
+ | | v v v v
+ +-------+--------+ +------------+
+ | | IPRange |
+ | +------------+
+ v |
+ +-------+ |
+ | IPSet | v
+ +-------+ +--------+
+ | IPGlob |
+ +--------+
+
+
+---------
+Constants
+---------
+
+The following constants are used by the various *flags* arguments on netaddr class constructors.
+
+.. data:: P
+ INET_PTON
+
+ Use inet_pton() semantics instead of inet_aton() when parsing IPv4.
+
+.. data:: Z
+ ZEROFILL
+
+ Remove any preceding zeros from IPv4 address octets before parsing.
+
+.. data:: N
+ NOHOST
+
+ Remove any host bits found to the right of an applied CIDR prefix
+
+-----------------
+Custom Exceptions
+-----------------
+.. autoexception:: netaddr.AddrConversionError
+.. autoexception:: netaddr.AddrFormatError
+.. autoexception:: netaddr.NotRegisteredError
+
+------------
+IP addresses
+------------
+
+An IP address is a virtual address used to identify the source and destination of (layer 3) packets being transferred between hosts in a switched network. This library fully supports both IPv4 and the new IPv6 standards.
+
+The `IPAddress` class is used to identify individual IP addresses.
+
+.. autoclass:: netaddr.IPAddress
+ :members:
+ :special-members:
+
+^^^^^^^^^^^^^^^^^^^^^^^^
+IPv6 formatting dialects
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+The following dialect classes can be used with the IPAddress.format method.
+
+.. autoclass:: netaddr.ipv6_compact
+ :members:
+
+.. autoclass:: netaddr.ipv6_full
+ :members:
+
+.. autoclass:: netaddr.ipv6_verbose
+ :members:
+
+-----------------------
+IP networks and subnets
+-----------------------
+
+The `IPNetwork` class is used to represent a group of IP addresses that comprise a network/subnet/VLAN containing hosts.
+
+Nowadays, IP networks are usually specified using the CIDR format with a prefix indicating the size of the netmask. In the real world, there are a number of ways to express a "network"" and so the flexibility of the `IPNetwork` class constructor reflects this.
+
+.. autoclass:: netaddr.IPNetwork
+ :members:
+ :special-members:
+
+---------------------------
+Arbitrary IP address ranges
+---------------------------
+
+netaddr was designed to accomodate the many different ways in which groups of IP addresses and IP networks are specified, not only in router configurations but also less standard but more human-readable forms found in, for instance, configuration files.
+
+Here are the options currently available.
+
+^^^^^^^^^^^^^^
+bounded ranges
+^^^^^^^^^^^^^^
+
+A bounded range is a group of IP addresses specified using a start and end address forming a contiguous block. No bit boundaries are assumed but the end address must be numerically greater than or equal to the start address.
+
+.. autoclass:: netaddr.IPRange
+ :members:
+ :special-members:
+
+^^^^^^^^^^^^^^
+IP glob ranges
+^^^^^^^^^^^^^^
+
+A very useful way to represent IP network in configuration files and on the command line for those who do not speak CIDR.
+
+The `IPGlob` class is used to represent individual glob ranges.
+
+.. autoclass:: netaddr.IPGlob
+ :members:
+ :special-members:
+
+^^^^^^^^^^^^^^^^^^
+globbing functions
+^^^^^^^^^^^^^^^^^^
+
+It is also very useful to be able to convert between glob ranges and CIDR and IP ranges. The following function enable these various conversions.
+
+.. autofunction:: netaddr.cidr_to_glob
+.. autofunction:: netaddr.glob_to_cidrs
+.. autofunction:: netaddr.glob_to_iprange
+.. autofunction:: netaddr.glob_to_iptuple
+.. autofunction:: netaddr.iprange_to_globs
+
+^^^^^^^^^^^^^^^
+``nmap`` ranges
+^^^^^^^^^^^^^^^
+
+``nmap`` is a well known network security tool. It has a particularly flexible way of specifying IP address groupings.
+
+Functions are provided that allow the verification and enumeration of IP address specified in this format.
+
+.. autofunction:: netaddr.valid_nmap_range
+.. autofunction:: netaddr.iter_nmap_range
+
+-------
+IP sets
+-------
+
+When dealing with large numbers of IP addresses and ranges it is often useful to manipulate them as sets so you can calculate intersections, unions and differences between various groups of them.
+
+The `IPSet` class was built specifically for this purpose.
+
+.. autoclass:: netaddr.IPSet
+ :members:
+ :special-members:
+
+---------------------------
+IP functions and generators
+---------------------------
+
+The following are a set of useful helper functions related to the various format supported in this library.
+
+.. autofunction:: netaddr.all_matching_cidrs
+.. autofunction:: netaddr.cidr_abbrev_to_verbose
+.. autofunction:: netaddr.cidr_exclude
+.. autofunction:: netaddr.cidr_merge
+.. autofunction:: netaddr.iprange_to_cidrs
+.. autofunction:: netaddr.iter_iprange
+.. autofunction:: netaddr.iter_unique_ips
+.. autofunction:: netaddr.largest_matching_cidr
+.. autofunction:: netaddr.smallest_matching_cidr
+.. autofunction:: netaddr.spanning_cidr
+
+---------------------------------------
+MAC addresses and the IEEE EUI standard
+---------------------------------------
+
+A MAC address is the 48-bit hardware address associated with a particular physical interface on a networked host. They are found in all networked devices and serve to identify (layer 2) frames in the networking stack.
+
+The `EUI` class is used to represents MACs (as well as their larger and less common 64-bit cousins).
+
+.. autoclass:: netaddr.EUI
+ :members:
+ :special-members:
+
+.. autoclass:: netaddr.OUI
+ :members:
+ :special-members:
+
+.. autoclass:: netaddr.IAB
+ :members:
+ :special-members:
+
+^^^^^^^^^^^^^^^^^^^^^^^
+MAC formatting dialects
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The following dialects are used to specify the formatting of MAC addresses.
+
+.. autoclass:: netaddr.mac_bare
+ :members:
+
+.. autoclass:: netaddr.mac_cisco
+ :members:
+
+.. autoclass:: netaddr.mac_eui48
+ :members:
+
+.. autoclass:: netaddr.mac_pgsql
+ :members:
+
+.. autoclass:: netaddr.mac_unix
+ :members:
+
+--------------------
+Validation functions
+--------------------
+.. autofunction:: netaddr.valid_ipv4
+.. autofunction:: netaddr.valid_ipv6
+.. autofunction:: netaddr.valid_glob
+.. autofunction:: netaddr.valid_mac
+
+------------
+A bit of fun
+------------
+
+Who said networking was all about being serious? It's always good to lighten up and have a bit of fun.
+
+Let's face it, no networking library worth its salt would be complete without support for RFC 1924 - http://www.ietf.org/rfc/rfc1924 ``:-)``
+
+.. autofunction:: netaddr.base85_to_ipv6
+.. autofunction:: netaddr.ipv6_to_base85
diff --git a/docs/source/authors.rst b/docs/source/authors.rst
new file mode 100644
index 0000000..617334d
--- /dev/null
+++ b/docs/source/authors.rst
@@ -0,0 +1,8 @@
+=========
+Author(s)
+=========
+
+David P. D. Moss (owner and maintainer)
+
+Released under the BSD License (see :doc:`license` for details).
+
diff --git a/docs/source/changes.rst b/docs/source/changes.rst
new file mode 100644
index 0000000..f18ee67
--- /dev/null
+++ b/docs/source/changes.rst
@@ -0,0 +1,5 @@
+=======
+Changes
+=======
+
+.. include:: ../../CHANGELOG
diff --git a/docs/source/conf.py b/docs/source/conf.py
new file mode 100644
index 0000000..75fe1b6
--- /dev/null
+++ b/docs/source/conf.py
@@ -0,0 +1,246 @@
+# -*- coding: utf-8 -*-
+#
+# netaddr documentation build configuration file, created by
+# sphinx-quickstart on Sun May 27 22:23:51 2012.
+#
+# 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, 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('.'))
+
+# -- 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', 'sphinx.ext.viewcode']
+
+# 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'netaddr'
+copyright = u'2008-2012, David P. D. Moss. All rights reserved'
+
+# 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 = '0.7.7'
+# The full version, including alpha/beta/rc tags.
+release = '0.7.7'
+
+# 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 = []
+
+# 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 = 'netaddrdoc'
+
+
+# -- 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', 'netaddr.tex', u'netaddr Documentation',
+ u'David P. D. Moss', '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', 'netaddr', u'netaddr Documentation',
+ [u'David P. D. Moss'], 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',
+ 'netaddr',
+ u'netaddr Documentation',
+ u'David P. D. Moss',
+ 'netaddr',
+ 'a comprehensive network address library for Python',
+ '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/source/contributors.rst b/docs/source/contributors.rst
new file mode 100644
index 0000000..7d3758e
--- /dev/null
+++ b/docs/source/contributors.rst
@@ -0,0 +1,5 @@
+============
+Contributors
+============
+
+.. include:: ../../THANKS
diff --git a/docs/source/copyright.rst b/docs/source/copyright.rst
new file mode 100644
index 0000000..5ed6b2c
--- /dev/null
+++ b/docs/source/copyright.rst
@@ -0,0 +1,5 @@
+=========
+Copyright
+=========
+
+.. include:: ../../COPYRIGHT
diff --git a/docs/source/index.rst b/docs/source/index.rst
new file mode 100644
index 0000000..da612bc
--- /dev/null
+++ b/docs/source/index.rst
@@ -0,0 +1,28 @@
+=============================
+netaddr library documentation
+=============================
+
+.. toctree::
+ :maxdepth: 2
+
+ introduction
+ authors
+ contributors
+ license
+ copyright
+ installation
+ tutorial_01
+ tutorial_02
+ tutorial_03
+ api
+ changes
+ references
+
+==================
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/docs/source/installation.rst b/docs/source/installation.rst
new file mode 100644
index 0000000..5a2be7c
--- /dev/null
+++ b/docs/source/installation.rst
@@ -0,0 +1,5 @@
+============
+Installation
+============
+
+.. include:: ../../INSTALL
diff --git a/docs/source/introduction.rst b/docs/source/introduction.rst
new file mode 100644
index 0000000..178c32a
--- /dev/null
+++ b/docs/source/introduction.rst
@@ -0,0 +1,5 @@
+============
+Introduction
+============
+
+.. include:: ../../README
diff --git a/docs/source/license.rst b/docs/source/license.rst
new file mode 100644
index 0000000..98f7849
--- /dev/null
+++ b/docs/source/license.rst
@@ -0,0 +1,5 @@
+=======
+License
+=======
+
+.. include:: ../../LICENSE
diff --git a/docs/source/references.rst b/docs/source/references.rst
new file mode 100644
index 0000000..0eac667
--- /dev/null
+++ b/docs/source/references.rst
@@ -0,0 +1,5 @@
+========================
+Standards and References
+========================
+
+.. include:: ../../REFERENCES
diff --git a/docs/source/tutorial_01.rst b/docs/source/tutorial_01.rst
new file mode 100644
index 0000000..8d87db8
--- /dev/null
+++ b/docs/source/tutorial_01.rst
@@ -0,0 +1,6 @@
+===================
+IP Address Tutorial
+===================
+
+.. include:: ../../netaddr/tests/2.x/ip/tutorial.txt
+
diff --git a/docs/source/tutorial_02.rst b/docs/source/tutorial_02.rst
new file mode 100644
index 0000000..5d742e5
--- /dev/null
+++ b/docs/source/tutorial_02.rst
@@ -0,0 +1,5 @@
+====================
+MAC Address Tutorial
+====================
+
+.. include:: ../../netaddr/tests/2.x/eui/tutorial.txt
diff --git a/docs/source/tutorial_03.rst b/docs/source/tutorial_03.rst
new file mode 100644
index 0000000..9e45be3
--- /dev/null
+++ b/docs/source/tutorial_03.rst
@@ -0,0 +1,5 @@
+====================
+Working with IP sets
+====================
+
+.. include:: ../../netaddr/tests/2.x/IP/sets.txt