Skip to content

Commit 93d754b

Browse files
author
Pan
committed
Added sphinx generated API documentation.
Updated docstrings. Updated readme.
1 parent 5b870a6 commit 93d754b

28 files changed

+1097
-540
lines changed

.travis.yml

-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ sudo: required
66
services:
77
- docker
88
python:
9-
- 2.6
109
- 2.7
1110
- 3.4
1211
- 3.5
@@ -26,8 +25,6 @@ script:
2625
- nosetests
2726
- flake8 ssh2
2827
jobs:
29-
allow_failures:
30-
- python: 2.6
3128
include:
3229
- stage: build_packages
3330
python: 3.6

README.rst

+18-9
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@ Super fast SSH2 protocol library. ``ssh2-python`` provides Python bindings for `
1111
:alt: Latest Version
1212
.. image:: https://travis-ci.org/ParallelSSH/ssh2-python.svg?branch=master
1313
:target: https://travis-ci.org/ParallelSSH/ssh2-python
14+
.. image:: https://readthedocs.org/projects/ssh2-python/badge/?version=latest
15+
:target: http://ssh2-python.readthedocs.io/en/latest/?badge=latest
16+
:alt: Documentation
1417

1518
Installation
1619
______________
1720

21+
System packages are available on the `latest releases page <https://github.com/ParallelSSH/ssh2-python/releases/latest>`_ built on Centos/RedHat 6/7, Ubuntu 14.04/16.04, Debian 7/8 and Fedora 22/23/24.
22+
23+
Installation from Source
24+
_________________________
25+
1826
Install ``libssh2`` and Python header files.
1927

2028
Ubuntu
21-
----------
29+
--------
2230

2331
.. code-block:: shell
2432
@@ -35,18 +43,17 @@ RedHat
3543
pip install ssh2-python
3644
3745
38-
Feature Set
39-
_____________
46+
API Feature Set
47+
________________
4048

41-
Majority of the `libssh2`_ API has been implemented. ``ssh2-python`` is a thin wrapper of ``libssh2`` - its code examples can be ported straight over to Python with only minimal changes.
49+
Currently the entirety of the `libssh2`_ API has been implemented. `API documentation is available <https://readthedocs.org/projects/ssh2-python/badge/?version=latest>`_ for ``ssh2-python``.
4250

43-
Some parts are yet to be implemented though majority of the API is complete.
51+
Complete example scripts for various operations can be found in the `examples directory`.
4452

45-
*Library is at the moment available as source code only. Binary releases to follow.*
53+
In addition, ``ssh2-python`` is a thin wrapper of ``libssh2`` with Python semantics - its code examples can be ported straight over to Python with only minimal changes.
4654

47-
48-
Examples
49-
___________
55+
Quick Start
56+
_____________
5057

5158
Both byte and unicode strings are accepted as arguments and encoded appropriately. To change default encoding change the value of ``ssh2.utils.ENCODING``. Channel output is always byte strings.
5259

@@ -214,7 +221,9 @@ ________________________________________
214221
* SFTP file handles and attributes
215222
* SSH port forwarding and tunnelling
216223
* Non-blocking mode
224+
* SCP send and receive
217225
* Listener for port forwarding
226+
* Subsystem support
218227

219228
And more, as per `libssh2`_ functionality.
220229

doc/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = python -msphinx
7+
SPHINXPROJ = ssh2-python
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

doc/agent.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ssh2.agent
2+
============
3+
4+
.. automodule:: ssh2.agent
5+
:members:
6+
:undoc-members:
7+
:member-order: groupwise

doc/api.rst

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
API Documentation
2+
********************
3+
4+
.. toctree::
5+
6+
session
7+
channel
8+
agent
9+
sftp
10+
pkey
11+
listener
12+
exceptions
13+
statinfo
14+
fileinfo

