https://github.com/evdubs/mstar-financial-statements
https://github.com/evdubs/mstar-financial-statements
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/evdubs/mstar-financial-statements
- Owner: evdubs
- License: mpl-2.0
- Created: 2026-05-28T02:05:55.000Z (21 days ago)
- Default Branch: master
- Last Pushed: 2026-05-28T02:13:31.000Z (21 days ago)
- Last Synced: 2026-05-28T04:10:46.479Z (20 days ago)
- Language: Racket
- Size: 27.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mstar-financial-statements
These Racket programs will download the Mstar financial statement documents and insert the
statement data into a PostgreSQL database. The intended usage is:
```bash
$ racket quotes-extract.rkt
$ racket quotes-transform-load.rkt
```
```bash
$ racket financial-statement-extract.rkt
$ racket balance-sheet-transform-load.rkt
$ racket cash-flow-statement-transform-load.rkt
$ racket income-statement-transform-load.rkt
```
You will need to provide a database password for many of the above programs. The available parameters are:
```bash
$ racket financial-statements-extract.rkt -h
racket financial-statement-extract.rkt [ ... ]
where is one of
-f , --first-symbol : First symbol to query. Defaults to nothing
-l , --last-symbol : Last symbol to query. Defaults to nothing
-n , --db-name : Database name. Defaults to 'local'
-p , --db-pass : Database password
-u , --db-user : Database user name. Defaults to 'user'
--help, -h : Show this help
-- : Do not treat any remaining argument as a switch (at this level)
Multiple single-letter switches can be combined after one `-`. For
example: `-h-` is the same as `-h --`
$ racket balance-sheet-transform-load.rkt -h
racket balance-sheet-transform-load.rkt [ ... ]
where is one of
-b , --base-folder : Mstar balance sheet base folder. Defaults to /var/local/mstar/financial-statements
-d , --folder-date : Mstar balance sheet folder date. Defaults to today
-n , --db-name : Database name. Defaults to 'local'
-p , --db-pass : Database password
-u , --db-user : Database user name. Defaults to 'user'
--help, -h : Show this help
-- : Do not treat any remaining argument as a switch (at this level)
Multiple single-letter switches can be combined after one `-`. For
example: `-h-` is the same as `-h --`
$ racket cash-flow-statement-transform-load.rkt -h
racket cash-flow-statement-transform-load.rkt [ ... ]
where is one of
-b , --base-folder : Mstar cash flow statement base folder. Defaults to /var/local/mstar/financial-statements
-d , --folder-date : Mstar cash flow statement folder date. Defaults to today
-n , --db-name : Database name. Defaults to 'local'
-p , --db-pass : Database password
-u , --db-user : Database user name. Defaults to 'user'
--help, -h : Show this help
-- : Do not treat any remaining argument as a switch (at this level)
Multiple single-letter switches can be combined after one `-`. For
example: `-h-` is the same as `-h --`
$ racket income-statement-transform-load.rkt -h
racket income-statement-transform-load.rkt [ ... ]
where is one of
-b , --base-folder : Mstar income statement base folder. Defaults to /var/local/mstar/financial-statements
-d , --folder-date : Mstar income statement folder date. Defaults to today
-n , --db-name : Database name. Defaults to 'local'
-p , --db-pass : Database password
-u , --db-user : Database user name. Defaults to 'user'
--help, -h : Show this help
-- : Do not treat any remaining argument as a switch (at this level)
Multiple single-letter switches can be combined after one `-`. For
example: `-h-` is the same as `-h --`
```
The provided `schema.sql` file shows the expected schema within the target PostgreSQL instance.
This process assumes you can write to a `/var/local/mstar` folder. This process also assumes you have loaded your database with NASDAQ symbol
file information. This data is provided by the [nasdaq-symbols](https://github.com/evdubs/nasdaq-symbols) project.
The above process will download around 600MB worth of JSON documents over many hours. It is encouraged to compress these files when you are
done processing them. It is also encouraged that you do not run the extract jobs too frequently. I think running the financial-statement-extract
once per month is sufficient.
### Dependencies
It is recommended that you start with the standard Racket distribution. With that, you will need to install the following packages:
```bash
$ raco pkg install --skip-installed gregor html-parsing sxml tasks threading
```