Registry / http-networking / rfc3986-validator

rfc3986-validator

JSON →
library0.1.1pypypi✓ verified 27d ago

rfc3986-validator is a pure Python library designed for validating Uniform Resource Identifiers (URIs) according to RFC 3986. It offers a single validation function. The library is currently at version 0.1.1, released in October 2019, and is designated as '2 - Pre-Alpha' development status, indicating a very inactive release cadence and experimental nature.

pip install rfc3986-validator
INSTALL
IMPORT
SIG · RFC3986-VALIDATOR
R
rfc3986-validator
http-networkingpythonv0.1.1
Install
1.6s avg
Import
56ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.056s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.056s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

validate_rfc3986
from rfc3986_validator import validate_rfc3986

The `validate_rfc3986` function checks if a given string conforms to the RFC 3986 URI syntax. It can also validate against specific rules like 'URI_reference'.

from rfc3986_validator import validate_rfc3986 # Validate a full URI print(validate_rfc3986('http://example.com/path?query=val#fragment')) # Expected: True # Validate a URI reference (e.g., relative path) print(validate_rfc3986('//example.com/path', rule='URI_reference')) # Expected: True # Example of an invalid URI print(validate_rfc3986('http://foo.bar?q=Spaces should be encoded')) # Expected: False
Debug
Known issues
gotchaThis library is classified as '2 - Pre-Alpha' and has not seen updates since October 2019. Its long-term maintenance and compatibility with newer Python versions (beyond 3.8) are uncertain.
fix
For actively maintained and feature-rich RFC 3986 validation, parsing, and building capabilities, consider using the `rfc3986` library (without the '-validator' suffix) which is at version 2.0.0 and actively developed.
affects: <=0.1.1
gotchaThe `rfc3986-validator` library provides a single `validate_rfc3986` function for basic URI validation. It does not offer granular control over URI components (like scheme, host, path, query) or methods for constructing URIs.
fix
If your application requires more advanced URI handling, such as parsing components, building URIs, or custom validation rules (e.g., allowing only specific schemes or hosts), the `rfc3986` library offers `uri_reference`, `urlparse`, `validators.Validator` classes, and `URIBuilder` for these purposes.
affects: <=0.1.1
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'rfc3986_validator'
The rfc3986-validator library is not installed in the current Python environment or the module name is misspelled.
fix
pip install rfc3986-validator
ImportError: cannot import name 'validate' from 'rfc3986_validator'
The function name 'validate' does not exist in the 'rfc3986_validator' module; the correct function name is 'validate_uri'.
fix
from rfc3986_validator import validate_uri
AttributeError: module 'rfc3986_validator' has no attribute 'validate'
After importing the 'rfc3986_validator' module, an attempt was made to call a non-existent attribute 'validate' instead of the correct function 'validate_uri'.
fix
import rfc3986_validator
rfc3986_validator.validate_uri("http://example.com")
TypeError: expected string or bytes-like object
The 'validate_uri' function received a non-string argument, but it expects a string or bytes-like object for URI validation.
fix
validate_uri("http://example.com") # Ensure the input is a string
Upgrade
Version history
0.1.1latest on PyPI · released Oct 28, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Resources
rfc3986-validator — pip install rfc3986-validator · libregistry