You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
possibly after that, running something like awk '!seen[$0]++', which dedupes and returns you unique items. this would be equivalent to a more_itertools.unique_everseen in python. i.e. some way to produce 'unique' output
localizing datetimes - this is something I find myself writing pretty often, so much so that I have another script that can take JSON blobs as input, and localize dates based on a json key. Would be cool to support localizing and printing datetimes in different formats. could even in the future add an option to hook into my.time.tz to print datetimes localized to when you did them, or local to your current timezone
in general, picking/deleting keys from json output (including nested objects/@property values/calling functions on namedtuple/dataclass objects) seems like a good idea, probably related to printf
I will probably work on adding some of these, just wanted to track the ideas first
dont want to necessarily just add every possible jq-like query/map/filter function, but these are the ones I find myself doing very often. Probably better to leave more complex operations to jq or something else
The text was updated successfully, but these errors were encountered:
Another thing I often wanted -- often during debugging/testing it's useful to restrict the get_files call to one or a few input files.
Currently I am just editing the source directly but might be nice if it was somehow possible to pass it to hpi query, e.g. hpi query --inputs '[path1, path2, path3]' modulename....
Not sure how to do that reliably and consistently, I feel like it's going to be hacky either way. But in the first approximation it could monkey patch get_inputs function for modulename?
sort of a follow up to https://memex.zulipchat.com/#narrow/stream/279601-hpi/topic/new.20HPI.20query.2Fserialization.20feature/near/270313599
To just track common patterns I see myself using with
hpi query
, so they could possibly be moved into python instead of in the shell usingjq
hpi query modulename | jq '"\(.attribute_one)|\(.attribute_two)"'
: e.g.,: https://github.com/seanbreckenridge/HPI-personal/blob/d1e7bae2fddcba2c2f655456eb7d2b7155641e97/scripts/history_fzf#L10-L12awk '!seen[$0]++'
, which dedupes and returns you unique items. this would be equivalent to amore_itertools.unique_everseen
in python. i.e. some way to produce 'unique' outputmy.time.tz
to print datetimes localized to when you did them, or local to your current timezone@property
values/calling functions on namedtuple/dataclass objects) seems like a good idea, probably related to printfI will probably work on adding some of these, just wanted to track the ideas first
dont want to necessarily just add every possible jq-like query/map/filter function, but these are the ones I find myself doing very often. Probably better to leave more complex operations to
jq
or something elseThe text was updated successfully, but these errors were encountered: