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

Commit 3c0cdf8

Browse files
authored
Merge pull request #87 from iotaledger/release/2.0.1
Release/2.0.1
2 parents d69b5c9 + 3af6106 commit 3c0cdf8

30 files changed

+1443
-453
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ PyOTA.egg-info/*
77
build/*
88
dist/*
99

10+
# Sphinx documentation
11+
docs/_build/
12+
1013
# Created by ``setup.py test``.
1114
.eggs/*
1215

@@ -18,4 +21,4 @@ dist/*
1821
# Note: For environment- or IDE-specific metadata (e.g., .DS_Store, .idea, etc.
1922
# you can add these to your own "global" .gitignore file.
2023
# https://help.github.com/articles/ignoring-files/#create-a-global-gitignore
21-
#
24+
#

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include LICENSE
2+
include README.rst
23
recursive-include examples *.py
34
recursive-include test *.py *.csv

README.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
.. image:: https://travis-ci.org/iotaledger/iota.lib.py.svg?branch=develop
1+
.. image:: https://travis-ci.org/iotaledger/iota.lib.py.svg?branch=master
22
:target: https://travis-ci.org/iotaledger/iota.lib.py
33

4+
.. image:: https://readthedocs.org/projects/pyota/badge/?version=latest
5+
:target: http://pyota.readthedocs.io/en/latest/?badge=latest
6+
47
=====
58
PyOTA
69
=====

docs/Makefile

Lines changed: 20 additions & 0 deletions
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 = PyOTA
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)

docs/conf.py

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

docs/getting_started.rst

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
Installation
2+
============
3+
PyOTA is compatible with Python 3.6, 3.5 and 2.7.
4+
5+
Install PyOTA using `pip`:
6+
7+
.. code-block:: bash
8+
9+
pip install pyota[ccurl]
10+
11+
.. note::
12+
13+
The ``[ccurl]`` extra installs the optional `PyOTA-CCurl extension`_.
14+
15+
This extension boosts the performance of certain crypto operations
16+
significantly (speedups of 60x are common).
17+
18+
Getting Started
19+
===============
20+
In order to interact with the IOTA network, you will need access to a node.
21+
22+
You can:
23+
24+
- `Run your own node.`_
25+
- `Use a light wallet node.`_
26+
- `Use the sandbox node.`_
27+
28+
Note that light wallet nodes often disable certain features like PoW for
29+
security reasons.
30+
31+
Once you've gotten access to an IOTA node, initialize an :py:class:`iota.Iota`
32+
object with the URI of the node, and optional seed:
33+
34+
.. code-block:: python
35+
36+
from iota import Iota
37+
38+
# Generate a random seed.
39+
api = Iota('http://localhost:14265')
40+
41+
# Specify seed.
42+
api = Iota('http://localhost:14265', 'SEED9GOES9HERE')
43+
44+
Test your connection to the server by sending a ``getNodeInfo`` command:
45+
46+
.. code-block:: python
47+
48+
print(api.get_node_info())
49+
50+
You are now ready to send commands to your IOTA node!
51+
52+
Using the Sandbox Node
53+
----------------------
54+
To connect to the sandbox node, you will need to inject a
55+
:py:class:`SandboxAdapter` into your :py:class:`Iota` object. This will modify
56+
your API requests so that they contain the necessary authentication metadata.
57+
58+
.. code-block:: python
59+
60+
from iota.adapter.sandbox import SandboxAdapter
61+
62+
api = Iota(
63+
# To use sandbox mode, inject a ``SandboxAdapter``.
64+
adapter = SandboxAdapter(
65+
# URI of the sandbox node.
66+
uri = 'https://sandbox.iotatoken.com/api/v1/',
67+
68+
# Access token used to authenticate requests.
69+
# Contact the node maintainer to get an access token.
70+
auth_token = 'auth token goes here',
71+
),
72+
73+
# Seed used for cryptographic functions.
74+
# If null, a random seed will be generated.
75+
seed = b'SEED9GOES9HERE',
76+
)
77+
78+
.. _forum: https://forum.iota.org/
79+
.. _official api: https://iota.readme.io/
80+
.. _pyota-ccurl extension: https://pypi.python.org/pypi/PyOTA-CCurl
81+
.. _run your own node.: http://iotasupport.com/headlessnode.shtml
82+
.. _slack: http://slack.iota.org/
83+
.. _use a light wallet node.: http://iotasupport.com/lightwallet.shtml
84+
.. _use the sandbox node.: http://dev.iota.org/sandbox

docs/index.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. toctree::
2+
:maxdepth: 1
3+
:hidden:
4+
5+
getting_started
6+
types
7+
8+
.. note::
9+
**🚧 PyOTA documentation is still under construction. 🚧**
10+
11+
Follow https://github.com/iotaledger/iota.lib.py/issues/78 for updates.
12+
13+
.. include:: ../README.rst

docs/make.bat

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=python -msphinx
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
set SPHINXPROJ=PyOTA
13+
14+
if "%1" == "" goto help
15+
16+
%SPHINXBUILD% >NUL 2>NUL
17+
if errorlevel 9009 (
18+
echo.
19+
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
20+
echo.then set the SPHINXBUILD environment variable to point to the full
21+
echo.path of the 'sphinx-build' executable. Alternatively you may add the
22+
echo.Sphinx directory to PATH.
23+
echo.
24+
echo.If you don't have Sphinx installed, grab it from
25+
echo.http://sphinx-doc.org/
26+
exit /b 1
27+
)
28+
29+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30+
goto end
31+
32+
:help
33+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34+
35+
:end
36+
popd

0 commit comments

Comments
 (0)