doc/channel.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ssh2.channel
2+
============
3+
4+
.. automodule:: ssh2.channel
5+
:members:
6+
:undoc-members:
7+
:member-order: groupwise

doc/conf.py

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# ssh2-python documentation build configuration file, created by
4+
# sphinx-quickstart on Mon Aug 7 11:22:12 2017.
5+
#
6+
# This file is execfile()d with the current directory set to its
7+
# containing dir.
8+
#
9+
# Note that not all possible configuration values are present in this
10+
# autogenerated file.
11+
#
12+
# All configuration values have a default; values that are commented out
13+
# serve to show the default.
14+
15+
# If extensions (or modules to document with autodoc) are in another directory,
16+
# add these directories to sys.path here. If the directory is relative to the
17+
# documentation root, use os.path.abspath to make it absolute, like shown here.
18+
#
19+
import os
20+
import sys
21+
sys.path.insert(0, os.path.abspath('..'))
22+
import ssh2
23+
24+
25+
# -- General configuration ------------------------------------------------
26+
27+
# If your documentation needs a minimal Sphinx version, state it here.
28+
#
29+
# needs_sphinx = '1.0'
30+
31+
# Add any Sphinx extension module names here, as strings. They can be
32+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
33+
# ones.
34+
extensions = ['sphinx.ext.autodoc',
35+
'sphinx.ext.intersphinx',
36+
'sphinx.ext.todo',
37+
]
38+
39+
autodoc_default_flags = ['members']
40+
41+
# Add any paths that contain templates here, relative to this directory.
42+
templates_path = ['_templates']
43+
44+
# The suffix(es) of source filenames.
45+
# You can specify multiple suffix as a list of string:
46+
#
47+
# source_suffix = ['.rst', '.md']
48+
source_suffix = '.rst'
49+
50+
# The master toctree document.
51+
master_doc = 'index'
52+
53+
# General information about the project.
54+
project = u'ssh2-python'
55+
copyright = u'2017, P Kittenis'
56+
author = u'P Kittenis'
57+
58+
# The version info for the project you're documenting, acts as replacement for
59+
# |version| and |release|, also used in various other places throughout the
60+
# built documents.
61+
#
62+
# The short X.Y version.
63+
version = ssh2.__version__
64+
# The full version, including alpha/beta/rc tags.
65+
release = ssh2.__version__
66+
67+
# The language for content autogenerated by Sphinx. Refer to documentation
68+
# for a list of supported languages.
69+
#
70+
# This is also used if you do content translation via gettext catalogs.
71+
# Usually you set "language" from the command line for these cases.
72+
language = None
73+
74+
# List of patterns, relative to source directory, that match files and
75+
# directories to ignore when looking for source files.
76+
# This patterns also effect to html_static_path and html_extra_path
77+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
78+
79+
# The name of the Pygments (syntax highlighting) style to use.
80+
pygments_style = 'sphinx'
81+
82+
# If true, `todo` and `todoList` produce output, else they produce nothing.
83+
todo_include_todos = True
84+
85+
86+
# -- Options for HTML output ----------------------------------------------
87+
88+
# The theme to use for HTML and HTML Help pages. See the documentation for
89+
# a list of builtin themes.
90+
#
91+
html_theme = 'sphinx_rtd_theme'
92+
93+
# Theme options are theme-specific and customize the look and feel of a theme
94+
# further. For a list of options available for each theme, see the
95+
# documentation.
96+
#
97+
# html_theme_options = {}
98+
99+
# Add any paths that contain custom static files (such as style sheets) here,
100+
# relative to this directory. They are copied after the builtin static files,
101+
# so a file named "default.css" will overwrite the builtin "default.css".
102+
html_static_path = ['_static']
103+
104+
# Custom sidebar templates, must be a dictionary that maps document names
105+
# to template names.
106+
#
107+
# This is required for the alabaster theme
108+
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
109+
html_sidebars = {
110+
'**': [
111+
'about.html',
112+
'navigation.html',
113+
'relations.html', # needs 'show_related': True theme option to display
114+
'searchbox.html',
115+
'donate.html',
116+
]
117+
}
118+
119+
120+
# -- Options for HTMLHelp output ------------------------------------------
121+
122+
# Output file base name for HTML help builder.
123+
htmlhelp_basename = 'ssh2-pythondoc'
124+
125+
126+
# -- Options for LaTeX output ---------------------------------------------
127+
128+
latex_elements = {
129+
# The paper size ('letterpaper' or 'a4paper').
130+
#
131+
# 'papersize': 'letterpaper',
132+
133+
# The font size ('10pt', '11pt' or '12pt').
134+
#
135+
# 'pointsize': '10pt',
136+
137+
# Additional stuff for the LaTeX preamble.
138+
#
139+
# 'preamble': '',
140+
141+
# Latex figure (float) alignment
142+
#
143+
# 'figure_align': 'htbp',
144+
}
145+
146+
# Grouping the document tree into LaTeX files. List of tuples
147+
# (source start file, target name, title,
148+
# author, documentclass [howto, manual, or own class]).
149+
latex_documents = [
150+
(master_doc, 'ssh2-python.tex', u'ssh2-python Documentation',
151+
u'P Kittenis', 'manual'),
152+
]
153+
154+
155+
# -- Options for manual page output ---------------------------------------
156+
157+
# One entry per manual page. List of tuples
158+
# (source start file, name, description, authors, manual section).
159+
man_pages = [
160+
(master_doc, 'ssh2-python', u'ssh2-python Documentation',
161+
[author], 1)
162+
]
163+
164+
165+
# -- Options for Texinfo output -------------------------------------------
166+
167+
# Grouping the document tree into Texinfo files. List of tuples
168+
# (source start file, target name, title, author,
169+
# dir menu entry, description, category)
170+
texinfo_documents = [
171+
(master_doc, 'ssh2-python', u'ssh2-python Documentation',
172+
author, 'ssh2-python', 'Python SSH library based on libssh2.',
173+
'Miscellaneous'),
174+
]
175+
176+
177+
178+
179+
# Example configuration for intersphinx: refer to the Python standard library.
180+
intersphinx_mapping = {'https://docs.python.org/': None}
181+
autoclass_content = "both"

