项目作者: evdubs

项目描述 :
ETL for the IEX Stocks API
高级语言: Racket
项目地址: git://github.com/evdubs/iex-stocks.git
创建时间: 2018-09-07T03:13:42Z
项目社区:https://github.com/evdubs/iex-stocks

开源协议:Mozilla Public License 2.0

下载


iex-stocks

These Racket programs will download data from the IEX Stocks API and insert this data into a PostgreSQL database. The intended usage is :

  1. $ racket chart-extract.rkt
  2. $ racket chart-transform-load.rkt
  1. $ racket splits-extract.rkt
  2. $ racket splits-transform-load.rkt
  1. $ racket dividends-extract.rkt
  2. $ racket dividends-transform-load.rkt
  1. $ racket company-extract.rkt
  2. $ racket company-transform-load.rkt

Many of the above programs require a database password. The available parameters are:

  1. $ racket chart-extract.rkt -h
  2. racket chart-extract.rkt [ <option> ... ]
  3. where <option> is one of
  4. -d <date>, --date <date> : Exact date to query. Enabled only when querying for --history-range date
  5. -f <first>, --first-symbol <first> : First symbol to query. Defaults to nothing
  6. -l <last>, --last-symbol <last> : Last symbol to query. Defaults to nothing
  7. -n <name>, --db-name <name> : Database name. Defaults to 'local'
  8. -p <password>, --db-pass <password> : Database password
  9. -t <token>, --api-token <token> : IEX Cloud API Token
  10. -u <user>, --db-user <user> : Database user name. Defaults to 'user'
  11. -r <r>, --history-range <r> : Amount of history to request. Defaults to date, with date paired with a specified date using --date (-d)
  12. --help, -h : Show this help
  13. -- : Do not treat any remaining argument as a switch (at this level)
  14. Multiple single-letter switches can be combined after one `-`. For
  15. example: `-h-` is the same as `-h --`
  16. $ racket chart-transform-load.rkt -h
  17. racket chart-transform-load.rkt [ <option> ... ]
  18. where <option> is one of
  19. -b <folder>, --base-folder <folder> : IEX Stocks Chart base folder. Defaults to /var/tmp/iex/chart
  20. -d <date>, --folder-date <date> : IEX Stocks Chart folder date. Defaults to today
  21. -n <name>, --db-name <name> : Database name. Defaults to 'local'
  22. -p <password>, --db-pass <password> : Database password
  23. -u <user>, --db-user <user> : Database user name. Defaults to 'user'
  24. --help, -h : Show this help
  25. -- : Do not treat any remaining argument as a switch (at this level)
  26. Multiple single-letter switches can be combined after one `-`. For
  27. example: `-h-` is the same as `-h --`
  28. $ racket splits-extract.rkt -h
  29. racket splits-extract.rkt [ <option> ... ]
  30. where <option> is one of
  31. -n <name>, --db-name <name> : Database name. Defaults to 'local'
  32. -p <password>, --db-pass <password> : Database password
  33. -t <token>, --api-token <token> : IEX Cloud API Token
  34. -u <user>, --db-user <user> : Database user name. Defaults to 'user'
  35. -r <r>, --history-range <r> : Amount of history to request. Defaults to 1m (one month)
  36. --help, -h : Show this help
  37. -- : Do not treat any remaining argument as a switch (at this level)
  38. Multiple single-letter switches can be combined after one `-`. For
  39. example: `-h-` is the same as `-h --`
  40. $ racket splits-transform-load.rkt -h
  41. racket splits-transform-load.rkt [ <option> ... ]
  42. where <option> is one of
  43. -b <folder>, --base-folder <folder> : IEX Stocks splits base folder. Defaults to /var/tmp/iex/splits
  44. -d <date>, --folder-date <date> : IEX Stocks splits folder date. Defaults to today
  45. -n <name>, --db-name <name> : Database name. Defaults to 'local'
  46. -p <password>, --db-pass <password> : Database password
  47. -u <user>, --db-user <user> : Database user name. Defaults to 'user'
  48. --help, -h : Show this help
  49. -- : Do not treat any remaining argument as a switch (at this level)
  50. Multiple single-letter switches can be combined after one `-`. For
  51. example: `-h-` is the same as `-h --`
  52. $ racket company-extract.rkt -h
  53. racket company-extract.rkt [ <option> ... ]
  54. where <option> is one of
  55. -t <token>, --api-token <token> : IEX Cloud API Token
  56. --help, -h : Show this help
  57. -- : Do not treat any remaining argument as a switch (at this level)
  58. Multiple single-letter switches can be combined after one `-`. For
  59. example: `-h-` is the same as `-h --`
  60. $ racket company-transform-load.rkt -h
  61. racket company-transform-load.rkt [ <option> ... ]
  62. where <option> is one of
  63. -b <folder>, --base-folder <folder> : IEX Stocks company base folder. Defaults to /var/tmp/iex/company
  64. -d <date>, --folder-date <date> : IEX Stocks company folder date. Defaults to today
  65. -n <name>, --db-name <name> : Database name. Defaults to 'local'
  66. -p <password>, --db-pass <password> : Database password
  67. -u <user>, --db-user <user> : Database user name. Defaults to 'user'
  68. --help, -h : Show this help
  69. -- : Do not treat any remaining argument as a switch (at this level)
  70. Multiple single-letter switches can be combined after one `-`. For
  71. example: `-h-` is the same as `-h --`

The provided schema.sql file shows the expected schema within the target PostgreSQL instance. This process assumes that you can write to a /var/tmp/iex folder. This process also assumes that you have loaded your database with NASDAQ symbol file information. This data is provided by the nasdaq-symbols project.

Unfortunately, around June 2019, the ohlc and volume endpoints have been made unavailable to users of the free tier and, for NASDAQ data, a special NASDAQ permission must be received after July 2019. Data similar to those endpoints is now accessed through chart-extract and chart-transform-load. Data is only available for the previous day and prior.

Dependencies

It is recommended that you start with the standard Racket distribution. With that, you will need to install the following packages:

  1. $ raco pkg install --skip-installed gregor http-easy tasks threading