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

PyOTA v2.3.0-beta1 #295

Merged
merged 36 commits into from
Jan 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d19729c
Merge pull request #281 from iotaledger/master
lzpap Dec 11, 2019
d53ede8
Add header to readme with link to documentation portal
Dec 13, 2019
8b74e10
Use rst file extension and update number of supported node API endpoints
Dec 13, 2019
2c9d64d
Add rst README to docs directory
Dec 13, 2019
1e691ba
Fix path to README.rst
Dec 16, 2019
2f9d1b0
Merge pull request #282 from JakeSCahill/master
lzpap Dec 16, 2019
849a6ba
Add zero-value transaction example
JakeSCahill Dec 16, 2019
7b00041
Update README.md
JakeSCahill Dec 17, 2019
e578c0c
Update README.md
JakeSCahill Dec 17, 2019
8d13e68
Merge pull request #283 from JakeSCahill/patch-1
lzpap Jan 6, 2020
c5d6a5d
docs: Add snapshot info
lzpap Jan 10, 2020
cb8c9e2
Use class length for random TryteString generation
lzpap Jan 10, 2020
41cc47a
Merge pull request #285 from lzpap/docs_snapshot_update
lzpap Jan 13, 2020
6e0b5c2
Merge pull request #286 from lzpap/trytestring_randomlength
lzpap Jan 14, 2020
d290179
docs: Add 'Hello World' tutorial
lzpap Jan 14, 2020
b22e168
docs: Add TryteString.random() to documentation
lzpap Jan 14, 2020
fe5409a
docs: Add 'Send Data' tutorial
lzpap Jan 14, 2020
b3e3172
docs: Improve tutorial 1 and 2
lzpap Jan 15, 2020
5a3aecd
Merge pull request #287 from lzpap/tutorials_init
lzpap Jan 15, 2020
c48d874
docs: Add 'Fetch Data' tutorial
lzpap Jan 15, 2020
5d9a950
Merge pull request #289 from lzpap/fetch_data_tutorial
lzpap Jan 16, 2020
dcbd222
docs: Add new tutorials 4a, 4b and 4c
lzpap Jan 16, 2020
287382f
docs: Add '5. Send Tokens' tutorial
lzpap Jan 17, 2020
9c98ec5
docs: Add source link to tutorials
lzpap Jan 17, 2020
603815c
docs: Polish tutorials 4 and 5
lzpap Jan 20, 2020
6072a83
Merge pull request #290 from lzpap/tutorial_4
lzpap Jan 20, 2020
bd28ba9
fix: traverse_bundle checks for zero trytes
lzpap Jan 21, 2020
7635bb9
Merge pull request #292 from lzpap/get_bundles_no_tx_found
lzpap Jan 22, 2020
bfcf1f7
Add encrypt/decrypt tutorial src files
lzpap Jan 21, 2020
55b1ae9
docs: Add Tutorial 6 `Store Encrypted Data`
lzpap Jan 22, 2020
c3b7153
docs: Add Tutorial 7 `Fetch Encrypted Data`
lzpap Jan 23, 2020
585a453
PR review enhancements
lzpap Jan 24, 2020
bf4915b
Merge pull request #294 from lzpap/tutorial6
lzpap Jan 24, 2020
82a0f24
`get_bundles` can return multiple bundles
lzpap Jan 23, 2020
04fb2d0
Merge pull request #293 from lzpap/multiple_bundles
lzpap Jan 27, 2020
2b488df
Bump version number to 2.3.0b1
lzpap Jan 27, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
<h1 align="center">
<br>
<a href="https://docs.iota.org/docs/client-libraries/0.1/getting-started/python-quickstart"><img src="iota-python.png"></a>
</h1>

<h2 align="center">The official Python client library for interacting with the Tangle</h2>

<p align="center">
<a href="https://docs.iota.org/docs/client-libraries/0.1/getting-started/python-quickstart" style="text-decoration:none;">
<img src="https://img.shields.io/badge/Documentation%20portal-blue.svg?style=for-the-badge"
alt="Developer documentation portal">
</p>
<p align="center">
<a href="http://pyota.readthedocs.io/en/latest/?badge=latest" style="text-decoration:none;"><img src="https://img.shields.io/badge/ReadTheDocs-reference-informational.svg" alt="Auto-generated docs"></a>
<a href="https://discord.iota.org/" style="text-decoration:none;"><img src="https://img.shields.io/badge/Discord-9cf.svg?logo=discord" alt="Discord"></a>
<a href="https://iota.stackexchange.com/" style="text-decoration:none;"><img src="https://img.shields.io/badge/StackExchange-9cf.svg?logo=stackexchange" alt="StackExchange"></a>
<a href="https://github.com/iotaledger/entangled/blob/develop/LICENSE" style="text-decoration:none;"><img src="https://img.shields.io/github/license/iotaledger/iota.py.svg" alt="MIT license"></a>
<a href="https://docs.iota.org/docs/node-software/0.1/iri/references/api-reference" style="text-decoration:none;"><img src="https://img.shields.io/badge/Node%20API%20coverage-18/18%20commands-green.svg" alt="Supported IRI API endpoints"></a>
<a href="https://travis-ci.org/iotaledger/iota.py" style="text-decoration:none;"><img src="https://travis-ci.org/iotaledger/iota.py.svg?branch=master" alt="Build status"></a>
</p>

