Skip to content

Commit dc9a41e

Browse files
committed
Documentation updates.
1 parent dfada03 commit dc9a41e

3 files changed

Lines changed: 72 additions & 66 deletions

File tree

README.md

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,14 @@
11
python-iptools
22
==============
33

4-
The [iptools][] package is a collection of utilities for dealing with IPv4
4+
The [iptools][] package is a collection of utilities for dealing with IP
55
addresses.
66

77
[![Build Status][ci-status]][ci-home]
88

9-
A few useful functions and objects for manipulating IPv4 addresses in python.
10-
This was all inspired by a desire to be able to use CIDR address notation to
11-
designate `INTERNAL_IPS` in a [Django][] project's settings file.
12-
13-
Functions
14-
---------
15-
16-
* `validate_ip`: Validate a dotted quad IPv4 address.
17-
* `ip2long`: Convert a dotted quad IPv4 address to a network byte order 32-bit
18-
integer.
19-
* `long2ip`: Convert a network byte order 32-bit integer to a dotted quad IPv4
20-
address.
21-
* `validate_cidr`: Validate a CIDR notation IPv4 address.
22-
* `cidr2block`: Convert a CIDR notation IPv4 address into a tuple containing
23-
network block start and end addresses.
24-
25-
Objects
26-
-------
27-
28-
* `IpRange`: Range of IPv4 addresses providing `in` and iteration.
29-
* `IpRangeList`: List of IpRange objects providing `in` and iteration.
9+
A few useful functions and objects for manipulating IPv4 and IPv6 addresses in
10+
python. The project was inspired by a desire to be able to use CIDR address
11+
notation to designate `INTERNAL_IPS` in a [Django][] project's settings file.
3012

3113
Using with Django
3214
-----------------
@@ -64,12 +46,15 @@ which python calls when the `in` or `not in` operators are used.
6446
'127.0.0.1', # single ip
6547
'192.168/16', # CIDR network block
6648
('10.0.0.1', '10.0.0.19'), # arbitrary inclusive range
49+
'::1', # single IPv6 address
50+
'fe80::/10', # IPv6 CIDR block
51+
'::ffff:172.16.0.2' # IPv4-mapped IPv6 address
6752
)
6853

69-
Additional Documentations
70-
-------------------------
54+
Documentation
55+
-------------
7156

72-
Pydoc documantation available at [Read the Docs][].
57+
Full pydoc documentation is available at [Read the Docs][].
7358

7459
Local documentation can be built using [Sphinx][]:
7560

@@ -79,10 +64,10 @@ Local documentation can be built using [Sphinx][]:
7964
Python Version Compatibility
8065
----------------------------
8166

82-
[Travis CI][ci-home] automatically runs tests against python 2.5, 2.6, 2.7, 3.2, 3.3 and pypy on 32-bit Ubuntu Linux 11.10.
67+
[Travis CI][ci-home] automatically runs tests against python 2.5, 2.6, 2.7, 3.2, 3.3 and pypy.
8368

84-
Installing
85-
----------
69+
Installation
70+
------------
8671

8772
Install the latest stable version using pip:
8873

@@ -98,6 +83,13 @@ Install the latest development version:
9883
cd python-iptools
9984
python setup.py install
10085

86+
Contributions
87+
-------------
88+
Bug reports, feature requests and pull requests are accepted. Preference is
89+
given to issues with well-defined acceptance criteria and/or unit tests.
90+
91+
This project was originally hosted on [Google Code][].
92+
10193
---
10294
[iptools]: http://pypi.python.org/pypi/iptools
10395
[ci-status]: https://secure.travis-ci.org/bd808/python-iptools.png
@@ -107,3 +99,4 @@ Install the latest development version:
10799
[INTERNAL_IPS]: http://docs.djangoproject.com/en/dev/ref/settings/#internal-ips
108100
[Read the Docs]: http://python-iptools.readthedocs.org/
109101
[Sphinx]: http://sphinx.pocoo.org/
102+
[Google Code]: https://code.google.com/p/python-iptools/

docs/index.rst

Lines changed: 49 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,6 @@ The project was inspired by a desire to be able to use CIDR_ address notation
88
to designate ``INTERNAL_IPS`` in a Django_ project's settings file.
99

1010

