A library to connect to PocketOption using python with async and sync support.
Project description
BinaryOptionsToolsV2
Comprehensive Documentation for BinaryOptionsToolsV2
__init__.py
This file initializes the Python module and organizes the imports for both synchronous and asynchronous functionality.
Key Details
- Imports
BinaryOptionsToolsV2: Imports all elements and documentation from the Rust module. - Includes Submodules: Imports and exposes
asyncronousandsyncronousmodules for user convenience.
Purpose
Serves as the entry point for the package, exposing all essential components of the library.
asyncronous.py
This file implements the PocketOptionAsync class, which provides an asynchronous interface to interact with Pocket Option.
Key Features of PocketOptionAsync
- Trade Operations:
buy(): Places a buy trade asynchronously.sell(): Places a sell trade asynchronously.check_win(): Checks the outcome of a trade ('win', 'draw', or 'loss').
- Market Data:
get_candles(): Fetches historical candle data.history(): Retrieves recent data for a specific asset.
- Account Management:
balance(): Returns the current account balance.opened_deals(): Lists all open trades.closed_deals(): Lists all closed trades.payout(): Returns payout percentages.
- Real-Time Data:
subscribe_symbol(): Provides an asynchronous iterator for real-time candle updates.
Helper Class - AsyncSubscription
Facilitates asynchronous iteration over live data streams, enabling non-blocking operations.
Example Usage
from BinaryOptionsToolsV2.asyncronous import PocketOptionAsync
import asyncio
async def main():
client = PocketOptionAsync(ssid="your-session-id")
await asyncio.sleep(5)
balance = await client.balance()
print("Account Balance:", balance)
asyncio.run(main())
syncronous.py
This file implements the PocketOption class, a synchronous wrapper around the asynchronous interface provided by PocketOptionAsync.
Key Features of PocketOption
- Trade Operations:
buy(): Places a buy trade using synchronous execution.sell(): Places a sell trade.check_win(): Checks the trade outcome synchronously.
- Market Data:
get_candles(): Fetches historical candle data.history(): Retrieves recent data for a specific asset.
- Account Management:
balance(): Retrieves account balance.opened_deals(): Lists all open trades.closed_deals(): Lists all closed trades.payout(): Returns payout percentages.
- Real-Time Data:
subscribe_symbol(): Provides a synchronous iterator for live data updates.
Helper Class - SyncSubscription
Allows synchronous iteration over real-time data streams for compatibility with simpler scripts.
Example Usage
from BinaryOptionsToolsV2.syncronous import PocketOption
import time
client = PocketOption(ssid="your-session-id")
time.sleep(5)
balance = client.balance()
print("Account Balance:", balance)
- Differences Between PocketOption and PocketOptionAsync
| Feature | PocketOption (Synchronous) | PocketOptionAsync (Asynchronous) |
|---|---|---|
| Execution Type | Blocking | Non-blocking |
| Use Case | Simpler scripts | High-frequency or real-time tasks |
| Performance | Slower for concurrent tasks | Scales well with concurrent operations |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file BinaryOptionsToolsV2-0.1.5.tar.gz.
File metadata
- Download URL: BinaryOptionsToolsV2-0.1.5.tar.gz
- Upload date:
- Size: 125.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc6f0a4b715089a0d40b37a16f8460007276f7b447fd0866d042606af869cdbb
|
|
| MD5 |
4f87c992eb6fd066fdabd357260fb0a8
|
|
| BLAKE2b-256 |
08004038b434bcd24ee81ee7a01c78c0b25eb97edeea877db2849ba7fcc7542d
|
File details
Details for the file BinaryOptionsToolsV2-0.1.5-cp312-none-win_amd64.whl.
File metadata
- Download URL: BinaryOptionsToolsV2-0.1.5-cp312-none-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6155d504786eeb29458fed2286332ce10e5964ad43d9f7fbfe2abcb6ddbf729
|
|
| MD5 |
479fde40682cc98a288233a8e9eb3a79
|
|
| BLAKE2b-256 |
b3bc16d835295b83e77eff11f147a3a5aa823354ea18b9a9915103030ac7ed28
|
File details
Details for the file BinaryOptionsToolsV2-0.1.5-cp311-none-win_amd64.whl.
File metadata
- Download URL: BinaryOptionsToolsV2-0.1.5-cp311-none-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1cd68b2f1c94b0477e73aa6d1568e512b2ec39e3faf2ebca3a7a8e1bded40ce0
|
|
| MD5 |
cc1ba500ff20a527f8f7850648e46104
|
|
| BLAKE2b-256 |
d4569ada5a2e1bf2ee64d38503bef832df40e29eba378f1a60e40dbfeb1ff958
|
File details
Details for the file BinaryOptionsToolsV2-0.1.5-cp310-none-win_amd64.whl.
File metadata
- Download URL: BinaryOptionsToolsV2-0.1.5-cp310-none-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e8ad135ca0a54401bfc59ccad32d7d55d66b84b62036de9fa380f7c3a077672
|
|
| MD5 |
a976a42253c12898c2af7d29e2ec2b13
|
|
| BLAKE2b-256 |
45d66a13050a1c0ae9eebec6ae494eb66fc43a21b3076a928bcb2ceef89508af
|
File details
Details for the file BinaryOptionsToolsV2-0.1.5-cp39-none-win_amd64.whl.
File metadata
- Download URL: BinaryOptionsToolsV2-0.1.5-cp39-none-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e2a5b9b5648b884f251ceae9e45ffacfe27d431d32c8469db4aa7a2f2ed49e0
|
|
| MD5 |
ab898d4c35f4cfbd4f1e0c9f47a1fb25
|
|
| BLAKE2b-256 |
16963913d704299244b82fcfa6950c7de83daa74b910257aa60605c2a4103002
|