have planet orders request take in a series of item descriptions to create an order
まだ誰も着手していません。
評価
調査の方向性
Start at the planet orders request CLI entry point and inspect cli/types.py, especially the existing JSON parameter handling. Use the shown planet data search pipeline as the input case and verify that IDs and newline-delimited item descriptions are accepted, while mixed item types fail and item type remains required for ID input.】【。
索引モデルが issue の本文から書いたものです。
説明
To support the common use case of creating an order from a search, have planet orders request take in a series of item descriptions to create an order.
Usage:
planet data search --limit 5 PSScene | planet orders request - --name test --clip aoi.geojson --bundle analytic
Implementation notes: ids and item type are taken from the input. There is a check for more than one item type, which at this point results in a failure (the ability to order multiple types could come in a future improvement)
Changes required:
- planet order requests must now allow multiline input where each line is json in addition to ids as the argument
- item-type is only required if the input is IDs
Below is a working example of extracting item type and id from the output of planet data search.
$> planet data search --limit 5 PSScene | python ml.py --items -
PSScene: 20230504_155548_86_24b9
PSScene: 20230504_134550_99_2251
PSScene: 20230504_052537_02_2465
PSScene: 20230504_043314_80_248b
PSScene: 20230504_161301_74_2405
Note: MultiJSON is a hacked up version of JSON, which is in the cli/types.py module. There is more work here in defining a type that can handle both comma separated strings and multiple lines of json.
ml.py
import json
import click
class MultiJSON(click.ParamType):
name = 'MultiJSON'
def convert(self, value, param, ctx) -> list:
if isinstance(value, list):
conv = value
else:
# read from raw json
# skip this if value is a Path object or something else
if isinstance(value, str) and (value.startswith('{')
or value.startswith('[')):
print('hereh')
try:
conv = json.loads(value)
if isinstance(conv, dict):
conv = [conv]
except json.decoder.JSONDecodeError:
self.fail(
'JSON string is not valid JSON. Make sure the entire '
'JSON string is single-quoted and string entries are '
'double-quoted.')
# read from stdin or file
else:
try:
with click.open_file(value) as f:
conv = [json.loads(line) for line in f if line]
except FileNotFoundError:
self.fail('File not found.')
except json.decoder.JSONDecodeError:
stream = 'stdin' if value == '-' else 'JSON file'
self.fail(f'{stream} does not contain valid JSON.')
if not len(conv):
self.fail('JSON cannot be empty.')
return conv
@click.command()
@click.option('--items', type=MultiJSON(), required=True)
def hello(items):
for i in items:
click.echo(f"{i['properties']['item_type']}: {i['id']}")
if __name__ == '__main__':
hello()
- 主要言語
- Python
- スター
- 300
- フォーク
- 99
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
planetlabs/planet-client-python のほかの issue
-
better-testing
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
planetlabs/planet-client-python#1110 ·
-
FeaturesClient list_items does not support filtering対応中かも @steps-re が 96 日前に担当しました。 オープンproposal
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
planetlabs/planet-client-python#1221 ·
-
FeaturesClient does not implement Update Feature対応中かも @tbarsballe が 125 日前に担当しました。 オープンproposal
難易度 3/5 1〜2日 初心者へのやさしさ 57/100
planetlabs/planet-client-python#1214 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
planetlabs/planet-client-python#1197 · コメント 1 件 · リアクション 1 件 ·
-
Quota API再び着手できるかも @asonnenschein が 424 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンai-claude
planetlabs/planet-client-python#1191 · コメント 1 件 · 担当者 1 名 ·
planetlabs/planet-client-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
lugassawan/swe-workbench#799 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
vllm-project/vllm#61131 ·
メンテナーはふだん 1 日以内に返信
-
Non-string form field names raise AttributeError when files are attached対応中かも @nightcityblade が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kubernetes-client/python#2735 ·
メンテナーはふだん 1 日以内に返信
-
desktop help wanted test
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信