skillfed

pyRFC3339

Generate and parse RFC 3339 timestamps

pyrfc3339 v2.1.0 15.5M downloads/30d#1,182 on PyPI15
Permissive license MIT Active released

What it is and what it does

pyRFC3339 is a lightweight library for working with RFC 3339-compliant timestamps in Python. It provides two core functions: `generate()` converts a timezone-aware datetime object into an RFC 3339 string, and `parse()` converts an RFC 3339 string back into a datetime object with proper timezone information. The library handles the details of timestamp formatting and parsing so you don't have to manually construct or interpret RFC 3339 strings.

This is useful for any application that needs to exchange timestamps with APIs, databases, or other systems that expect RFC 3339 format—a standard used widely in web services and data interchange. The library has no external dependencies and supports current Python versions from 3.9 onward, making it straightforward to add to any project.

Use it for:

  • Serialize datetime objects to RFC 3339 strings for REST API responses or JSON payloads.
  • Parse RFC 3339 timestamps from external APIs or configuration files into Python datetime objects.
  • Ensure consistent timestamp formatting across services that require RFC 3339 compliance.
  • Handle timezone-aware datetime conversions without manual string manipulation.
  • Generate audit logs or event timestamps in a standardized, interoperable format.

Worth the install?

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

Parses and generates RFC 3339-compliant timestamps using Python datetime objects, converting between string representations and timezone-aware datetime instances.

Yes. pyRFC3339 is a stable, actively maintained library with zero dependencies, permissive licensing, and no known vulnerabilities. Install it if you need to work with RFC 3339 timestamps; the low friction and narrow, well-defined scope make it a reliable choice for timestamp serialization and parsing.

Install

pyrfc3339 on PyPI

pip

pip install pyrfc3339

uv

uv add pyrfc3339

poetry

poetry add pyrfc3339

Installing pyRFC3339

Before you install

Low install friction with no runtime dependencies. Actively maintained as of 2026-08-09 with recent release history.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal restrictions.

Quickstart

pip install pyRFC3339

from pyrfc3339 import generate, parse
from datetime import datetime, timezone

generate(datetime.now(timezone.utc))
parse('2009-01-01T10:01:02Z')

Requires Python 3.9 or later.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 356 days since the last release
Last repo commit
First released
Downloads 15,529,723/month — #1,182 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyrfc3339-2.1.0-py3-none-any.whl

Keywords: rfc-3339, timestamp, iso-8601, datetime

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: Internet

Tags

rfc 3339 timestamp parseriso 8601 datetime generatortimezone-aware datetime conversionrfc 3339 compliancetimestamp parsing librarydatetime string formattingiso timestamp handler
timestamp-handlingrfc-3339datetime-conversion

More Internet packages