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.getAllFilings(filingType = "10-K")
docs = edgar.getDocuments(tree, noOfDocuments=5)

or

from edgar import Company, TXTML

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

To get all companies and find a specific one, run

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

API

Company

The Company class has two fields:

  • name (company name)

  • cik (company CIK number)

getFilingsUrl

Returns a url to fetch filings data

  • Input

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

    • priorTo: 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.

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

getAllFilings

Returns the HTML in the form of lxml.html

  • Input

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

    • priorTo: 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.

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

Edgar

Gets all companies from EDGAR

getCikByCompanyName

  • Input

    • name: name of the company

getCompanyNameByCik

  • Input

    • cik: cik of the company

findCompanyName

  • Input

    • words: input words to search the company

getDocuments

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

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

Release Notes

0.3.0

  • Added findCompanyName to Edgar

0.2.0

  • Added Edgar

0.1.0

  • First release

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-2.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

edgar-2.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: edgar-2.0.0.tar.gz
  • Upload date:
  • Size: 3.7 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-2.0.0.tar.gz
Algorithm Hash digest
SHA256 684d1558d15cbf7f9ef8b71a838c09b6652b3e197e45b9ffdd6c7b09e3867d8d
MD5 e0415fb8fdfeb9c7bc7fef15137c0f3d
BLAKE2b-256 ebe2deed191cfbe45b6492f0a7dd1e29f731c4955a41634410b1214202632d2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: edgar-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.6 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-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90c31163f432909434e1e158d4c9abc74e3460d0d4e581d85afe47f11b5d825d
MD5 df745b8d369ab7a37adba6f41725e530
BLAKE2b-256 02d81f26c55ab1180489d6a3c662ee701baffe90e9561d604164187beb7373a2

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