Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dotmpe/uriref
RegEx URIRef parser
https://github.com/dotmpe/uriref
Last synced: 11 days ago
JSON representation
RegEx URIRef parser
- Host: GitHub
- URL: https://github.com/dotmpe/uriref
- Owner: dotmpe
- Created: 2011-06-28T08:43:28.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2021-12-23T17:49:24.000Z (almost 3 years ago)
- Last Synced: 2024-10-12T04:27:46.806Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 274 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.rst
Awesome Lists containing this project
README
Python uriref
==============
:version: 0.0.3-dev-20170106
:last-update: 2020-10-11
:description:
URL and URN parser written in regular expressions.
Based on RFC 2396 BNF terms, update to RFC 3986 planned but not started.
:license: FreeBSD
:status:
.. image:: https://requires.io/github/bvberkum/uriref/requirements.svg?branch=master
:target: https://requires.io/github/bvberkum/uriref/requirements/?branch=master
:alt: Requirements Status.. image:: http://img.shields.io/travis/bvberkum/uriref.svg
:target: http://travis-ci.org/bvberkum/uriref
:alt: Build Status.. image:: https://badge.fury.io/gh/bvberkum%2Furiref.png
:target: http://badge.fury.io/gh/bvberkum%2Furiref
:alt: GIT.. image:: https://img.shields.io/github/license/bvberkum/uriref.svg
:alt: repo license.. image:: https://img.shields.io/github/issues/bvberkum/uriref.svg
:alt: issues.. image:: https://img.shields.io/github/commit-activity/y/bvberkum/uriref.svg
:alt: commits per year.. image:: https://img.shields.io/maintenance/yes/2017.svg
:alt: maintained last yearThis is an experimental library. Do not use it in production unless you are
prepared to put in time for testing that it does what you need... figure:: doc/stdlib-comparison.svg
:target: doc/stdlib-comparison.png
:class: diagramuriref reference matching, compared to stdlib urlparse for several
iteration-counts. The implementations are not tested for identical
operation.The diagram shows constant times for each iteration count.
The regex implementation outperforms stdlib's urlparse module
by almost 100%. The latter runs at slighty above 6e-4 seconds,
with the former at ~3.5e-4 seconds (at my machine).Memory profiling remains to be done, I expect regex is taking a lot
more.There are almost 100 tests, a good bunch of which need to be reviewed (33
failures). The modules has 34% test coverage.Installation of library and `parseuri.py` is via::
python setup.py install
For lib source see `uriref `__.
Usage
-----
Examples::uriref-cli.py -qs absolute # Quietly validate URL reference
uriref-cli.py --pretty # Parse URI parts to human readable table
uriref-cli.py -O yaml # Parse URI parts to YAML
uriref-cli.py --pretty -O json # etc.See also ``bin/examples.py``.
Tests
-----
::python test/py/main.py
Or::
make test
`Coverage report `_
and `test results `_ are available in html.There are tests that show for which sort of URLs uriref is compatible with
stdlib urlparse.TODO The setup should be fixed by splitting up the expected test results to
function. Currently there is one set of parameters for all test methods... XXX: rSt includes dont work on github
.. .. include:: uriref/__init__.py
:start-line: 1
:end-line: 189.. vim:ft=rst: