This file contains hidden or 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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 datetime | |
| import itertools | |
| import pybotters | |
| apis = {"bybit_testnet": ["API_KEY", "API_SECRET"]} | |
| TESTNET_BASE_URL = "https://api-testnet.bybit.com" | |
| TESTNET_PUBLIC_WSURL = "wss://stream-testnet.bybit.com/v5/public/linear" |
This file contains hidden or 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
| """ | |
| Sample of connecting to Socket.IO v2 WebSocket in bitbank with pybotters | |
| """ | |
| import asyncio | |
| import pybotters | |
| async def main(): | |
| async with pybotters.Client() as client: |
This file contains hidden or 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 hidden or 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 requests | |
| r = requests.get( | |
| "https://widget.oanda.jp/api/ohlc-rate?instrument=USD_JPY", | |
| headers={"x-oanda-widget-api": "ohlc-rate"}, | |
| ) | |
| ohlc = r.json() | |
| print(ohlc) |
This file contains hidden or 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 time | |
| import httpx | |
| async def main(): | |
| for use_http2 in (False, True): | |
| async with httpx.AsyncClient( | |
| base_url="https://api.bitflyer.com", http2=use_http2 |
This file contains hidden or 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
| site_name: "pybotters Docs" | |
| nav: | |
| - "Introduction": "README.md" | |
| - "Usage": | |
| - "QuickStart": "Home.md" | |
| - "Advanced Usage": "Advanced-Usage.md" | |
| - "Guides": | |
| - "Exchanges": "Exchanges.md" | |
| - "Example": "Example.md" |
This file contains hidden or 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
| # generated by datamodel-codegen: | |
| # filename: https://github.com/binance/binance-api-swagger/raw/master/spot_api.yaml | |
| # timestamp: 2024-01-22T15:18:47+00:00 | |
| from __future__ import annotations | |
| from typing import List, Optional | |
| from pydantic import BaseModel, Field, RootModel |
This file contains hidden or 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 json | |
| import logging | |
| from contextlib import AsyncExitStack | |
| import websockets | |
| logger = logging.getLogger("websockets.client") | |
| logger.setLevel(logging.DEBUG) | |
| ch = logging.StreamHandler() |