Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StdevMac t127 docker for python wrapper #128

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .travis/install-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ chmod +x "$HOME/bin/gimme"
# Install Python libraries
$PIP install --upgrade pip setuptools tox-travis
$PIP install -r "$REPO_ROOT/requirements.dev.txt"
$PIP install -r "$REPO_ROOT/skyapi/requirements.txt"
$PIP install -r "$REPO_ROOT/skyapi/test-requirements.txt"

# Compile SWIG
mkdir swig_build && \
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## PySkycoin 0.25.1 - 2019/03/14

### Added

- Add `skyapi`, a wrapper for Skycoin api in version 0.25.1

### Fixed

- Fix #86 - Python API wrapper for the Skycoin node API

## PySkycoin 0.25.0 - 2019/01/01

### Added
Expand Down
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.DEFAULT_GOAL := help
.PHONY: configure build-libc build-swig develop build-libc-swig build
.PHONY: configure build-libc build-swig develop build-libc-swig build
.PHONY: test test-ci help

# Compilation output
.ONESHELL:
SHELL := /bin/bash

PYTHON_BIN = python
PYTHON = python
PWD = $(shell pwd)
GOPATH_DIR = $(PWD)/gopath
SKYCOIN_DIR = gopath/src/github.com/skycoin/skycoin
Expand All @@ -25,6 +25,8 @@ SRC_FILES = $(shell find $(SKYCOIN_DIR)/src -type f -name "*.go")
SWIG_FILES = $(shell find $(LIBSWIG_DIR) -type f -name "*.i")
HEADER_FILES = $(shell find $(SKYCOIN_DIR)/include -type f -name "*.h")

PYTHON_CLIENT_DIR = skyapi

ifeq ($(shell uname -s),Linux)
TEMP_DIR = tmp
else ifeq ($(shell uname -s),Darwin)
Expand Down Expand Up @@ -65,24 +67,30 @@ build-swig: ## Generate Python C module from SWIG interfaces
swig -python -w501,505,401,302,509,451 -Iswig/include -I$(INCLUDE_DIR) -outdir ./skycoin/ -o swig/pyskycoin_wrap.c $(LIBSWIG_DIR)/pyskycoin.i

develop: ## Install PySkycoin for development
$(PYTHON_BIN) setup.py develop
$(PYTHON) setup.py develop
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py develop)

build-libc-swig: build-libc build-swig

build: build-libc-swig ## Build PySkycoin Python package
$(PYTHON_BIN) setup.py build
$(PYTHON) setup.py build
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py build)

test-ci: ## Run tests on (Travis) CI build
tox
(cd $(PYTHON_CLIENT_DIR) && tox)

test: build-libc build-swig develop ## Run project test suite
$(PYTHON_BIN) setup.py test
$(PYTHON) setup.py test
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py test)

sdist: ## Create source distribution archive
$(PYTHON_BIN) setup.py sdist --formats=gztar
$(PYTHON) setup.py sdist --formats=gztar
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py sdist --formats=gztar)

bdist_wheel: ## Create architecture-specific binary wheel distribution archive
$(PYTHON_BIN) setup.py bdist_wheel
$(PYTHON) setup.py bdist_wheel
(cd $(PYTHON_CLIENT_DIR) && $(PYTHON) setup.py bdist_wheel)

