finsec
Download historical filing data directly from the United States (U.S.) Securities Exchange Commission (SEC).
Blogs
Check out the following blog post for a detailed tutorial on how finsec has been used to aid with analysing the performance of some of the world's most prestigious hedge funds:
Unravelling investment fund manager strategies through 13f SEC filings.
Quickstart
Review 13F filings for Berkshire Hathaway CIK 0001067983
import finsec
filing = finsec.Filing('0001067983') # Optional declared user variable can be input here (e.g. declared_user="Joe Blog Joe.Blog@gmail.com")
# Return the latest 13F reported holdings for Berkshire Hathaway.
print(filing.latest_13f_filing)
Output:
| Name of issuer | Title of class | CUSIP | Share or principal type | Holding value | Share or principal amount count | |
|---|---|---|---|---|---|---|
| 0 | ACTIVISION BLIZZARD INC | COM | 00507V109 | SH | 4470946000 | 60141866 |
| 1 | ALLY FINL INC | COM | 02005N100 | SH | 834901000 | 30000000 |
| 2 | AMAZON COM INC | COM | 023135106 | SH | 1205258000 | 10666000 |
Note: Using the latest_13f_filing function will return the the latest "simplified" version of the 13F Information Table, this works well in most instances... However, there are some who may want to have a more detailed breakdown of the filing. Such as, which investment manager was responsible for investing in the security and the voting authority type granted. This can be handled with the function latest_13f_filing_detailed (below).
# Return the latest detailed 13F reported holdings for Berkshire Hathaway.
print(filing.latest_13f_filing_detailed)
Output:
| Name of issuer | Title of class | CUSIP | Holding value | Share or principal type | Share or principal amount count | Put or call | Investment discretion | Other manager | Voting authority sole count | Voting authority shared count | Voting authority none count | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | ACTIVISION BLIZZARD INC | COM | 00507V109 | 1906458000 | SH | 25645116 | DFND | 4,8,11 | 25645116 | 0 | 0 | |
| 1 | ACTIVISION BLIZZARD INC | COM | 00507V109 | 85095000 | SH | 1144672 | DFND | 4,10 | 1144672 | 0 | 0 | |
| 2 | ACTIVISION BLIZZARD INC | COM | 00507V109 | 2479393000 | SH | 33352078 | DFND | 4,11 | 33352078 | 0 | 0 |
# Return the latest 13F cover page details for Berkshire Hathaway.
filing.latest_13f_filing_cover_page
#Output
{'filing_manager': 'Berkshire Hathaway Inc', 'business_address': '3555 Farnam Street, Omaha, NE, 68131', 'submission_type': '13F-HR', 'period_of_report': '09-30-2022', 'signature_name': 'Marc D. Hamburg', 'signature_title': 'Senior Vice President', 'signature_phone': '402-346-1400', 'signature_city': 'Omaha', 'signature_state': 'NE', 'signature_date': '11-14-2022', 'portfolio_value': 296096640000, 'count_holdings': 179}
# Return the attributes of a specific 13F filing for the specified cik. In the below example we are looking to grab the cover page, full holdings table and simplified holdings table for Berkshire for Q2-2022 (Calendar Year).
q2_cover_page, q2_holdings_table, q2_simplified_holdings_table = filing.get_a_13f_filing("Q2-2022")
print(q2_cover_page)
print(q2_holdings_table)
print(q2_simplified_holdings_table)
# Return the json object containing all 13F filings that are stored as part of the filing object (note this includes everything we've searched for so far).
filing.filings
# Write filings to excel. Record everything we've looked at to Excel.
filing.filings_to_excel
Installation
Install finsec using pip:
$ pip install finsec
Requirements
- Python >= 3.7+
- Pandas >= 1.3.5
- lxml >= 4.8.0
- requests >= 2.27.1
- beautifulsoup4 >= 4.11.1
Note that the above packages will be downloaded automatically using pip.
Author
Stephen Hogg
Metadata
Release files for finsec 0.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| finsec-0.0.12.tar.gz | 18.2 kB | Without provenance | Details for finsec-0.0.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| finsec-0.0.12-py3-none-any.whl | Python 3 | none | any | Details for finsec-0.0.12-py3-none-any.whl |
Total release size: 33.1 kB
Release files / finsec-0.0.12.tar.gz
| Download URL | finsec-0.0.12.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
901ceb57b93f0ea6fde98b045787e38e9e5a7c79a7da6b08129588cf236d30ea
|
|
BLAKE2b-256 checksum How to use checksums |
d2d6dcb7964bd679fe97dcc44ed6c96acd24f2c82124c65edeeac1ea5801c96d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Release files / finsec-0.0.12-py3-none-any.whl
| Download URL | finsec-0.0.12-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
550b05e7ee7391d13a098f45dd7d8c1abb60ea9611bcf02ddcee470aaded070a
|
|
BLAKE2b-256 checksum How to use checksums |
3c7fddfb3d369b8b7ec4db119fb28a45397037502a49b29f0b3f85a5df095188
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.4
|
Security for finsec 0.0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.