Skip to main content

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.

Install

pip install freqsignals-client

Docs

FreqSignalsClient

init

from freqsignals_client import FreqSignalsClient,
client = FreqSignalsClient(
    client_id="1234",
    client_secret="567890",
)

get_signals

see documentation

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

see documentation

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

freqsignals-client-0.1.2.tar.gz (4.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page