How mcdallas/wallstreet works
Main components
• Wallstreet Library Core:
• The main package “wallstreet” holds the primary modules:
▪ wallstreet.py – likely the core API interface that instantiates Stock, Call, and Put objects.
▪ blackandscholes.py – module dedicated to computing option pricing using the Black-Scholes model.
▪ constants.py – contains constant values (perhaps including configuration like API URLs or financial constants).
• External Data Sources:
• Google Finance API: The primary source for stock and option quotes.
• Yahoo Finance (optional): Used when specified by the user.
• US Treasury Website: Provides risk-free rate details.
• Testing Infrastructure:
• The “tests” folder includes a “mockrequests” module used for simulating HTTP requests and responses for testing purposes.
Relationships and interactions
• The client’s code (as shown in the README usage examples) imports the Wallstreet API and instantiates Stock, Call, or Put objects.
• These objects internally use modules such as:
▪ data fetchers that query external APIs (Google/Yahoo Finance) and scrape the Treasury website.
▪ computational modules (like blackandscholes) for calculating option pricing and Greeks.
▪ constants to maintain configuration/settings.
• The testing modules (especially the mockrequests in tests) intercept or simulate external data calls to ensure the library’s reliability in various scenarios.
Architectural patterns and design principles
• Separation of concerns: Distinct modules for data fetching, computation (e.g., Black-Scholes), and configuration ensure maintainability.
• Modular design: Clearly separated packages (core functionality vs. testing) improve extensibility and readability.
• Dependency abstraction: Use of mocks in the tests indicates an emphasis on isolating external dependencies during testing.
Relevant technologies and libraries
• Python 3 is the target environment.
• Utilization of the Google Finance API, Yahoo Finance, and likely standard libraries for web scraping.
• Pandas support for downloading and representing historical data in DataFrame format.
Detailed explanation for the principal software engineer
• Sketch a central block labeled “Wallstreet Library” subdivided into:
▪ API Layer (wallstreet.py)
▪ Computation Layer (blackandscholes.py)
▪ Configuration Layer (constants.py)
• Off to one side, include a block for “External Data Sources” that includes nodes for “Google Finance API”, “Yahoo Finance (optional)”, and “US Treasury Website”.
• Modularity and the minimal user input design: the user makes a call to get a stock or option object and the internal components automatically perform the necessary calculations and data pulling.