# FIXME: After libskycoin 32-bits binaries add bdist_manylinux_i686
bdist_manylinux: bdist_manylinux_amd64 ## Create multilinux binary wheel distribution archives
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ A Python extension generated with SWIG to access Skycoin API from Python.
- [Update the version](#update-the-version)
- [Pre-release testing](#pre-release-testing)
- [Creating release builds](#creating-release-builds)
- [Python wrapper for Skycoin Api](#python-wrapper-for-skycoin-api)
<!-- /MarkdownTOC -->

## Installation
Expand Down Expand Up @@ -252,3 +253,22 @@ python3 -m pip install --user --upgrade twine
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```

#### Python wrapper for Skycoin Api

This wrapper is Auto generated by openapi-generator directly from `Skycoin Api` code for version v0.25.1.

For further details of usage of `Python wrapper for Skycoin Api` see [Autogenerated documentation](./skyapi/README.md)

To use wrapper for specific node of Skycoin api, just do the next:

```python

# create an instance of the Configuration class
configuration = skyapi.Configuration()
# set new host
configuration.host = 'some_host'

# create an instance of the API class with new configuration
api_instance = skyapi.DefaultApi(skyapi.ApiClient(configuration))

```
5 changes: 5 additions & 0 deletions docker/images/dev-cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,9 @@ RUN pip install --upgrade $PIP_PACKAGES \

WORKDIR $GOPATH/src/github.com/skycoin

COPY ./skyapi/requirements.txt .

RUN pip install -r requirements.txt \
&& pip3 install -r requirements.txt

VOLUME $GOPATH/src/
12 changes: 12 additions & 0 deletions docs/BuildInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# BuildInfo

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**branch** | **str** | git branch name | [optional]
**commit** | **str** | git commit id | [optional]
**version** | **str** | version number | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


256 changes: 256 additions & 0 deletions docs/DefaultApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,256 @@
# swagger_client.DefaultApi

All URIs are relative to *http://staging.node.skycoin.net*

Method | HTTP request | Description
------------- | ------------- | -------------
[**coin_supply**](DefaultApi.md#coin_supply) | **GET** /api/v1/coinSupply |
[**csrf_token**](DefaultApi.md#csrf_token) | **GET** /api/v1/csrf | Creates a new CSRF token. Previous CSRF tokens are invalidated by this call.
[**resend_unconfirmed_txns**](DefaultApi.md#resend_unconfirmed_txns) | **POST** /api/v1/resendUnconfirmedTxns |
[**version**](DefaultApi.md#version) | **GET** /api/v1/version |
[**wallet_folder**](DefaultApi.md#wallet_folder) | **GET** /api/v1/wallets/folderName |


# **coin_supply**
> coin_supply()



coinSupplyHandler returns coin distribution supply stats

### Example
```python
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

try:
api_instance.coin_supply()
except ApiException as e:
print("Exception when calling DefaultApi->coin_supply: %s\n" % e)
```

### Parameters
This endpoint does not need any parameter.

### Return type

void (empty response body)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **csrf_token**
> InlineResponse200 csrf_token()

Creates a new CSRF token. Previous CSRF tokens are invalidated by this call.

Response -> CSRF token to use in POST requests

### Example
```python
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

try:
# Creates a new CSRF token. Previous CSRF tokens are invalidated by this call.
api_response = api_instance.csrf_token()
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->csrf_token: %s\n" % e)
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**InlineResponse200**](InlineResponse200.md)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **resend_unconfirmed_txns**
> resend_unconfirmed_txns()



Broadcasts all unconfirmed transactions from the unconfirmed transaction pool

### Example
```python
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

try:
api_instance.resend_unconfirmed_txns()
except ApiException as e:
print("Exception when calling DefaultApi->resend_unconfirmed_txns: %s\n" % e)
```

### Parameters
This endpoint does not need any parameter.

### Return type

void (empty response body)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **version**
> BuildInfo version()



versionHandler returns the application version info

### Example
```python
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

try:
api_response = api_instance.version()
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->version: %s\n" % e)
```

### Parameters
This endpoint does not need any parameter.

### Return type

[**BuildInfo**](BuildInfo.md)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **wallet_folder**
> wallet_folder()



Returns the wallet directory path

### Example
```python
from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: csrfAuth
configuration = swagger_client.Configuration()
configuration.api_key['csrf_Token'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['csrf_Token'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration))

try:
api_instance.wallet_folder()
except ApiException as e:
print("Exception when calling DefaultApi->wallet_folder: %s\n" % e)
```

### Parameters
This endpoint does not need any parameter.

### Return type

void (empty response body)

### Authorization

[csrfAuth](../README.md#csrfAuth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

Loading