5858)
5959
6060
61- class AsyncRateLimiter :
61+ class RateLimiter :
6262 """Simple async rate limiter using sliding window."""
6363
6464 def __init__ (self , max_requests : int , window_seconds : int ):
@@ -90,7 +90,7 @@ async def acquire(self) -> None:
9090 self .requests .append (now )
9191
9292
93- class AsyncProjectX :
93+ class ProjectX :
9494 """
9595 Async core ProjectX client for the ProjectX Python SDK.
9696
@@ -127,10 +127,10 @@ class AsyncProjectX:
127127 Example:
128128 >>> # Basic async SDK usage with environment variables (recommended)
129129 >>> import asyncio
130- >>> from project_x_py import AsyncProjectX
130+ >>> from project_x_py import ProjectX
131131 >>>
132132 >>> async def main():
133- >>> async with AsyncProjectX .from_env() as client:
133+ >>> async with ProjectX .from_env() as client:
134134 >>> await client.authenticate()
135135 >>> positions = await client.get_positions()
136136 >>> print(f"Found {len(positions)} positions")
@@ -191,11 +191,11 @@ def __init__(
191191 self .cache_hit_count = 0
192192
193193 # Rate limiting - 100 requests per minute by default
194- self .rate_limiter = AsyncRateLimiter (max_requests = 100 , window_seconds = 60 )
194+ self .rate_limiter = RateLimiter (max_requests = 100 , window_seconds = 60 )
195195
196196 self .logger = logging .getLogger (__name__ )
197197
198- async def __aenter__ (self ) -> "AsyncProjectX " :
198+ async def __aenter__ (self ) -> "ProjectX " :
199199 """Async context manager entry."""
200200 self ._client = await self ._create_client ()
201201 return self
@@ -210,7 +210,7 @@ async def __aexit__(self, exc_type, exc_val, exc_tb):
210210 @asynccontextmanager
211211 async def from_env (
212212 cls , config : ProjectXConfig | None = None , account_name : str | None = None
213- ) -> AsyncGenerator ["AsyncProjectX " , None ]:
213+ ) -> AsyncGenerator ["ProjectX " , None ]:
214214 """
215215 Create async ProjectX client using environment variables (recommended approach).
216216
@@ -229,7 +229,7 @@ async def from_env(
229229 account_name: Optional account name (overrides environment variable)
230230
231231 Yields:
232- AsyncProjectX : Configured async client instance ready for building trading applications
232+ ProjectX : Configured async client instance ready for building trading applications
233233
234234 Raises:
235235 ValueError: If required environment variables are not set
@@ -245,10 +245,10 @@ async def from_env(
245245 >>>
246246 >>> # Create async client (recommended approach)
247247 >>> import asyncio
248- >>> from project_x_py import AsyncProjectX
248+ >>> from project_x_py import ProjectX
249249 >>>
250250 >>> async def main():
251- >>> async with AsyncProjectX .from_env() as client:
251+ >>> async with ProjectX .from_env() as client:
252252 >>> await client.authenticate()
253253 >>> # Use the client...
254254 >>>
@@ -275,7 +275,7 @@ async def from_env(
275275 @asynccontextmanager
276276 async def from_config_file (
277277 cls , config_file : str , account_name : str | None = None
278- ) -> AsyncGenerator ["AsyncProjectX " , None ]:
278+ ) -> AsyncGenerator ["ProjectX " , None ]:
279279 """Create async ProjectX client using a configuration file.
280280
281281 Alternative initialization method that loads configuration and credentials
@@ -294,7 +294,7 @@ async def from_config_file(
294294 specified in the config file.
295295
296296 Yields:
297- AsyncProjectX : Configured client instance ready for trading operations
297+ ProjectX : Configured client instance ready for trading operations
298298
299299 Raises:
300300 FileNotFoundError: If config file doesn't exist
@@ -312,7 +312,7 @@ async def from_config_file(
312312 ... }
313313 >>>
314314 >>> # Use client with config file
315- >>> async with AsyncProjectX .from_config_file("config.json") as client:
315+ >>> async with ProjectX .from_config_file("config.json") as client:
316316 ... await client.authenticate()
317317 ... # Client is ready for trading
318318
0 commit comments