Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] openbb-sec & openbb-regulators: Add New Path: regulators.sec.filing_headers #7034

Merged
merged 11 commits into from
Feb 24, 2025

Conversation

deeleeramone
Copy link
Contributor

@deeleeramone deeleeramone commented Feb 17, 2025

  1. Why?:

    • We need a reliable way to open any filing and read the associated metadata, and parse it for URLs to the attachments.
  2. What?:

    • Adds endpoint:

      • obb.regulators.sec.filing_headers
        • Accepts a URL as input.
        • Optional use_cache to avoid downloading the same files repeatedly (they will never change)
    • An importable worker model can be used independently:

      • from openbb_sec.models.sec_filing import SecBaseFiling
      • This contains all the same fields and params as the endpoint and returned data, but here they are computed_fields and there are methods handling the I/O and parsing.
      • SecBaseFiling will be used as the base class for future functionality, like 10-K/Q
    • Adds endpoint:

      • obb.regulators.sec.htm_file
        • Accepts a URL as input.
        • Returns the raw HTM/HTML string object.
  3. Impact:

    • Improves the general functionality by providing tooling to do low-level work on SEC filings.
    • As a Workspace widget, the data is only the list of attachments.
    • This endpoint can be used to get the list of "Notes Due" for a company.
  4. Testing Done:

    • Try it with literally any, or component of, filing's URL

Note: Parts of the widget implementation will not work until #7030 is merged/published.

res = obb.regulators.sec.filing_headers(url="https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/e24475_ko-8k.htm")

Workspace Widget:

