Skip to main content

Scrape data from SEC's EDGAR

Project description

A small library to access files from SEC’s edgar.

Installation

pip install edgar

Example

To get a company’s latest 5 10-Ks, run

from edgar import Company
company = Company("Oracle Corp", "0001341439")
tree = company.get_all_filings(filing_type = "10-K")
docs = edgar.get_documents(tree, no_of_documents=5)

or

from edgar import Company, TXTML

company = Company("INTERNATIONAL BUSINESS MACHINES CORP", "0000051143")
doc = company.get_10K()
text = TXTML.parse_full_10K(doc)

To get all companies and find a specific one, run

from edgar import Edgar
edgar = Edgar()
possible_companies = edgar.find_company_name("Cisco System")

API

Company

The Company class has two fields:

  • name (company name)

  • cik (company CIK number)

get_filings_url

Returns a url to fetch filings data

  • Input

    • filing_type: The type of document you want. i.e. 10-K, S-8, 8-K. If not specified, it’ll return all documents

    • prior_to: Time prior which documents are to be retrieved. If not specified, it’ll return all documents

    • ownership: defaults to include. Options are include, exclude, only.

    • no_of_entries: defaults to 100. Returns the number of entries to be returned. Maximum is 100.

get_all_filings

Returns the HTML in the form of lxml.html

  • Input

    • filing_type: The type of document you want. i.e. 10-K, S-8, 8-K. If not specified, it’ll return all documents

    • prior_to: Time prior which documents are to be retrieved. If not specified, it’ll return all documents

    • ownership: defaults to include. Options are include, exclude, only.

    • no_of_entries: defaults to 100. Returns the number of entries to be returned. Maximum is 100.

Edgar

Gets all companies from EDGAR

get_cik_by_company_name

  • Input

    • name: name of the company

get_company_name_by_cik

  • Input

    • cik: cik of the company

find_company_name

  • Input

    • words: input words to search the company

get_documents

Returns a list of strings, each string contains the body of the specified document from input

  • Input

    • tree: lxml.html form that is returned from Company.getAllFilings

    • no_of_documents: number of document returned. If it is 1, the returned result is just one string, instead of a list of strings. Defaults to 1.

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

edgar-3.0.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edgar-3.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file edgar-3.0.0.tar.gz.

File metadata

  • Download URL: edgar-3.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for edgar-3.0.0.tar.gz
Algorithm Hash digest
SHA256 60172dc417b14b8c2885280e47a9c594b12e3d5e50b47fccf406ad2697488915
MD5 77adcde5c793b25b4245bc6a2460c954
BLAKE2b-256 40b68edf05ecfb2a0d5257f123c5a9284a592762f10353057ee157ee69745b18

See more details on using hashes here.

File details

Details for the file edgar-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: edgar-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.8

File hashes

Hashes for edgar-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa64a1f7161f3d88d82acd0f5c7688069e9adb2a2bc9d94c36e1275bedc97610
MD5 a3d32d9f6dae8ea6178cf5167eb30438
BLAKE2b-256 71ea4b8469e9107cb4a7d2b70045e9c3260ad5554b447fc9901f6c4ded2c6105

See more details on using hashes here.

Supported by

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