This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Decimal や datetime の入った JSON 風オブジェクトを loguru 向けにダンプして出力するクラス | |
""" | |
import datetime | |
import json | |
from decimal import Decimal | |
from typing import Any | |
import requests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import hmac | |
import json | |
import time | |
import urllib.parse | |
from threading import Thread | |
from collections import deque | |
from requests import Request, Session | |
from requests.exceptions import HTTPError |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eux | |
docker run --rm -it \ | |
-u vscode \ | |
-w /home/vscode \ | |
mcr.microsoft.com/devcontainers/python:0-${1:-3.11-bullseye} \ | |
bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socketio | |
sio = socketio.Client() | |
usdjpy = {} | |
@sio.event | |
def connect(): | |
sio.emit("subscribe", "USDJPY") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from typing import List | |
import pybotters | |
import streamlit as st | |
async def watch_event( | |
store: pybotters.BybitUSDTDataStore, name: str, result: List, event: asyncio.Event | |
): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import os | |
import sys | |
import aiohttp | |
from loguru import logger | |
logger.remove() | |
logger.add( | |
sys.stdout, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http.client | |
import json | |
import urllib.request | |
resp: http.client.HTTPResponse | |
with urllib.request.urlopen('https://api.bybit.com/v2/public/symbols') as resp: | |
data = json.loads(resp.read().decode()) | |
print(*filter(lambda x: all([x['name'] != x['alias'], x['status'] == 'Trading']), data['result']), sep='\n\n') |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.