<p align="center">
<a href="#about">About</a> ◈
<a href="#prerequisites">Prerequisites</a> ◈
<a href="#installation">Installation</a> ◈
<a href="#getting-started">Getting started</a> ◈
<a href="#examples">Examples</a> ◈
<a href="#supporting-the-project">Supporting the project</a> ◈
<a href="#joining-the-discussion">Joining the discussion</a>
</p>

---

## About

This is the **official** Python client library, which allows you to do the following:
* Create transactions
* Read transactions
* Sign transactions
* Generate addresses

This is beta software, so there may be performance and stability issues.
Please report any issues in our [issue tracker](https://github.com/iotaledger/iota.py/issues/new).

## Prerequisites

To install the IOTA Python client library and its dependencies, you need Python version 3.7, 3.6, 3.5, or 2.7 installed on your device.

## Installation

To download the IOTA Python client library and its dependencies, do the following:

```bash
pip install pyota
```

### Installing the optional C extension

PyOTA has an optional C extension that improves the performance of its
cryptography features by an average of **60 times**.

To install this extension, do the following:

```bash
pip install pyota[ccurl]
```

### Installing the optional module for local proof of work

To do proof of work on your local device without relying on a node,
you can install the [PyOTA-PoW](https://pypi.org/project/PyOTA-PoW/) extension module.

To install this extension, use the following command::

```bash
pip install pyota[pow]
```

When you've installed this module, you can use it by passing the `local_pow=True` argument to your API instance. Doing so will redirect all `attach_to_tangle`
API calls to an interface function in the `pow` package.

### Installing from source

To install the library from the source code on GitHub, do the following:

```bash
# Recommended, but not required
Create virtualenv
git clone https://github.com/iotaledger/iota.py.git
pip install -e .
```

## Getting started

After you've [installing the library](#installation), you can connect to an IRI node to send transactions to it and interact with the ledger.
An extended guide can be found on our [documentation portal](https://docs.iota.org/docs/client-libraries/0.1/getting-started/python-quickstart), we strongly recommend you to go here for starting off. A quick starting tutorial is shown below.

To connect to a local IRI node, you can do the following:

```py
from iota import Iota

# Create a new instance of the IOTA API object
# Specify which node to connect to
api = Iota(adapter = 'https://nodes.devnet.iota.org:443')

# Call the `get_node_info()` method for information about the node and the Tangle
response = api.get_node_info()

print(response)
```

## Examples

We have a list of test cases in the [`examples` directory](https://github.com/iotaledger/iota.py/tree/master/examples) that you can use as a reference when developing apps with IOTA.

Here's how you could send a zero-value transaction, using the library. For the guide, see the [documentation portal](https://docs.iota.org/docs/client-libraries/0.1/how-to-guides/python/send-your-first-bundle).

```python
# You don't need a seed to send zero-value transactions
api = Iota('https://nodes.devnet.iota.org:443', testnet=True)

# Define a message to send.
# This message must include only ASCII characters.
message = TryteString.from_unicode('Hello world')

# Define an address.
# This does not need to belong to anyone or have IOTA tokens.
# It must only contain a maximum of 81 trytes
# or 90 trytes with a valid checksum
address = 'ZLGVEQ9JUZZWCZXLWVNTHBDX9G9KZTJP9VEERIIFHY9SIQKYBVAHIMLHXPQVE9IXFDDXNHQINXJDRPFDXNYVAPLZAW'

# Define a zero-value transaction object
# that sends the message to the address
tx = ProposedTransaction(
address = Address(address),
message = message,
value = 0
)

# Create a bundle from the `ProposedTransaction` object
# and send the transaction to the node
result = api.send_transfer(transfers=[tx])

print('Bundle: ')

print(result['bundle'].hash)
```

## Supporting the project

If the IOTA Python client library has been useful to you and you feel like contributing, consider posting a [bug report](https://github.com/iotaledger/iota.py/issues/new-issue), feature request or a [pull request](https://github.com/iotaledger/iota.py/pulls/).
We have some [basic contribution guidelines](CONTRIBUTING.rst) to keep our code base stable and consistent.

### Running test cases

To run test, do the following:

```bash
python setup.py test
```

PyOTA is also compatible with [tox](https://tox.readthedocs.io/), which will run the unit tests in different virtual environments (one for each supported version of Python).

To run the unit tests, it is recommended that you use the `-p` argument.
This speeds up the tests by running them in parallel.

Install PyOTA with the `test-runner` extra to set up the necessary
dependencies, and then you can run the tests with the `tox` command::

```bash
pip install -e .[test-runner]
tox -v -p all
```

### Building the auto-generated documentation

The auto-generated documentation can be generated on your local device by doing the following:

```bash
# Install extra dependencies (you only have to do this once)
pip install .[docs-builder]
cd docs
# Build the documentation::
make html
```

## Joining the discussion

If you want to get involved in the community, need help with getting setup, have any issues related with the library or just want to discuss blockchain, distributed ledgers, and IoT with other people, feel free to join our [Discord](https://discord.iota.org/).
File renamed without changes.
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
addresses
multisig
commands
tutorials

.. include:: ../README.rst
.. include:: README.rst
Loading