Proposal: Have an api to retrieve the relativedelta information
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
既存の get_date_data API と、それが使用する parser のパスから始めてください。この issue では実装ファイルもテストも特定されていません。要求された構造化された結果を dateutil.relativedelta と比較し、「3 years and 6 months」のような式で元の単位をどのように保持するかを定義してから、その動作のテストカバレッジを追加してください。
索引モデルが issue の本文から書いたものです。
説明
dateparser is a fantastic tool to calculate a date given a literal expression like "3 years and 6 months".
However, it does not seem possible to leverage the syntactic parser to retrieve a relativedelta (https://dateutil.readthedocs.io/en/stable/relativedelta.html) structure filled with the result of the parsing.
For example if the text says:
3 years and 6 months
It would be great to obtain a structured filled with
relativedelta(year=3, month=6)
At least I could not find on the API a way to do so. The only way seems to calculate the resulting date with
dateparser.get_date_data("3 years 6 months")
then get the current date (datetime.now()) and derive the number of months. The drawback is you loose the resolution. In the example above, you will be able to calculate 42 months but won't be able to keep the original sentence meaning: 3 years and 6 months.
- 主要言語
- Python
- スター
- 2.9k
- フォーク
- 545
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 17
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
scrapinghub/dateparser のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
scrapinghub/dateparser#1617 ·
メンテナーはふだん 1 日以内に返信
-
StaticTzInfo has localize() but not normalize(), so pytz-detecting code crashes on it再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
scrapinghub/dateparser#1591 ·
メンテナーはふだん 1 日以内に返信
-
Validate on Python 3.15対応中かも @kishan3 が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
scrapinghub/dateparser#1548 ·
メンテナーはふだん 1 日以内に返信
-
search_dates() raises IndexError for the zh-Hans, zh-Hant and yue locales対応中かも @abhi-0203 が 88 日前に担当しました。 オープンsearch_dates Status: Bug confirmed Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
scrapinghub/dateparser#1372 ·
メンテナーはふだん 1 日以内に返信
-
Adopt sphinx-scrapy, with docs dependencies in a dependency group対応中かも @yamilmaud が 3 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 25/100
scrapinghub/dateparser#1613 ·
メンテナーはふだん 1 日以内に返信
scrapinghub/dateparser の issue をすべて見る
似ている issue
-
intake mcp-intake needs-human-review priority:high type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
Ikalus1988/MisakaNet#6081 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
521xueweihan/HelloGitHub#4655 ·
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount due対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 79/100
developmentseed/titiler-covjson#164 ·
メンテナーはふだん 1 日以内に返信
-
area/install bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信