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 details)

Uploaded Source

File details

Details for the file freqsignals-client-0.1.2.tar.gz.

File metadata

  • Download URL: freqsignals-client-0.1.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for freqsignals-client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 910e5479e0e7f0d695f67d1419dbb8fd522fd52c9bb1cbe4eb8d27a618719210
MD5 626e55b2c296df678802284c467df63b
BLAKE2b-256 7a434eb4239fb4eed0a1d5cd1121cca3f8572c46203a3aa1717072ce28220722

See more details on using hashes here.

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