Screenshot 2025-02-17 at 9 37 19 AM Screenshot 2025-02-20 at 8 49 24 PM
res.results.model_dump()
{'base_url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/',
 'name': 'COCA COLA CO',
 'cik': '0000021344',
 'trading_symbols': ['KO',
  'KO26',
  'KO26C',
  'KO27',
  'KO29A',
  'KO29B',
  'KO30B',
  'KO31',
  'KO32',
  'KO33',
  'KO33A',
  'KO35',
  'KO36',
  'KO36A',
  'KO37',
  'KO40B',
  'KO41',
  'KO44',
  'KO53'],
 'sic': 'BEVERAGES [2080]',
 'sic_organization_name': '04 Manufacturing',
 'filing_date': datetime.date(2024, 12, 16),
 'period_ending': datetime.date(2024, 12, 13),
 'fiscal_year_end': '12-31',
 'document_type': '8-K',
 'has_cover_page': True,
 'description': 'Departure of Directors or Certain Officers; Election of Directors; Appointment of Certain Officers; Financial Statements and Exhibits',
 'cover_page': {'Document Type': '8-K',
  'Amendment Flag': 'false',
  'Document Period End Date': 'Dec. 13, 2024',
  'Entity File Number': '001-02217',
  'Entity Registrant Name': 'COCA COLA CO',
  'Entity Central Index Key': '0000021344',
  'Entity Tax Identification Number': '58-0628465',
  'Entity Incorporation, State or Country Code': 'DE',
  'Entity Address, Address Line One': 'One  Coca-Cola Plaza',
  'Entity Address, City or Town': 'Atlanta',
  'Entity Address, State or Province': 'GA',
  'Entity Address, Postal Zip Code': '30313',
  'City Area Code': '(404)',
  'Local Phone Number': '676-2121',
  'Written Communications': 'false',
  'Soliciting Material': 'false',
  'Pre-commencement Tender Offer': 'false',
  'Pre-commencement Issuer Tender Offer': 'false',
  'Entity Emerging Growth Company': 'false',
  'SIC': 'BEVERAGES [2080]',
  'SIC Organization Name': '04 Manufacturing',
  '12(b) Securities': [{'Title': 'Common  Stock, $0.25 Par Value',
    'Symbol': 'KO',
    'Exchange': 'NYSE'},
   {'Title': '1.875%  Notes Due 2026', 'Symbol': 'KO26', 'Exchange': 'NYSE'},
   {'Title': '0.750%  Notes Due 2026', 'Symbol': 'KO26C', 'Exchange': 'NYSE'},
   {'Title': '1.125%  Notes Due 2027', 'Symbol': 'KO27', 'Exchange': 'NYSE'},
   {'Title': '0.125%  Notes Due 2029', 'Symbol': 'KO29B', 'Exchange': 'NYSE'},
   {'Title': '0.400%  Notes Due 2030', 'Symbol': 'KO30B', 'Exchange': 'NYSE'},
   {'Title': '1.250%  Notes Due 2031', 'Symbol': 'KO31', 'Exchange': 'NYSE'},
   {'Title': '3.125% Notes Due 2032', 'Symbol': 'KO32', 'Exchange': 'NYSE'},
   {'Title': '0.375%  Notes Due 2033', 'Symbol': 'KO33', 'Exchange': 'NYSE'},
   {'Title': '0.500%  Notes Due 2033', 'Symbol': 'KO33A', 'Exchange': 'NYSE'},
   {'Title': '1.625%  Notes Due 2035', 'Symbol': 'KO35', 'Exchange': 'NYSE'},
   {'Title': '1.100%  Notes Due 2036', 'Symbol': 'KO36', 'Exchange': 'NYSE'},
   {'Title': '0.950%  Notes Due 2036', 'Symbol': 'KO36A', 'Exchange': 'NYSE'},
   {'Title': '3.375% Notes Due 2037', 'Symbol': 'KO37', 'Exchange': 'NYSE'},
   {'Title': '0.800%  Notes Due 2040', 'Symbol': 'KO40B', 'Exchange': 'NYSE'},
   {'Title': '1.000%  Notes Due 2041', 'Symbol': 'KO41', 'Exchange': 'NYSE'},
   {'Title': '3.500% Notes Due 2044', 'Symbol': 'KO44', 'Exchange': 'NYSE'},
   {'Title': '3.750% Notes Due 2053', 'Symbol': 'KO53', 'Exchange': 'NYSE'}]},
 'document_urls': [{'type': '8-K',
   'sequence': '1',
   'filename': 'e24475_ko-8k.htm',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/e24475_ko-8k.htm'},
  {'type': 'EX-99.1',
   'sequence': '2',
   'filename': 'e24475_ex99-1.htm',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/e24475_ex99-1.htm'},
  {'type': 'GRAPHIC',
   'sequence': '3',
   'filename': 'ko_logo.jpg',
   'description': 'GRAPHIC',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/ko_logo.jpg'},
  {'type': 'EX-101.SCH',
   'sequence': '4',
   'filename': 'ko-20241213.xsd',
   'description': 'XBRL SCHEMA FILE',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/ko-20241213.xsd'},
  {'type': 'EX-101.DEF',
   'sequence': '5',
   'filename': 'ko-20241213_def.xml',
   'description': 'XBRL DEFINITION FILE',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/ko-20241213_def.xml'},
  {'type': 'EX-101.LAB',
   'sequence': '6',
   'filename': 'ko-20241213_lab.xml',
   'description': 'XBRL LABEL FILE',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/ko-20241213_lab.xml'},
  {'type': 'EX-101.PRE',
   'sequence': '7',
   'filename': 'ko-20241213_pre.xml',
   'description': 'XBRL PRESENTATION FILE',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/ko-20241213_pre.xml'},
  {'type': 'XML',
   'sequence': '9',
   'filename': 'R1.htm',
   'description': 'IDEA: XBRL DOCUMENT',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/R1.htm'},
  {'type': 'EXCEL',
   'sequence': '10',
   'filename': 'Financial_Report.xlsx',
   'description': 'IDEA: XBRL DOCUMENT',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/Financial_Report.xlsx'},
  {'type': 'XML',
   'sequence': '11',
   'filename': 'Show.js',
   'description': 'IDEA: XBRL DOCUMENT',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/Show.js'},
  {'type': 'XML',
   'sequence': '12',
   'filename': 'report.css',
   'description': 'IDEA: XBRL DOCUMENT',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/report.css'},
  {'type': 'XML',
   'sequence': '14',
   'filename': 'FilingSummary.xml',
   'description': 'IDEA: XBRL DOCUMENT',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/FilingSummary.xml'},
  {'type': 'JSON',
   'sequence': '16',
   'filename': 'MetaLinks.json',
   'description': 'IDEA: XBRL DOCUMENT',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/MetaLinks.json'},
  {'type': 'ZIP',
   'sequence': '17',
   'filename': '0001552781-24-000634-xbrl.zip',
   'description': 'IDEA: XBRL DOCUMENT',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/0001552781-24-000634-xbrl.zip'},
  {'type': 'XML',
   'sequence': '18',
   'filename': 'e24475_ko-8k_htm.xml',
   'description': 'IDEA: XBRL DOCUMENT',
   'url': 'https://www.sec.gov/Archives/edgar/data/21344/000155278124000634/e24475_ko-8k_htm.xml'}]}

@deeleeramone deeleeramone added enhancement Enhancement platform OpenBB Platform v4 PRs for v4 labels Feb 17, 2025
@piiq piiq added this pull request to the merge queue Feb 24, 2025
Merged via the queue into develop with commit b1863e5 Feb 24, 2025
10 checks passed
@deeleeramone deeleeramone deleted the feature/sec-filing-headers branch March 5, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement platform OpenBB Platform v4 PRs for v4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants