
Security News
Critical Security Vulnerability in React Server Components
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.
fugle-marketdata
Advanced tools
Fugle MarketData API client library for Python
$ pip install fugle-marketdata
from fugle_marketdata import WebSocketClient, RestClient
The library is an isomorphic Python client that supports REST API and WebSocket.
client = RestClient(api_key = 'YOUR_API_KEY')
stock = client.stock # Stock REST API client
print(stock.intraday.quote(symbol="2330"))
from fugle_marketdata import WebSocketClient, RestClient
def handle_message(message):
print(f'message: {message}')
def handle_connect():
print('connected')
def handle_disconnect(code, message):
print(f'disconnect: {code}, {message}')
def handle_error(error):
print(f'error: {error}')
def main():
client = WebSocketClient(api_key='YOUR_API_KEY')
stock = client.stock
stock.on("connect", handle_connect)
stock.on("message", handle_message)
stock.on("disconnect", handle_disconnect)
stock.on("error", handle_error)
stock.connect()
stock.subscribe({
"channel": 'trades',
"symbol": '2330'
})
if __name__ == "__main__":
main()
The library provides a custom FugleAPIError exception for API-related errors, which includes detailed debugging information.
from fugle_marketdata import RestClient, FugleAPIError
client = RestClient(api_key='YOUR_API_KEY')
try:
data = client.stock.intraday.quote(symbol="2330")
except FugleAPIError as e:
# Access error details for debugging
print(f"Error: {e.message}")
print(f"URL: {e.url}")
print(f"Status Code: {e.status_code}")
print(f"Request Params: {e.params}")
print(f"Response: {e.response_text}")
The FugleAPIError exception provides the following attributes:
message: Error descriptionurl: The API endpoint that was calledstatus_code: HTTP status code (if available)params: Request parameters that were sentresponse_text: Raw response text from the API (truncated to 200 chars)HTTP Errors (4xx, 5xx):
try:
data = client.stock.intraday.quote(symbol="INVALID_SYMBOL")
except FugleAPIError as e:
if e.status_code == 404:
print("Symbol not found")
elif e.status_code >= 500:
print("Server error, please try again later")
Network Errors:
try:
data = client.stock.intraday.quote(symbol="2330")
except FugleAPIError as e:
if e.status_code is None:
print("Network error occurred")
FAQs
Fugle Realtime API 1.0 client library for Python
We found that fugle-marketdata demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
React disclosed a CVSS 10.0 RCE in React Server Components and is advising users to upgrade affected packages and frameworks to patched versions now.

Research
/Security News
We spotted a wave of auto-generated “elf-*” npm packages published every two minutes from new accounts, with simple malware variants and early takedowns underway.

Security News
TypeScript 6.0 will be the last JavaScript-based major release, as the project shifts to the TypeScript 7 native toolchain with major build speedups.