Skip to main content

Connect to sphoin.app Pro Slots

Project description

drawing

PyPI PyPI

Connect to sphoin.app Pro Slots.

drawing

Installation

Stable release

To install sphoin, run this command in your terminal:

pip install sphoin

This is the preferred method to install sphoin, as it will always install the most recent stable release.

From sources

The sources for sphoin can be downloaded from the Github repo.

  • clone the public repository
git clone https://github.com/Parsecom/sphoin
  • install from source
python setup.py install

Docker

docker pull pom11/sphoin

.yaml config file

---
uid: 111YOURUID111
api-key: 111YOURAPIKEY111
api-secret: 111YOURSECRET111
layout:
  - line
  - time
  - signals
  - studies
  - footer
  

In layout specifies what Plots should be displayed

  • line - Price graph
  • time - Time bar
  • signals - Signals sum graph
  • studies - Studies bars
  • footer - Footer with Slot details

Usage

TUI key bindings

  • h - Help sidebar
  • r - Refresh Slot data
  • t - Toggle theme
  • s - Signals theme
  • b - Toggle brightness
  • q - Quit

CLI

sphoin --help

View example

sphoin --example

Load config file

sphoin --config config.yaml

Print Plot test

sphoin --plot
sphoin.plot

Docker

Pull image from docker hub

docker pull pom11/sphoin

To run sphoin TUI with config file in docker you need to mount local directory to /usr/src/app

docker run -v ${PWD}/config.yaml:/usr/src/app/config.yaml -it pom11/sphoin -c config.yaml

Python

Import package

from sphoin.app import Slot

Slot from keys

my_slot = Slot.from_keys(uid="111YOURUID111",
      api_key="111YOURAPIKEY111",
      api_secret="111YOURSECRET111")

Slot from config file

my_slot = Slot.from_config(file="/absolute/path/of/config.yaml")

Slot from dict

Obtain dict from https://api.sphoin.app/api/v1/data/json endpoint

import requests

url = "https://api.sphoin.app/api/v1/data/json"

payload = "{\n    \"uid\": \"111YOURUID111\",\n    \"api-key\": \"111YOURAPIKEY111\",\n    \"api-secret\": \"111YOURSECRET111\"\n}"
headers = {
  'X-sphoin.app': 'LIadeCyi15FAwoRBkiu9fJsYPvWecSxb'
}

response = requests.request("POST", url, headers=headers, data=payload)

json = response.json()

Init Slot from obtained result

my_slot = Slot.from_dict(data=json)

Inspect Slot

from rich import print
from rich import inspect

print(my_slot.json)
# insepct slot attributes
print(my_slot.__doc__)
print(inspect(my_slot,all=True))

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

sphoin-2.0.12.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

sphoin-2.0.12-py3-none-any.whl (22.9 kB view details)

Uploaded Python 3

File details

Details for the file sphoin-2.0.12.tar.gz.

File metadata

  • Download URL: sphoin-2.0.12.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.8.3 requests/2.28.1 setuptools/65.6.3 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.7.13

File hashes

Hashes for sphoin-2.0.12.tar.gz
Algorithm Hash digest
SHA256 0133c3951705c1e4e5fbb199c26c16904eae9a475433781a8639d9613d59ba9f
MD5 58f79b50d8a894399d5005d68f630ae2
BLAKE2b-256 052a20471f48e73b42f7341b69d62c4a031fba567ab15e1ed3bf3a954ef93a02

See more details on using hashes here.

File details

Details for the file sphoin-2.0.12-py3-none-any.whl.

File metadata

  • Download URL: sphoin-2.0.12-py3-none-any.whl
  • Upload date:
  • Size: 22.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.8.3 requests/2.28.1 setuptools/65.6.3 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.7.13

File hashes

Hashes for sphoin-2.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 a3b3db293d217fe75cf9ccebe4694e781a93178486c004a008ed4abd6f53bef4
MD5 fed747a9ad34776890cda3b484c266ab
BLAKE2b-256 b780fe5085385ca69056191bdc7c4b7dee6f1801029433487402fa080a95ed9a

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