doc/exceptions.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Exceptions
2+
===========
3+
4+
.. automodule:: ssh2.exceptions
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
:member-order: groupwise

doc/fileinfo.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
File Info
2+
===========
3+
4+
.. automodule:: ssh2.fileinfo
5+
:members:
6+
:undoc-members:
7+
:member-order: groupwise

doc/index.rst

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.. ssh2-python documentation master file, created by
2+
sphinx-quickstart on Mon Aug 7 11:22:12 2017.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
ssh2-python Documentation
7+
===========================
8+
9+
Super fast SSH2 protocol library. ``ssh2-python`` provides Python bindings for `libssh2`_.
10+
11+
.. image:: https://img.shields.io/badge/License-LGPL%20v2-blue.svg
12+
:target: https://pypi.python.org/pypi/ssh2-python
13+
:alt: License
14+
.. image:: https://img.shields.io/pypi/v/ssh2-python.svg
15+
:target: https://pypi.python.org/pypi/ssh2-python
16+
:alt: Latest Version
17+
.. image:: https://travis-ci.org/ParallelSSH/ssh2-python.svg?branch=master
18+
:target: https://travis-ci.org/ParallelSSH/ssh2-python
19+
20+
21+
.. toctree::
22+
:maxdepth: 2
23+
:caption: Contents:
24+
25+
introduction
26+
installation
27+
api
28+
29+
30+
Indices and tables
31+
==================
32+
33+
* :ref:`genindex`
34+
* :ref:`modindex`
35+
* :ref:`search`
36+
37+
.. _libssh2: https://www.libssh2.org

0 commit comments

Comments
 (0)