Skip to main content

Sort-friendly URI Reordering Transform (SURT) python package.

Project description

Sort-friendly URI Reordering Transform (SURT) python package.

Usage:

>>> from surt import surt
>>> surt("http://archive.org/goo/?a=2&b&a=1")
'org,archive)/goo?a=1&a=2&b'
>>> surt("http://archive.org/goo/?a=2&b&a=1", trailing_comma=True)
'org,archive,)/goo?a=1&a=2&b'
>>> surt("http://123.456.78.910/goo/?a=2&b&a=1", reverse_ipaddr=False)
'123.456.78.910)/goo?a=1&a=2&b'

Installation:

pip install surt

Or install the dev version from git:

pip install git+https://github.com/internetarchive/surt.git#egg=surt

More information about SURTs: http://crawler.archive.org/articles/user_manual/glossary.html#surt

This is mostly a python port of the webarchive-commons org.archive.url package. The original java version of the org.archive.url package is here: https://github.com/iipc/webarchive-commons/tree/master/src/main/java/org/archive/url

This module depends on the tldextract module to query the Public Suffix List. tldextract can be installed via pip

Build Status

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

surt-0.3.1.tar.gz (9.8 kB view details)

Uploaded Source

File details

Details for the file surt-0.3.1.tar.gz.

File metadata

  • Download URL: surt-0.3.1.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Python-urllib/3.7

File hashes

Hashes for surt-0.3.1.tar.gz
Algorithm Hash digest
SHA256 24167eb6c01f24f757eef9bca6bf0ec089ec05ad5b6213c3b727a5e58c0c4720
MD5 da1fa592fc7ff7a983cdc4840fa9064b
BLAKE2b-256 4752500de6c33a1b92fef6a21c924ec7b7fc04cf178c751f28ad66d6e85af22d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page