Skip to main content

epochize

Pipe logs through it and every Unix timestamp (seconds, milliseconds, microseconds, nanoseconds) gets a readable date next to it. Stdlib only, Python 3.9+.

$ echo 'ts=1700000000 ms=1700000000123 build 1.2.3' | epochize
ts=1700000000 [2023-11-14 22:13:20 UTC] ms=1700000000123 [2023-11-14 22:13:20 UTC] build 1.2.3
$ tail -f app.log | epochize -r -z Europe/Warsaw     # replace instead of annotate
$ epochize -z +05:30 events.json

Only numbers that fall between years 2000 and 2100 and have 10 (s), 13 (ms), 16 (us) or 19 (ns) digits are touched, so ids, versions and sizes are left alone.

Spreadsheet dates: -x/--excel treats 5-digit numbers (Excel/Sheets serial dates 1970-2099, e.g. 45000.5) as dates instead:

$ echo 'created,45000.5' | epochize -x -r
created,2023-03-15 12:00:00 UTC

Options: -x/--excel, -r/--replace, -z/--tz (utc, local, +02:00, IANA name). Exit code 2 on bad arguments or unreadable files.

Install

pip install epochize or copy epochize.py.

Support

MIT licensed. If it saves you time: https://paypal.me/RafalBaranowski

Metadata

Release files for epochize 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for epochize 0.1.0
File Size Uploaded
epochize-0.1.0.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for epochize 0.1.0
File Interpreter ABI Platform
epochize-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / epochize-0.1.0.tar.gz

Download URL epochize-0.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
09e92410e951c2bbec88be8b50a62aba610174fb4396083f695eefe10e9345ed
BLAKE2b-256 checksum
How to use checksums
415081cde1e3e80020fca36ffe5df256a58c710e6cbd1e92207c2edfd7357418
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / epochize-0.1.0-py3-none-any.whl

Download URL epochize-0.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfcf24b9a7b6ddb5da856c3104b62ccda809e3ff1bc7be23f7addee96d1cf976
BLAKE2b-256 checksum
How to use checksums
36e9f075b8f9df5b9a189dbfd5db36b33d154e785465396b8a850b1606a97f62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page