Skip to content

Enumerations

adasThePrime edited this page Apr 11, 2026 · 1 revision

Enums Overview

The Pyahoo library defines various Enumeration (Enum) classes to enforce type safety and gurantee valid inputs for endpoints.

For convenience, every REST-based enum in this library natively inherits from str and Enum (effectively a "String Enum").

from pyahoo.enums import *

Behavior & Serialization

Because the enums are subclassed from str, they serialize to their underlying string values automatically. This means you do not need to call .value to exctract the string.

WebSocket Enums

Unlike the REST counterparts which are string-based, the WebSocket streaming payloads utilize Integer Enums mapped directly from Yahoo's protobuf messages.

Clone this wiki locally