Giter VIP home page Giter VIP logo

tap-jquants's People

Contributors

dependabot[bot] avatar stn avatar

Stargazers

 avatar

Watchers

 avatar

tap-jquants's Issues

index_option failed with target-postgres

2023-05-18T12:27:33.247642Z [info     ] psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: "2008-05" cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2023-05-18T12:27:33.247725Z [info     ] CONTEXT:  COPY tmp_70b4a369_7fd1_4a88_97ac_482c0d680071, line 1, column contract_month: "2008-05" cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres
2023-05-18T12:27:33.247808Z [info     ]                                cmd_type=elb consumer=True name=target-postgres producer=False stdio=stderr string_id=target-postgres

リフレッシュトークンのサポート

メールアドレスとパスワードではなくリフレッシュトークンをconfig.jsonで指定できるようにする。

  • それが無効であったときには、そこで処理を中断する。

データがまだ更新されていなかったときにstateが進んでしまう

再現手順

  1. 実行
$ tap-jquants --config config.json --catalog catalog_daily_quotes.json
  1. 最初の実行で返ってきたstateを state.json に保存
{"currently_syncing": null, "bookmarks": {"daily_quotes": "2023-05-01T00:00:00.000000Z"}}
  1. 再度、実行
tap-jquants --config config.json --catalog catalog_daily_quotes.json --state state.json
...
{"type": "STATE", "value": {"currently_syncing": null, "bookmarks": {"daily_quotes": "2023-05-02T00:00:00.000000Z"}}}

2つ以上のtap-jquantsを同時に実行するとエラーとなる

tap起動時にrefresh tokenとid tokenを再生成するため、2つのtap-jquantsを同時に走らせることができない。

rate limitの問題もあるので、同時に一つしか実行できないというのは許容できる。しかし、未確認だが、後から実行した方が新たなrefresh tokenとid tokenを作成し、先に実行していたほうがエラーとなるのではないだろうか。それは不自然な挙動だろう。

非営業日のデータの取得しない

取得対象の日付が非営業日であったときに、APIにアクセスすることなくスキップする。

  • 過去の営業日はリストで保持可能だが、未来はどうする?
  • 非営業日のデータを持つendpointはないのか?たとえば、財務情報。

fins_statementsが2010-04-30のデータ取得に失敗する

log

2023-04-28T00:07:41.977016Z [info     ] INFO params = {'code': None, 'date': '2010-04-30'}, payload = {} cmd_type=elb consumer=False name=tap-jquants--fins-
statements producer=True stdio=stderr string_id=tap-jquants--fins-statements  2023-04-28T00:07:47.870313Z [info     ] INFO METRIC: {"type": "timer", "metric": "http_request_duration", "value": 1.149768352508545, "tags": {"endpoint": "fins_statements", "http_status_code": 200, "status": "succeeded"}} cmd_type=el
b consumer=False name=tap-jquants--fins-statements producer=True stdio=stderr string_id=tap-jquants--fins-statements                                        2023-04-28T00:07:48.108067Z [info     ] INFO Total synced records for fins_statements: 348 cmd_type=elb consumer=False name=tap-jquants--fins-statements producer=True stdio=stderr string_id=tap-jquants--fins-statements
2023-04-28T00:07:48.261379Z [info     ] INFO METRIC: {"type": "counter", "metric": "record_count", "value": 316, "tags": {"endpoint": "fins_statements"}} cm
d_type=elb consumer=False name=tap-jquants--fins-statements producer=True stdio=stderr string_id=tap-jquants--fins-statements                               2023-04-28T00:07:48.262173Z [info     ] CRITICAL Errors during transform cmd_type=elb consumer=False name=tap-jquants--fins-statements producer=True stdio=s
tderr string_id=tap-jquants--fins-statements                                  2023-04-28T00:07:48.262330Z [info     ] CRITICAL        current_period_start_date: data does not match {'format': 'date-time', 'type': 'string'} cmd_type=elb consumer=False name=tap-jquants--fins-statements producer=True stdio=stderr string_id=tap-jquants--fins-statements
2023-04-28T00:07:48.262448Z [info     ] CRITICAL        current_period_end_dat
e: data does not match {'format': 'date-time', 'type': 'string'} cmd_type=elb
consumer=False name=tap-jquants--fins-statements producer=True stdio=stderr st
ring_id=tap-jquants--fins-statements
2023-04-28T00:07:48.262551Z [info     ] CRITICAL        current_fiscal_year_st
art_date: data does not match {'format': 'date-time', 'type': 'string'} cmd_ty
pe=elb consumer=False name=tap-jquants--fins-statements producer=True stdio=st
derr string_id=tap-jquants--fins-statements
2023-04-28T00:07:48.262652Z [info     ] CRITICAL        current_fiscal_year_en
d_date: data does not match {'format': 'date-time', 'type': 'string'} cmd_type
=elb consumer=False name=tap-jquants--fins-statements producer=True stdio=stde
rr string_id=tap-jquants--fins-statements

Support オプション四本値(/option/index_option)

https://jpx.gitbook.io/j-quants-ja/api-reference/index_option

Endpoint: https://api.jquants.com/v1/option/index_option
Params: date

緊急取引証拠金が発動した場合は、同一の取引日・銘柄に対して清算価格算出時と緊急取引証拠金算出時のデータが発生します。そのため、Date、Codeに加えてEmergencyMarginTriggerDivisionを組み合わせることでデータを一意に識別することが可能です。

pagination_keyを用いて取得範囲を広げる

現在、ほとんどのstreamで日毎あるいは週毎に取得しているが、新たに導入されたpagination_keyを用いると、start-dateから現在まですべてを取得範囲にできるのではないだろうか。

feature flagにして、現在の動作と切り替えられるようにする。

考察すべき点

  • 現在のpagination_keyを用いたロジックだと、すべてをメモリーに入れて一度に出力してしまうため、pagination_keyもbookmarkにいれる?
  • pagination_keyの寿命は?
  • 日の途中で出力されれしまうが、transformに影響がでないか。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.