python-datauri
A li'l class for data URI manipulation in Python
Decision gist · record as of 2026-08-14
Yes, if you work with data URIs regularly. The package is stable, permissively licensed, has no security vulnerabilities, and requires minimal dependencies. Dormant maintenance is not a concern for a focused utility that does one thing well. Install it when you need to parse or create data URIs; skip it if you only handle them occasionally or can use simpler string manipulation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction: pure Python wheel with only two lightweight runtime dependencies (cached-property and typing_extensions).
- Dormant maintenance since 588 days ago, though the repository remains active with a recent commit on 2025-01-03.
License · maintenance · safety
Unlicense (permissive) — Released under the Unlicense, a permissive public-domain equivalent that places no restrictions on use, modification, or distribution.
last release 2025-01-03 (588 days) · last repo commit 2025-01-03 · 58 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 328,132 downloads/mo, #7,559 on PyPI
Alternatives
Verify before relying
from datauri import DataURI
# Parse a data URI
uri = DataURI('data:text/plain;charset=utf-8;base64,VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2cu')
print(uri.mimetype) # 'text/plain'
print(uri.data) # b'The quick brown fox jumped over the lazy dog.'
# Create from string
made = DataURI.make('text/plain', charset='us-ascii', base64=True, data='This is a message.')
print(str(made)) # 'data:text/plain;charset=us-ascii;base64,...'- Whether the package handles all valid data URIs or only the subset described as 'most useful'
- Performance characteristics with large embedded data or many URI operations
- Whether Pydantic integration requires additional setup beyond the example shown
What it is and what it does
python-datauri is a lightweight class for parsing and creating data URIs—the inline data scheme used to embed files, images, and text directly in URLs. It handles the common case of extracting or encoding a mimetype, charset, and base64 flag, then provides access to the decoded payload as bytes or text. The package is intentionally minimal and does not attempt to validate all edge cases; it focuses on the practical subset most developers need.
You use it to parse existing data URIs into their components (mimetype, charset, raw data) or to construct new ones from strings or files. It integrates with Pydantic for type validation in data models. The implementation depends only on cached-property and typing_extensions, making it a low-friction addition to any project that needs to work with embedded data URIs.
Use it for
- Extract image data from a data URI embedded in HTML or JSON to save to disk or process
- Encode a file as a data URI for embedding in web pages or API responses
- Parse and validate data URIs in Pydantic models for REST APIs that accept inline uploads
- Convert between string and binary representations of embedded data without external libraries
- Build data URIs programmatically for testing or generating HTML with inline assets
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with data URIs regularly.
The package is stable, permissively licensed, has no security vulnerabilities, and requires minimal dependencies. Dormant maintenance is not a concern for a focused utility that does one thing well. Install it when you need to parse or create data URIs; skip it if you only handle them occasionally or can use simpler string manipulation.
Install
python-datauri on PyPI
Before you install
Low friction: pure Python wheel with only two lightweight runtime dependencies (cached-property and typing_extensions). Dormant maintenance since 588 days ago, though the repository remains active with a recent commit on 2025-01-03.
License in practice
Released under the Unlicense, a permissive public-domain equivalent that places no restrictions on use, modification, or distribution.
Quickstart
from datauri import DataURI
# Parse a data URI
uri = DataURI('data:text/plain;charset=utf-8;base64,VGhlIHF1aWNrIGJyb3duIGZveCBqdW1wZWQgb3ZlciB0aGUgbGF6eSBkb2cu')
print(uri.mimetype) # 'text/plain'
print(uri.data) # b'The quick brown fox jumped over the lazy dog.'
# Create from string
made = DataURI.make('text/plain', charset='us-ascii', base64=True, data='This is a message.')
print(str(made)) # 'data:text/plain;charset=us-ascii;base64,...'
Verify before relying
- Whether the package handles all valid data URIs or only the subset described as 'most useful'
- Performance characteristics with large embedded data or many URI operations
- Whether Pydantic integration requires additional setup beyond the example shown
Package facts
| License | Unlicense permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagescached-propertytyping_extensions |
| Maintenance | Dormant 588 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 328,132 / month, #7,559 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaLicense :: OSI Approved :: The Unlicense (Unlicense)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: python_datauri-3.0.2-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “data uri parsing”
- python-datauriParses and creates data URIs, extracting or encoding mimetype,…
- lazr.uriParse, manipulate, and generate URIs with a self-contained library…
- uritoolsParses, validates, and composes URIs and URI references according to…
Give your agent the search over MCP, or paste the wish link into any chat.
More Internet packages
Botocore provides low-level, data-driven access to Amazon Web Services APIs, serving as the foundation for the AWS CLI and boto3 libraries.
Install it if you need programmatic access to AWS services.
Provides an async client for AWS services using botocore and aiohttp, allowing you to call AWS APIs asynchronously within asyncio-based applications.
Install it if you need to call AWS services from async Python code; it is the standard way to do so.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides a platform-independent file locking mechanism to coordinate access to files across processes and threads.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides common Protocol Buffer message definitions used across Google Cloud APIs, enabling Python clients to interact with Google services.
See also base2048 · lazr.uri · prison · rison · rfc3986 · webencodings · uritools · arcp · base64io · pyuri