Skip to main content

tools for parsing, extracting, reconciling, and unshortening urls

Project description

A newslynx-opinionated collection of utilities for dealing with urls.

Install

pip install newslynx-url

Test

requires nose

nosetests

Usage

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

from newslynx_url 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

newslynx-url-0.0.5.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

newslynx-url-0.0.5.macosx-10.9-intel.exe (78.8 kB view details)

Uploaded Source

File details

Details for the file newslynx-url-0.0.5.tar.gz.

File metadata

File hashes

Hashes for newslynx-url-0.0.5.tar.gz
Algorithm Hash digest
SHA256 193f7d65a13bcffc25a9dfd5b2aff3d109175c20d6abe7610d1353530d56e434
MD5 18d5722cc0f5bbb6fdf8ef3608282145
BLAKE2b-256 9424c6f4c68e5ab7e91c52cf6e148302c033301c3ebc66788af52f4db84049fa

See more details on using hashes here.

File details

Details for the file newslynx-url-0.0.5.macosx-10.9-intel.exe.

File metadata

File hashes

Hashes for newslynx-url-0.0.5.macosx-10.9-intel.exe
Algorithm Hash digest
SHA256 c44ff4cba122ef4020d071bffce91122c276ae70fa263cac32eb0110e8a199cc
MD5 c595e02a3bafe46d981959d091533c26
BLAKE2b-256 ed2a76f2535d3a2dd10fec860e870d31b2cd8757cab54fe13a5a3f56c6f3c1eb

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