From 93bbbf6f280a611600ee1867e99ead25f2c5972a Mon Sep 17 00:00:00 2001 From: Yasuaki Uechi Date: Thu, 3 Aug 2017 17:15:37 +0900 Subject: [PATCH 1/2] add pip support --- .gitignore | 103 ++++++++++++++++++++ coincheck/__init__.py | 0 {src/coincheck => coincheck}/account.py | 0 {src/coincheck => coincheck}/bankaccount.py | 0 {src/coincheck => coincheck}/borrow.py | 0 {src/coincheck => coincheck}/coincheck.py | 4 +- {src/coincheck => coincheck}/deposit.py | 0 {src/coincheck => coincheck}/leverage.py | 0 {src/coincheck => coincheck}/order.py | 0 {src/coincheck => coincheck}/orderbook.py | 0 {src/coincheck => coincheck}/send.py | 0 {src/coincheck => coincheck}/servicebase.py | 0 {src/coincheck => coincheck}/ticker.py | 0 {src/coincheck => coincheck}/trade.py | 0 {src/coincheck => coincheck}/transfer.py | 0 {src/coincheck => coincheck}/withdraw.py | 0 setup.py | 10 ++ {src => test}/test.py | 0 18 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 coincheck/__init__.py rename {src/coincheck => coincheck}/account.py (100%) rename {src/coincheck => coincheck}/bankaccount.py (100%) rename {src/coincheck => coincheck}/borrow.py (100%) rename {src/coincheck => coincheck}/coincheck.py (96%) rename {src/coincheck => coincheck}/deposit.py (100%) rename {src/coincheck => coincheck}/leverage.py (100%) rename {src/coincheck => coincheck}/order.py (100%) rename {src/coincheck => coincheck}/orderbook.py (100%) rename {src/coincheck => coincheck}/send.py (100%) rename {src/coincheck => coincheck}/servicebase.py (100%) rename {src/coincheck => coincheck}/ticker.py (100%) rename {src/coincheck => coincheck}/trade.py (100%) rename {src/coincheck => coincheck}/transfer.py (100%) rename {src/coincheck => coincheck}/withdraw.py (100%) create mode 100644 setup.py rename {src => test}/test.py (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f2178d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,103 @@ +# Created by https://www.gitignore.io/api/python + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# dotenv +.env + +# virtualenv +.venv +venv/ +ENV/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# End of https://www.gitignore.io/api/python diff --git a/coincheck/__init__.py b/coincheck/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/coincheck/account.py b/coincheck/account.py similarity index 100% rename from src/coincheck/account.py rename to coincheck/account.py diff --git a/src/coincheck/bankaccount.py b/coincheck/bankaccount.py similarity index 100% rename from src/coincheck/bankaccount.py rename to coincheck/bankaccount.py diff --git a/src/coincheck/borrow.py b/coincheck/borrow.py similarity index 100% rename from src/coincheck/borrow.py rename to coincheck/borrow.py diff --git a/src/coincheck/coincheck.py b/coincheck/coincheck.py similarity index 96% rename from src/coincheck/coincheck.py rename to coincheck/coincheck.py index e0cb14f..18bfc1d 100644 --- a/src/coincheck/coincheck.py +++ b/coincheck/coincheck.py @@ -70,7 +70,7 @@ def request(self, method, path, params): if (method == ServiceBase.METHOD_POST or method == ServiceBase.METHOD_DELETE): data = json.dumps(params).encode('utf-8') self.request_headers = { - 'content-type': "application/json" + 'content-type': 'application/json' } self.setSignature(path, params) @@ -81,4 +81,4 @@ def request(self, method, path, params): self.client.request(method, path, data, self.request_headers) res = self.client.getresponse() data = res.read() - return data.decode("utf-8") \ No newline at end of file + return json.loads(data.decode('utf-8')) \ No newline at end of file diff --git a/src/coincheck/deposit.py b/coincheck/deposit.py similarity index 100% rename from src/coincheck/deposit.py rename to coincheck/deposit.py diff --git a/src/coincheck/leverage.py b/coincheck/leverage.py similarity index 100% rename from src/coincheck/leverage.py rename to coincheck/leverage.py diff --git a/src/coincheck/order.py b/coincheck/order.py similarity index 100% rename from src/coincheck/order.py rename to coincheck/order.py diff --git a/src/coincheck/orderbook.py b/coincheck/orderbook.py similarity index 100% rename from src/coincheck/orderbook.py rename to coincheck/orderbook.py diff --git a/src/coincheck/send.py b/coincheck/send.py similarity index 100% rename from src/coincheck/send.py rename to coincheck/send.py diff --git a/src/coincheck/servicebase.py b/coincheck/servicebase.py similarity index 100% rename from src/coincheck/servicebase.py rename to coincheck/servicebase.py diff --git a/src/coincheck/ticker.py b/coincheck/ticker.py similarity index 100% rename from src/coincheck/ticker.py rename to coincheck/ticker.py diff --git a/src/coincheck/trade.py b/coincheck/trade.py similarity index 100% rename from src/coincheck/trade.py rename to coincheck/trade.py diff --git a/src/coincheck/transfer.py b/coincheck/transfer.py similarity index 100% rename from src/coincheck/transfer.py rename to coincheck/transfer.py diff --git a/src/coincheck/withdraw.py b/coincheck/withdraw.py similarity index 100% rename from src/coincheck/withdraw.py rename to coincheck/withdraw.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..5aa6178 --- /dev/null +++ b/setup.py @@ -0,0 +1,10 @@ +#!usr/bin/env python + +from setuptools import setup, find_packages + +setup(name="coincheck", + version="0.1.0", + description="coincheck", + url="https://github.com/coincheckjp/coincheck-python", + packages=find_packages() +) \ No newline at end of file diff --git a/src/test.py b/test/test.py similarity index 100% rename from src/test.py rename to test/test.py From 49c3e7ee7380530e255cd702e3480582ac2c748d Mon Sep 17 00:00:00 2001 From: Yasuaki Uechi Date: Thu, 3 Aug 2017 17:17:21 +0900 Subject: [PATCH 2/2] add installation document --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c02b3eb..8068a1e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ coincheck The easiest Bitcoin Exchange in Japan https://coincheck.jp/ +## Install + +``` +pip install git+https://github.com/coincheckjp/coincheck-python +``` + ## Usage ```python