FreqSignals Client for Python
Project description
freqsignals-client
FreqSignals client for python! It assists in token management and abstracts the HTTP requests to make it easy to upload or download signals.
Docs
FreqSignalsClient
init
from freqsignals_client import FreqSignalsClient,
client = FreqSignalsClient(
client_id="1234",
client_secret="567890",
)
get_signals
client.get_signals()
Note: Might raise a freqsignals_client.FreqSignalsError
if FreqSignals rejects the request
Note: Might raise a freqsignals_client.FreqSignalsTimeoutError
if the request times out
post_signal
client.post_signal({
"symbol": "BTC",
"value": 0.1,
"ttl_minutes": 60,
"data_set_id": "DATA_SET_ID"
})
logging
To get visibility into logged events, override the log method and log however your app needs to log:
class CustomFreqSignalsClass(FreqSignalsClient):
def log(self, level, msg, **log_variables):
print(f"[{level}] {msg}", log_variables)
client = CustomFreqSignalsClass(client_id, client_secret)
Example
from freqsignals import FreqSignalsClient, FreqSignalsError, FreqSignalsTimeoutError
my_client = FreqSignalsClient("1234", "56-789")
try:
results = my_client.get_signals()
print(results)
except FreqSignalsError:
print("FreqSignals failure")
except FreqSignalsTimeoutError:
print("FreqSignals timed out")
Common Commands:
Black Formatting
$ black freqsignals_client --config freqsignals_client.toml
Build
$ python3 setup.py sdist
Pypi Distribution
$ python3 -m twine upload dist/*
License
FreqSignals Client is MIT licensed.
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 Distribution
Close
Hashes for freqsignals_client-0.0.1-py3.8.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2f1331ce360112d0da45d639f2157469288b18e9e9c37dd8c28da669069e409 |
|
MD5 | f56c90e4b997478b5ac1db76017f4375 |
|
BLAKE2b-256 | c4918d67f3a0a3492b5ba2d1510e885ae15e6c35591ae01091064685dc35b477 |