skillfed

snaptime

Transform timestamps with a simple DSL

snaptime v0.2.4 103.0K downloads/30d#12,834 on PyPI11
License unclear UNKNOWN Abandoned released

What it is and what it does

Snaptime is a small utility for transforming timestamps using a domain-specific language (DSL) that chains snap and delta operations. It lets you truncate a datetime to a time boundary (e.g., start of day with @d) and add time offsets (e.g., +3h) in a single expression, inspired by Splunk's relative time syntax. The package includes a basic snap() function for naive datetimes and a snap_tz() variant for timezone-aware datetimes that handles daylight saving time transitions.

The DSL supports multiple notations for each time unit (seconds, minutes, hours, days, weeks, months, years) and allows arbitrary chaining—for example, snap(t, "+8h@d+1d+11h") adds 8 hours, snaps to midnight, then adds one day and 11 hours. It has no runtime dependencies, but the package has been abandoned since 2017-06-15 with no maintenance, no specified Python version support, and an unclear license.

Use it for:

  • Compute delivery times or scheduled events by snapping to time boundaries and adding offsets in a single expression.
  • Truncate timestamps to specific time units (day, hour, week, month) for aggregation or reporting queries.
  • Handle timezone-aware datetimes with DST transitions using snap_tz when naive snapping would produce incorrect results.
  • Build time-based filters for log analysis or time-series data where relative time expressions are more readable than imperative datetime arithmetic.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Snaptime transforms timestamps using a simple DSL inspired by Splunk's relative time modifiers, allowing you to snap to time boundaries and apply time deltas in a single chained expression.

No. The package is abandoned (last commit 2017-06-15), has no specified Python version support, an unclear license, and high install friction. While the DSL concept is useful, the lack of maintenance means compatibility with modern Python is uncertain and security issues would go unaddressed. Use a maintained alternative or implement the snapping logic directly.

Install

snaptime on PyPI

pip

pip install snaptime

uv

uv add snaptime

poetry

poetry add snaptime

Installing snaptime

Before you install

High install friction reported. The package is abandoned—last commit was 2017-06-15, with no maintenance activity or Python version specification. Installation may encounter compatibility issues with modern Python environments.

License in practice

License is marked UNKNOWN with unclear treatment. No SPDX identifier is available. You should verify the actual license terms in the repository before using this package in a production or commercial context.

Quickstart

from datetime import datetime
from snaptime import snap

result = snap(datetime(2018, 10, 28, 23), "+3h@d")
# datetime.datetime(2018, 10, 29, 0, 0)

No Python version requirement specified; compatibility with modern Python versions is uncertain given the package's abandonment since 2017-06-15.

Verify before relying

  • Whether the package works with Python 3.x versions (development history suggests Python 2 focus)
  • Current state of timezone-aware datetime handling and DST edge cases
  • Whether snap_tz function is stable or has known issues with modern timezone libraries

Package facts

License UNKNOWN (unclear)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 3,347 days since the last release
Last repo commit
First released
Downloads 102,958/month — #12,834 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: snaptime-0.2.4.tar.gz

Keywords: snap, datetime, date, truncate, transform

Tags

datetime truncationrelative time modifierstimestamp snappingtime delta chainingdatetime transformation DSLsnap to time boundariestimestamp manipulation
datetime-utilitiesabandoned

More Utilities packages