google / google/weather-tools

[weather-sp] : better formatting of date & time in output template

Open
#535 6 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue weather-sp
Dominant language
Python
Stars
252
Forks
60
Avg merge
8d 4h
Merged PRs (30d)
3

Description

## Example:
For a file `gs://test-input/test-file.grib` the output file pattern is `gs://test-output/splits/test-file_{date}-{time}.grib`.
Then for date = 20200101, time = 1200, the output file for that split will be `gs://test-output/splits/test-file_20200101-1200.grib`.

But what if user want's output file as `gs://test-output/splits/test-file_20200101-12:00:00.grib` -- basically format date & time as per the need.

For such cases he can provide output file pattern as `gs://test-output/splits/test-file_{date}-{datetime.strptime(f"{time}", "%H%M").strftime("%H:%M:%S")}.grib`.

Make necessary changes for supporting this :) most probably just need to import `datetime` library and minor tweaking in logic.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.