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

import edgar
company = edgar.Company("Oracle Corp", "0001341439")
tree = company.getAllFilings(filingType = "10-K")
docs = edgar.getDocuments(tree, noOfDocuments=5)

To get all companies and find a specific one, run

import edgar
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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

edgar-1.0.0-py2.py3-none-any.whl (5.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file edgar-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for edgar-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cbbf884ce00105412bdd0192f7b72f24788d72450e48fab7b86316c47b9dd7f3
MD5 1d6a1f936a6d0f30319697a054882b5c
BLAKE2b-256 6786098ff567d108c41eb1d123472ad6d4d9e22fcea65b00beb0fd8bb482bb4b

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