{"id":46879044,"url":"https://github.com/phillipsk/financial-statement-data-sets-etl","last_synced_at":"2026-03-10T21:01:04.950Z","repository":{"id":35356385,"uuid":"198636491","full_name":"phillipsk/Financial-Statement-Data-Sets-ETL","owner":"phillipsk","description":"Scalable scrapyd feed into AWS data pipeline; Spark ETL","archived":false,"fork":false,"pushed_at":"2022-11-22T04:17:48.000Z","size":31,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2023-12-30T06:50:21.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phillipsk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-24T13:00:26.000Z","updated_at":"2023-12-30T06:50:21.296Z","dependencies_parsed_at":"2023-01-15T19:05:36.318Z","dependency_job_id":null,"html_url":"https://github.com/phillipsk/Financial-Statement-Data-Sets-ETL","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/phillipsk/Financial-Statement-Data-Sets-ETL","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillipsk%2FFinancial-Statement-Data-Sets-ETL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillipsk%2FFinancial-Statement-Data-Sets-ETL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillipsk%2FFinancial-Statement-Data-Sets-ETL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillipsk%2FFinancial-Statement-Data-Sets-ETL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phillipsk","download_url":"https://codeload.github.com/phillipsk/Financial-Statement-Data-Sets-ETL/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillipsk%2FFinancial-Statement-Data-Sets-ETL/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30355223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T15:55:29.454Z","status":"ssl_error","status_checked_at":"2026-03-10T15:54:58.440Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-10T21:00:34.005Z","updated_at":"2026-03-10T21:01:04.795Z","avatar_url":"https://github.com/phillipsk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"   # Financial Statement Data ETL\nAnalysis of SEC DERA data\n\n## Overview\n\n* Python 3 Scrapy spider to retrieve SEC data\n* Scrapyd \u0026 scrapyd-client utilized for distributed crawling\n    * resulting zip files uploaded to S3 bucket via scrapy feed export configuration\n* AWS infrastructure\n    * Lambda function deployed via Cloud Formation\n    * Serverless s3-uncompressor SAM repo to unzip files from one S3 bucket into another\n* Cloud Watch logging enabled \n* Scrapyd logging enabled\n\n## TODO\n\n* Incorporate Spark \n    * Calculate metrics\n    * Year over year growth of SEC ledger balances\n    * Quarter over quarter\n    * 3 Year growth\n    * 5 Year growth\n    * Export calculated results\n* Improve scalability\n* Architecture diagram\n* IAM authentication\n \n    \n## Resources\n* Data Location: https://www.sec.gov/dera/data/financial-statement-data-sets.html\n* Data Dictionary: https://www.sec.gov/files/aqfs.pdf\n\n## Setup\n\n#### Clone the repo\n\n```bash\ngit clone https://github.com/phillipsk/Financial-Statement-Data-Sets-ETL.git\ncd Financial-Statement-Data-Sets-ETL\n```\n\n#### Deploy Lambda Function\n\n##### AWS CLI Deploy\n```bash\ngit checkout fork-aws-lambda\n```\n* Follow README.md instructions (this is a copy of Piotr's forked repo)\n\n#### OR\n##### AWS Web Deploy\n\n* From the AWS Lambda page\n* Lambda \u003e Create Function \u003e Browse Serverless App Repository \u003e Search: \"s3-uncompressor\"\n* Configure Source \u0026 Destination buckets\n\n##### Troubleshooting\n* Adjust LambdaFunctionMemorySize and/or LambdaFunctionTimeout \n\n#### Revert back to master branch\n```bash\ngit checkout master\n```\n\n#### Create Virtualenv:\n\n```bash\nvirtualenv venv\nsource venv/bin/activate\n```\n#### Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n#### Set environment variables\n```bash\nexport AWS_ACCESS_KEY_ID=[xxxxxxxxxxxxxxxxxxx]\nexport AWS_SECRET_ACCESS_KEY=[xxxxxxxxxxxxxxxxxxxxxxxx]\n```\n\n#### Run scrapy spider\n##### Crawl all zip files in table\n```bash\nscrapy crawl sec_table\n```\n#### OR\n##### Specify year as an argument\n```bash\nscrapy crawl args_spider -a year=2011\n```\n\n## Distributed crawling\n### [Scrapyd](https://scrapyd.readthedocs.io/en/stable/overview.html)\n* Launch a separate EC2 instance\n\n##### Set environment variables\n```bash\nexport AWS_ACCESS_KEY_ID=[xxxxxxxxxxxxxxxxxxx]\nexport AWS_SECRET_ACCESS_KEY=[xxxxxxxxxxxxxxxxxxxxxxxx]\n```\n\n##### Clone and install the dependencies\n```bash\ngit clone https://github.com/phillipsk/Financial-Statement-Data-Sets-ETL.git\ncd Financial-Statement-Data-Sets-ETL\npip install -r requirements.txt\n```\n\n##### Install scrapyd\n```bash\npip install scrapyd\n```\n\n##### Run the scrapyd daemon\n```bash\nscrapyd\n```\n\n## Revert back to the original instance\n##### Checkout the distributed branch\n```bash\ngit checkout feature-aws-distributed\n```\n\n##### Configure scrapy.cfg\n* Under the `[deploy]` property\n    * Set the URL to the EC2 IP \n    * Note the project name\n    * By default Scrapyd runs on port 6800\n```\nurl = http://x.x.x.x:6800/\nproject = secScrap\n```\n\n### [scrapyd-client](https://github.com/scrapy/scrapyd-client#deploying-a-project)\n\n##### Install scrapyd-client\n```bash\npip install scrapyd-client\n```\n##### Deploy the project\n```bash\nscrapyd-deploy default -p secScrap\n```\n```bash\ncurl http://x.x.x.x:6800/schedule.json -d project=secScrap -d spider=sec_table\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphillipsk%2Ffinancial-statement-data-sets-etl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphillipsk%2Ffinancial-statement-data-sets-etl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphillipsk%2Ffinancial-statement-data-sets-etl/lists"}