Skip to main content

A Python library for loading stock data from the Seeking Alpha API

Project description

Stock Data Loader

A Python library for loading stock data from the Seeking Alpha API.

Installation

You can install the Stock Data Loader using pip:

pip install stock-data-loader

How to Use StockDataLoader

The StockDataLoader class provides an easy way to fetch and process stock data from the Seeking Alpha API. Here's a quick guide on how to use it:

  1. Import the class:

    from stock_data_loader import StockDataLoader
    
  2. Create an instance of the loader:

    loader = StockDataLoader()
    
  3. Prepare a list of stock symbols you want to fetch data for:

    symbols = ['AAPL', 'GOOGL', 'MSFT', 'AMZN']
    
  4. Use the load_symbol_data method to fetch and process the data:

    result_df = loader.load_symbol_data(symbols)
    
  5. The result is a pandas DataFrame. You can now work with this data:

    print(result_df)
    

Example:

from stock_data_loader import StockDataLoader

loader = StockDataLoader()
symbols = ['AAPL', 'GOOGL', 'MSFT', 'AMZN']
result_df = loader.load_symbol_data(symbols)

# Print the first few rows of the result
print(result_df.head())

# Save the result to a CSV file
result_df.to_csv('stock_data.csv', index=False)

This will fetch data for the specified symbols, process it, and return a DataFrame with various attributes like symbol, name, follower count, exchange, and content counters for analysis, news, transcripts, etc.

Output Columns

The load_symbol_data method returns a pandas DataFrame with the following columns:

  • id: Unique identifier for the stock
  • type: Type of the data (usually "ticker")
  • symbol: Stock symbol
  • name: Full name of the company
  • followersCount: Number of followers on Seeking Alpha
  • exchange: Stock exchange where the stock is listed
  • analysis: Number of analysis articles
  • related_analysis: Number of related analysis articles
  • transcripts: Number of earnings call transcripts
  • earning_slides: Number of earning slides available
  • news: Number of news articles
  • partnerNews: Number of partner news articles
  • pressReleases: Number of press releases
  • bulls_say: Number of bullish opinions
  • bears_say: Number of bearish opinions
  • investing_groups: Number of investing groups discussing the stock
  • annual_dividends: Number of annual dividend reports
  • annual_earnings_estimates: Number of annual earnings estimates
  • dividend_news: Number of dividend-related news items
  • sec_filings: Number of SEC filings
  • sec_filings_fin_and_news: Number of financial and news-related SEC filings
  • sec_filings_tenders: Number of tender offer SEC filings
  • sec_filings_other: Number of other SEC filings
  • sec_filings_ownership: Number of ownership-related SEC filings
  • sector_rating_change_notices: Number of sector rating change notices
  • sector_quant_warnings: Number of quantitative warnings for the sector
  • sector_dividend_safety_warnings: Number of dividend safety warnings for the sector
  • quarterly_revenue: Number of quarterly revenue reports
  • annual_revenue: Number of annual revenue reports
  • market_open: Market open status
  • market_open_time: Market open time
  • analysis_count: Another count of analysis articles (may differ from analysis)
  • news_count: Another count of news articles (may differ from news)
  • transcripts_count: Another count of transcripts (may differ from transcripts)

Note: Some columns may be empty or have different values than expected due to variations in the API response.

Example Output

Here's a sample of what the output might look like:

print(result_df[['symbol', 'followersCount', 'analysis', 'news', 'sec_filings', 'annual_dividends']].head())
  symbol  followersCount  analysis  news  sec_filings  annual_dividends
0   AAPL        2713202    10037  10753          121                 0
1   TSLA        1151910     5929   5737          121                 0
2  GOOGL         459787     1974   4592           97                 0

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stock_data_loader-0.1.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

stock_data_loader-0.1.4-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file stock_data_loader-0.1.4.tar.gz.

File metadata

  • Download URL: stock_data_loader-0.1.4.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for stock_data_loader-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ea4cdc3b48ec6850faf85745ca66bd4d76ec67faddb12919a74e32cfeea24031
MD5 104f5ac1f7d008f654453780a8cd3361
BLAKE2b-256 0d574c09487f1676cd3afe27056a7ad2361d3797508637fd5e4138654081d2c4

See more details on using hashes here.

File details

Details for the file stock_data_loader-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for stock_data_loader-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 953ae854a4d8810f4be29d12f17ec7888cc0e541469740667be46c03f8732e58
MD5 96cd3c2dcf203d81ec5d4f4df5748def
BLAKE2b-256 3040a8e5890a676471f992d9cf6e080c5f0c21707bb6de05d0b0df63178770a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page