@@ -3,7 +3,9 @@ Live at https://secinsights.ai/
3
3
## Setup Dev Workspace
4
4
1 . Install [ pyenv] ( https://github.com/pyenv/pyenv#automatic-installer ) and then use it to install the Python version in ` .python-version ` .
5
5
1 . install pyenv with ` curl https://pyenv.run | bash `
6
+ * This step can be skipped if you're running from the devcontainer image in Github Codespaces
6
7
1 . [ Install docker] ( https://docs.docker.com/engine/install/ )
8
+ * This step can be skipped if you're running from the devcontainer image in Github Codespaces
7
9
1 . Run ` poetry shell `
8
10
1 . Run ` poetry install ` to install dependencies for the project
9
11
1 . Create the ` .env ` file and source it. The ` .env.development ` file is a good template.
@@ -17,6 +19,13 @@ Live at https://secinsights.ai/
17
19
- This spins up the Postgres 15 DB & Localstack in their own docker containers.
18
20
- The server will not run in a container but will instead run directly on your OS.
19
21
- This is to allow for use of debugging tools like ` pdb `
22
+ 1 . Lastly, you will likely want to populate your local database with some sample SEC filings
23
+ - We have a script for this! But first, open your ` .env ` file and replace the placeholder values for the ` OPENAI_API_KEY ` with your own OpenAI API key
24
+ - At some point you will want to do the same for the other secret keys in here like ` POLYGON_IO_API_KEY ` , ` AWS_KEY ` , & ` AWS_SECRET `
25
+ - Source the file again with ` set -a ` then ` source .env `
26
+ - Run ` make seed_db_local `
27
+ - If this step fails, you may find it helpful to run ` make refresh_db ` to wipe your local database and re-start with emptied tables.
28
+ - Done 🏁! You can run ` make run ` again and you should see some documents loaded at http://localhost:8000/api/document
20
29
21
30
## Scripts
22
31
The ` scripts/ ` folder contains several scripts that are useful for both operations and development.
@@ -71,23 +80,28 @@ These steps assume you've already followed the steps above for setting up your d
71
80
72
81
1 . Setup AWS CLI
73
82
1 . Install AWS CLI
74
- - ` curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" `
75
- - ` unzip awscliv2.zip `
76
- - ` sudo ./aws/install `
83
+ - This step can be skipped if you're running from the devcontainer image in Github Codespaces
84
+ - Steps:
85
+ - ` curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" `
86
+ - ` unzip awscliv2.zip `
87
+ - ` sudo ./aws/install `
77
88
1 . Configure AWS CLI
78
89
- This is mainly to set the AWS credentials that will later be used by s3fs
79
90
- Run ` aws configure ` and enter the access key & secret key for a AWS IAM user that has access to the PDFs where you want to store the SEC files.
80
91
- set the default AWS region to ` us-east-1 ` (what we're primarily using).
81
92
1 . Setup [ ` s3fs ` ] ( https://github.com/s3fs-fuse/s3fs-fuse )
82
93
1 . Install s3fs
94
+ - This step can be skipped if you're running from the devcontainer image in Github Codespaces
83
95
- ` sudo apt install s3fs `
84
96
1 . Setup a s3fs mounted folder
85
97
- Create the mounted folder locally ` mkdir ~/mounted_folder `
86
98
- ` s3fs llama-app-web-assets-preview ~/mounted_folder `
87
99
- You can replace ` llama-app-web-assets-preview ` with the name of the S3 bucket you want to upload the files to.
88
100
1 . Install [ ` wkhtmltopdf ` ] ( https://wkhtmltopdf.org/ )
89
- - ` sudo apt-get update `
90
- - ` sudo apt-get install wkhtmltopdf `
101
+ - This step can be skipped if you're running from the devcontainer image in Github Codespaces
102
+ - Steps:
103
+ - ` sudo apt-get update `
104
+ - ` sudo apt-get install wkhtmltopdf `
91
105
1 . Get into your poetry shell with ` poetry shell ` from the project's root directory.
92
106
1 . Run the script! ` python scripts/download_sec_pdf.py -o ~/mounted_folder --file-types="['10-Q','10-K']" `
93
107
- Take a 🚽 break while it's running, it'll take a while!
0 commit comments