alpacahq/alpaca-py — reverse-engineered prompt

Reverse engineered prompt

Build me a clean Python SDK for Alpaca that makes it easy to work with their trading, market data, and broker features from one library. I want it to feel official and polished, with simple client classes for things like placing stock and crypto trades, getting historical and live market data, streaming updates over WebSocket or server sent events, and handling broker account workflows.

Please make the API object based, so people create request objects instead of passing around loose dictionaries, and include solid runtime validation for request and response data. It should support paper or sandbox keys as well as live keys, and cover the main asset types mentioned in the docs, including stocks, crypto, options, and news where available.

Also include clear examples, basic docs, and tests so someone can quickly understand how to fetch bars, stream quotes, submit orders, and list broker accounts. Keep the codebase organized and production ready. If anything is unclear, look up the current Alpaca Python SDK and API docs online and match that behavior closely.

Want more depth? Deep Reverse