diff --git a/README.md b/README.md new file mode 100644 index 0000000..af7e91d --- /dev/null +++ b/README.md @@ -0,0 +1,157 @@ +
+
+
+
+ About ◈ + Prerequisites ◈ + Installation ◈ + Getting started ◈ + Examples ◈ + Supporting the project ◈ + Joining the discussion +
+ +--- + +## 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 + +You can find an example project in the [examples](https://github.com/iotaledger/iota.py/tree/master/examples) directory. + +## 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/). diff --git a/README.rst b/docs/README.rst similarity index 100% rename from README.rst rename to docs/README.rst diff --git a/docs/index.rst b/docs/index.rst index 5c654c0..3ecb0cf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,4 +13,4 @@ multisig commands -.. include:: ../README.rst +.. include:: README.rst diff --git a/iota-python.png b/iota-python.png new file mode 100644 index 0000000..f0ac2db Binary files /dev/null and b/iota-python.png differ diff --git a/setup.py b/setup.py index 0943f48..2a97dcc 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ ## # Load long description for PyPI. -with open('README.rst', 'r', 'utf-8') as f: # type: StreamReader +with open('docs/README.rst', 'r', 'utf-8') as f: # type: StreamReader long_description = f.read() ##