Skip to content
This repository was archived by the owner on Feb 24, 2023. It is now read-only.

Commit 9bfdfeb

Browse files
author
Leonidas Poulopoulos
committed
Add PyPI friendly doc. Update setup.
1 parent c129067 commit 9bfdfeb

File tree

3 files changed

+119
-8
lines changed

3 files changed

+119
-8
lines changed

README

+15-8
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,26 @@ ncclient: Python library for NETCONF clients
44
ncclient is a Python library that facilitates client-side scripting
55
and application development around the NETCONF protocol. `ncclient` was
66
developed by [Shikar Bhushan](http://schmizz.net). It is now maintained
7-
by [Leonidas Poulopoulos](http://ncclient.grnet.gr)
7+
by [Leonidas Poulopoulos (@leopoul)](http://ncclient.grnet.gr)
88

99
This version includes a merge of [Juniper Networks](http://www.juniper.net)
1010
and [Cisco Systems](http://www.cisco.com) respective ncclient forks based
1111
on [leopoul/ncclient v0.3.2](https://github.com/leopoul/ncclient)
1212

13+
Docs: [http://ncclient.readthedocs.org](http://ncclient.readthedocs.org)
14+
1315
#### Requirements:
1416
* Python 2.6 <= version < 3.0
1517
* setuptools 0.6+
1618
* Paramiko 1.7+
1719
* lxml 3.0+
18-
* libxml2 (libxml2-dev on Ubuntu/Debian)
19-
* libxslt (libxslt1-dev on Ubuntu/Debian)
20+
* libxml2
21+
* libxslt
22+
23+
If you are on Debian/Ubuntu install the following libs (via aptitude or apt-get):
24+
25+
* libxml2-dev
26+
* libxslt1-dev
2027

2128
#### Installation:
2229

@@ -40,17 +47,17 @@ or integrate the following in your code:
4047

4148
As this version integrates Juniper's and Cisco's forks, lots of new concepts
4249
have been introduced that ease management of Juniper and Cisco devices respectively.
43-
The biggest change is the introduction of device handlers via the param ***name*** in connection.
44-
For example to invoke Juniper's functions annd params one has to re-write the above with name = ***junos***:
50+
The biggest change is the introduction of device handlers in connection paramms.
51+
For example to invoke Juniper's functions annd params one has to re-write the above with **device_params={'name':'junos'}**:
4552

4653
from ncclient import manager
4754

48-
with manager.connect(host=host, port=830, username=user, hostkey_verify=False, name='junos') as m:
55+
with manager.connect(host=host, port=830, username=user, hostkey_verify=False, device_params={'name':'junos'}) as m:
4956
c = m.get_config(source='running').data_xml
5057
with open("%s.xml" % host, 'w') as f:
5158
f.write(c)
5259

53-
Respectively, for Cisco nxos, the name is ***nxos***.
60+
Respectively, for Cisco nxos, the name is **nxos**.
5461
Device handlers are easy to implement and prove to be futureproof.
5562

5663
### Changes | brief
@@ -59,7 +66,7 @@ Device handlers are easy to implement and prove to be futureproof.
5966
* Allow preferred SSH subsystem name in device params
6067
* Allow iteration over multiple SSH subsystem names.
6168

69+
### Acknowledgements
6270
Many thanks, primarily to [Jeremy Schulman](https://github.com/jeremyschulman) (Juniper) for providing his precious feedback,
6371
to [Eben Aries](https://github.com/earies) (Juniper) for his contribution, to Juergen Brendel (Cisco) for the Cisco fork and
6472
to all contributors from Cisco and Juniper.
65-

README.rst

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
ncclient: Python library for NETCONF clients
2+
--------------------------------------------
3+
4+
ncclient is a Python library that facilitates client-side scripting and
5+
application development around the NETCONF protocol. ``ncclient`` was
6+
developed by `Shikar Bhushan <http://schmizz.net>`_. It is now
7+
maintained by `Leonidas Poulopoulos
8+
(@leopoul) <http://ncclient.grnet.gr>`_
9+
10+
This version includes a merge of `Juniper
11+
Networks <http://www.juniper.net>`_ and `Cisco
12+
Systems <http://www.cisco.com>`_ respective ncclient forks based on
13+
`leopoul/ncclient v0.3.2 <https://github.com/leopoul/ncclient>`_
14+
15+
Docs:
16+
`http://ncclient.readthedocs.org <http://ncclient.readthedocs.org>`_
17+
18+
Requirements:
19+
^^^^^^^^^^^^^
20+
21+
- Python 2.6 <= version < 3.0
22+
- setuptools 0.6+
23+
- Paramiko 1.7+
24+
- lxml 3.0+
25+
- libxml2
26+
- libxslt
27+
28+
If you are on Debian/Ubuntu install the following libs (via aptitude or
29+
apt-get):
30+
31+
- libxml2-dev
32+
- libxslt1-dev
33+
34+
Installation:
35+
^^^^^^^^^^^^^
36+
37+
::
38+
39+
[ncclient] $ sudo python setup.py install
40+
41+
Examples:
42+
^^^^^^^^^
43+
44+
::
45+
46+
[ncclient] $ python examples/juniper/*.py
47+
48+
Usage
49+
~~~~~
50+
51+
Get device running config
52+
'''''''''''''''''''''''''
53+
54+
Use either an interactive Python console (ipython) or integrate the
55+
following in your code:
56+
57+
::
58+
59+
from ncclient import manager
60+
61+
with manager.connect(host=host, port=830, username=user, hostkey_verify=False) as m:
62+
c = m.get_config(source='running').data_xml
63+
with open("%s.xml" % host, 'w') as f:
64+
f.write(c)
65+
66+
As this version integrates Juniper's and Cisco's forks, lots of new
67+
concepts have been introduced that ease management of Juniper and Cisco
68+
devices respectively. The biggest change is the introduction of device
69+
handlers in connection paramms. For example to invoke Juniper's
70+
functions annd params one has to re-write the above with
71+
**device\_params={'name':'junos'}**:
72+
73+
::
74+
75+
from ncclient import manager
76+
77+
with manager.connect(host=host, port=830, username=user, hostkey_verify=False, device_params={'name':'junos'}) as m:
78+
c = m.get_config(source='running').data_xml
79+
with open("%s.xml" % host, 'w') as f:
80+
f.write(c)
81+
82+
Respectively, for Cisco nxos, the name is **nxos**. Device handlers are
83+
easy to implement and prove to be futureproof.
84+
85+
Changes \| brief
86+
~~~~~~~~~~~~~~~~
87+
88+
- Switch between replies if custom handler is found
89+
- Add Juniper, Cisco and default device handlers
90+
- Allow preferred SSH subsystem name in device params
91+
- Allow iteration over multiple SSH subsystem names.
92+
93+
Acknowledgements
94+
~~~~~~~~~~~~~~~~
95+
96+
Many thanks, primarily to `Jeremy
97+
Schulman <https://github.com/jeremyschulman>`_ (Juniper) for providing
98+
his precious feedback, to `Eben Aries <https://github.com/earies>`_
99+
(Juniper) for his contribution, to Juergen Brendel (Cisco) for the Cisco
100+
fork and to all contributors from Cisco and Juniper.

setup.py

+4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@
2828
print "Sorry, Python < 2.6 is not supported"
2929
exit()
3030

31+
with open('README.rst') as file:
32+
long_description = file.read()
3133

3234
setup(name='ncclient',
3335
version='0.4.0',
3436
description="Python library for NETCONF clients",
37+
long_description=long_description,
3538
author="Shikhar Bhushan, Leonidas Poulopoulos, Ebben Aries",
3639
3740
url="http://ncclient.grnet.gr/",
@@ -49,6 +52,7 @@
4952
],
5053
license="Apache License 2.0",
5154
platforms=["Posix; OS X; Windows"],
55+
keywords=('NETCONF', 'NETCONF Python client', 'Juniper Optimization', 'Cisco NXOS Optimization'),
5256
classifiers=[
5357
'Programming Language :: Python',
5458
'Topic :: System :: Networking',

0 commit comments

Comments
 (0)