11-
************
12-
Installation
13-
************
14-
Install the latest stable version from PyPi using pip_:
15-
16-
.. code-block:: bash
17-
18-
pip install iptools
19-
20-
or setuptools_:
21-
22-
.. code-block:: bash
23-
24-
easy_install iptools
25-
26-
Install the latest development version:
27-
28-
.. code-block:: bash
29-
30-
git clone https://github.com/bd808/python-iptools.git
31-
cd python-iptools
32-
python setup.py install
33-
34-
3511
******************************
3612
Using with Django INTERNAL_IPS
3713
******************************
@@ -71,9 +47,42 @@ implements the magic method ``__contains__`` which python calls when the
7147
('10.0.0.1', '10.0.0.19'), # arbitrary inclusive range
7248
'::1', # single IPv6 address
7349
'fe80::/10', # IPv6 CIDR block
50+
'::ffff:172.16.0.2' # IPv4-mapped IPv6 address
7451
)
7552
7653
54+
****************************
55+
Python Version Compatibility
56+
****************************
57+
58+
`Travis CI`_ automatically runs tests against python 2.5, 2.6, 2.7, 3.2, 3.3 and pypy.
59+
60+
Current test status: |build status|
61+
62+
************
63+
Installation
64+
************
65+
Install the latest stable version from PyPi using pip_:
66+
67+
.. code-block:: bash
68+
69+
pip install iptools
70+
71+
or setuptools_:
72+
73+
.. code-block:: bash
74+
75+
easy_install iptools
76+
77+
Install the latest development version:
78+
79+
.. code-block:: bash
80+
81+
git clone https://github.com/bd808/python-iptools.git
82+
cd python-iptools
83+
python setup.py install
84+
85+
7786
***
7887
API
7988
***
@@ -82,34 +91,30 @@ iptools
8291
=======
8392
.. automodule:: iptools
8493

85-
IpRangeList
86-
-----------
94+
iptools.IpRangeList
95+
-------------------
8796
.. autoclass:: iptools.IpRangeList
8897
:members:
8998
:special-members:
90-
:show-inheritance:
9199

92100

93-
IpRange
94-
-------
101+
iptools.IpRange
102+
---------------
95103
.. autoclass:: iptools.IpRange
96104
:members:
97105
:special-members:
98-
:show-inheritance:
99106

100107

101-
IPv4
102-
====
108+
iptools.ipv4
109+
============
103110
.. automodule:: iptools.ipv4
104111
:members:
105-
:show-inheritance:
106112

107113

108-
IPv6
109-
====
114+
iptools.ipv6
115+
============
110116
.. automodule:: iptools.ipv6
111117
:members:
112-
:show-inheritance:
113118

114119

115120
******************
@@ -120,7 +125,15 @@ Indices and tables
120125

121126
.. _iptools: http://pypi.python.org/pypi/iptools
122127
.. _Django: http://www.djangoproject.com/
128+
.. _`Travis CI`: http://travis-ci.org/bd808/python-iptools
123129
.. _pip: http://www.pip-installer.org/en/latest/
124130
.. _setuptools: https://pypi.python.org/pypi/setuptools
125131
.. _CIDR: http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
126132
.. _INTERNAL_IPS: http://docs.djangoproject.com/en/dev/ref/settings/#internal-ips
133+
.. |build status| image:: https://secure.travis-ci.org/bd808/python-iptools.png
134+
:width: 77
135+
:height: 19
136+
:alt: Build Status
137+
:align: middle
138+
:target: http://travis-ci.org/bd808/python-iptools
139+

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
setup(
1212
name='iptools',
1313
version=__version__,
14-
description='Python utilites for manipulating IPv4 addresses',
14+
description='Python utilites for manipulating IPv4 and IPv6 addresses',
1515
author='Bryan Davis',
1616
author_email='bd808@bd808.com',
1717
url='https://github.com/bd808/python-iptools',
@@ -37,7 +37,7 @@
3737
'Topic :: Utilities',
3838
'Topic :: Internet',
3939
],
40-
long_description="""Utilities for manipulating IPv4 addresses
40+
long_description="""Utilities for manipulating IPv4 and IPv6 addresses
4141
including a class that can be used to include CIDR network blocks
4242
in Django's INTERNAL_IPS setting.""",
4343
zip_safe=False,

0 commit comments

Comments
 (0)