Skip to main content

Tools for taming links.

Project description

travis-img siegfried ======== Tools for taming lynx.

Install

pip install siegfried

Test

requires nose

nosetests

Usage

This module contains various methods that are used throughout newslnyx. but the main functions are unshorten_url, is_article_url, and prepare_url:

from siegfried import (
  unshorten_url, is_article_url, prepare_url
)

print unshorten_url('bit.ly/1j3SrUC')
# http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism/

print is_article_url(
  'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism'
  )
# True

print is_article_url(
  'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism',
  pattern = r'.*towcenter\.org/blog/.*'
)
# True

import re
pattern = re.compile(r'.*towcenter\.org/blog/.*')
print is_article_url(
  'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism',
  pattern = pattern
)
# True

print prepare_url(
  'http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism/?q=lfjad&f=lkfdjsal'
  )
# http://towcenter.org/blog/tow-fellows-brian-abelson-and-michael-keller-to-study-the-impact-of-journalism

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

siegfried-0.0.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

siegfried-0.0.3.macosx-10.9-intel.exe (72.2 kB view details)

Uploaded Source

File details

Details for the file siegfried-0.0.3.tar.gz.

File metadata

  • Download URL: siegfried-0.0.3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for siegfried-0.0.3.tar.gz
Algorithm Hash digest
SHA256 065cc2367375419f5fedbe3733b7b3fa29ce1501e9bf0c20e3d8386518b54b1a
MD5 a0a60ac659679692ae4e0da709aae324
BLAKE2b-256 0aadd1caaa42549e926732febad31c1be4394180a426a4be77b82820fb7a9c34

See more details on using hashes here.

File details

Details for the file siegfried-0.0.3.macosx-10.9-intel.exe.

File metadata

File hashes

Hashes for siegfried-0.0.3.macosx-10.9-intel.exe
Algorithm Hash digest
SHA256 5aa3a777561326492be8d3ce9aadfaf1a530ee2d5df4e42aec3660e03d5f639d
MD5 2fd120459040eb42e10c203953d232de
BLAKE2b-256 63d7dbb033d9a50eb6b2a1e5c0ad108cf0c6f6d2bac8f8774dcdcaacc846fc19

See more details on using hashes here.

Supported by

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