stn / tap-jquants Goto Github PK
View Code? Open in Web Editor NEWSinger.io tap for J-Quants
License: Apache License 2.0
Singer.io tap for J-Quants
License: Apache License 2.0
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
https://jpx.gitbook.io/j-quants-ja/api-reference/prices_am
Endpoint: https://api.jquants.com/v1/prices/prices_am
params: code
ヒストリカルデータではないため、full tableでの取得となる。
fins-statementsを実行し、取得するデータがあったにも関わらずstateが次のようになっていた。
{"type": "STATE", "value": {"currently_syncing": null}}
https://jpx.gitbook.io/j-quants-ja/api-reference/weekly_margin_interest
Endpoint: https://api.jquants.com/v1/markets/weekly_margin_interest
params: code, from, to, date
メールアドレスとパスワードではなくリフレッシュトークンをconfig.jsonで指定できるようにする。
https://jpx.gitbook.io/j-quants-ja/api-reference/statements
Endpoint: https://api.jquants.com/v1/fins/statements
Params: code, date
Follow the https://hub.meltano.com/add-a-tap
再現手順
$ tap-jquants --config config.json --catalog catalog_daily_quotes.json
state.json
に保存{"currently_syncing": null, "bookmarks": {"daily_quotes": "2023-05-01T00:00:00.000000Z"}}
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"}}}
https://jpx.gitbook.io/j-quants-ja/api-reference/short_selling
Endpoint: https://api.jquants.com/v1/markets/short_selling
params: sector33code, from, to, date
https://jpx.gitbook.io/j-quants-ja/api-reference/breakdown
Endpoint: https://api.jquants.com/v1/markets/breakdown
params: code, from, to, date
tap起動時にrefresh tokenとid tokenを再生成するため、2つのtap-jquantsを同時に走らせることができない。
rate limitの問題もあるので、同時に一つしか実行できないというのは許容できる。しかし、未確認だが、後から実行した方が新たなrefresh tokenとid tokenを作成し、先に実行していたほうがエラーとなるのではないだろうか。それは不自然な挙動だろう。
取得対象の日付が非営業日であったときに、APIにアクセスすることなくスキップする。
https://jpx.gitbook.io/j-quants-ja/api-reference/announcement
Endpoint: https://api.jquants.com/v1/fins/announcement
Params:
https://jpx.gitbook.io/j-quants-ja/api-reference/trades_spec
Endpoint: https://api.jquants.com/v1/markets/trades_spec
params: section, from, to
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
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を組み合わせることでデータを一意に識別することが可能です。
https://jpx.gitbook.io/j-quants-ja/api-reference/dividend
Endpoint: https://api.jquants.com/v1/fins/dividend
Params: code, from, to, date
現在、ほとんどのstreamで日毎あるいは週毎に取得しているが、新たに導入されたpagination_keyを用いると、start-dateから現在まですべてを取得範囲にできるのではないだろうか。
feature flagにして、現在の動作と切り替えられるようにする。
考察すべき点
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.