zaifer
zaiferとは、ZaifAPIをPythonから呼び出すためのライブラリです。 webapiを利用するための煩雑な手続きを隠蔽し、 methodベースでZaifAPIを簡単に利用できます。
使い方
1.ZaifのアカウントページでAPIKeyを発行します。
APIKeyは第3者に明かさないよう大切に扱ってください。
2.pipコマンドを実行し、モジュールをダウンロードしてください。
pip install zaifer
3.クラスをインポートし、下記の通り使用してください。
from datetime import datetime
from decimal import Decimal
from zaifer import *
# Zaifのアカウント画面で取得したAPIキーを設定します。
key = 'aa75ffcc-6c72-4b54-a936-xxxxxxxxxxxx'
secret = '0fbe7367-0821-4417-9c65-xxxxxxxxxxxx'
# アカウント情報を取得します。
account = Account(key, secret)
print(account.get_info())
print(account.get_info2())
print(account.get_personal_info())
print(account.get_id_info())
print(account.withdraw('btc', '17A16QmavnUfCW11DAApiJxp7ARxxxxxxxx', Decimal('10.0'), None, Decimal('0.0005')))
print(account.get_deposit_history('jpy'))
print(account.get_withdraw_history('btc'))
# チャート情報を取得します。
chart = Chart()
print(chart.get_ohlc('btc_jpy', '60', datetime(
2018, 11, 4, 0), datetime(2018, 11, 5, 0)))
# 現物取引のマーケット情報を取得します。
market = Market()
print(market.get_currencies('all'))
print(market.get_currency_pairs('btc_jpy'))
print(market.get_last_price('btc_jpy'))
print(market.get_ticker('btc_jpy'))
print(market.get_trade_history('btc_jpy'))
print(market.get_depth('btc_jpy'))
# 現物取引の注文情報を取得・送信します。
trade = Trade(key, secret)
print(trade.get_trade_history('btc_jpy', datetime(2018, 11, 5)))
print(trade.get_active_orders())
print(trade.open_order('btc_jpy', 'bid', Decimal('780000'), Decimal('1')))
print(trade.cancel_order(92537563))
# AirFXのマーケット情報を取得します。
airfx_market = AirFXMarket()
print(airfx_market.get_last_price())
print(airfx_market.get_ticker())
print(airfx_market.get_trade_history())
print(airfx_market.get_depth())
print(airfx_market.get_swap_history())
# AirFXの注文情報を取得・送信します。
airfx_trade = AirFXTrade(key, secret)
print(airfx_trade.get_positions())
print(airfx_trade.get_position_history(2864))
print(airfx_trade.get_active_positions())
print(airfx_trade.create_position('bid', 420100, 1, 4))
print(airfx_trade.update_position(22904, 720000))
print(airfx_trade.cancel_position(22905))
関連情報
Metadata
Release files for zaifer 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zaifer-1.2.0.tar.gz | 9.7 kB | Without provenance | Details for zaifer-1.2.0.tar.gz |
Release files / zaifer-1.2.0.tar.gz
| Download URL | zaifer-1.2.0.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f72f0620c4ac2cb63619b089149d30844f47281d6331d3aa81d7acb75b4a170
|
|
BLAKE2b-256 checksum How to use checksums |
6ae66e1f063e5d64ca23fdcf5144ecbe70d0c19a878a3b262eab05971540ae69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2
|
Security for zaifer 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.