Skip to main content

The Tesseract Pro Python API

Project description

Tesseract Pro Python API

-- This project is under active development. Please do not use in production before version 1.0.0 --

Example

Get visible tools for current chart

import time
from tesseractpro import TesseractPro

tpro = TesseractPro(
    api_token="Your-API-token"
)

candles = 100  # the amount of candles to fetch
chart = tpro.get_chart(
    space_id="cb0c8e03-62c6-4a1c-a872-18ed1c4c8f96",
    symbol="btcusdt",
    timeframe=32,
    start_time=int(time.time()),
    end_time=int(time.time()) - (32*60*candles)
)

for tool in chart.get_tools():
    print(f"Tool: {tool['id']} is {tool['type']})

Get OHLC candles for the timeframe of the current chart

import time
from tesseractpro import TesseractPro

tpro = TesseractPro(
    api_token="[YOUR-API-TOKEN]"
)

candles = 100  # the amount of candles to fetch
chart = tpro.get_chart(
    space_id="[SPACE-ID]",
    symbol="btcusdt",
    timeframe=32,
    start_time=int(time.time()),
    end_time=int(time.time()) - (32*60*candles)
)

print(chart.get_candles())

Fetch BTCUSDT prices

import time
from tesseractpro import TesseractPro

tpro = TesseractPro(
    api_token="[YOUR-API-TOKEN]"
)

candles = 100  # the amount of candles to fetch
chart = tpro.get_chart(
    space_id="[SPACE-ID]",
    symbol="btcusdt",
    timeframe=32,
    start_time=int(time.time()),
    end_time=int(time.time()) - (32*60*candles)
)

chart.on(chart.ON_PRICE, lambda data: print(data))

chart.wait_for_events()

Watch for tool updates on BTCUSDT 32min chart

import time
from tesseractpro import TesseractPro

tpro = TesseractPro(
    api_token="[YOUR-API-TOKEN]"
)

candles = 100  # the amount of candles to fetch
chart = tpro.get_chart(
    space_id="[SPACE-ID]",
    symbol="btcusdt",
    timeframe=32,
    start_time=int(time.time()),
    end_time=int(time.time()) - (32*60*candles)
)

chart.on(chart.ON_TOOL_UPDATE, lambda data: print(f"Updated tool {data['id']}"))

chart.wait_for_events()

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

tesseractpro-0.1.4.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tesseractpro-0.1.4-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file tesseractpro-0.1.4.tar.gz.

File metadata

  • Download URL: tesseractpro-0.1.4.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for tesseractpro-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1b4385b2145077f8519ed24b1f82adbc5867353c7977404bd44b3ff564057632
MD5 1ab3f4d6457df78ca79a4e88f74dd07d
BLAKE2b-256 8fcec8d78757ddb5016992a743335c689b8e66b0a72041accb28c55360aa4007

See more details on using hashes here.

File details

Details for the file tesseractpro-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: tesseractpro-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for tesseractpro-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 32b61cc07c2d1b733f5e1cddc2a7ac87fd1653e484b5ebf5c8fe8e4b67b807ee
MD5 9d2b6b0b91aa9816bdcc43b8017fba46
BLAKE2b-256 7289d513d852ce0976f329e8a5afeca6d19551e163bd079b42c5c62ae8d2f499

See more details on using hashes here.

Supported by

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