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
Release history Release notifications | RSS feed
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.6.tar.gz
(7.9 kB
view details)
Built Distribution
File details
Details for the file newslynx-url-0.0.6.tar.gz
.
File metadata
- Download URL: newslynx-url-0.0.6.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed7a7f1ff5bbdacded767afadaa301fc3eb3854b09d3379eccd247943ed2ba3e |
|
MD5 | a8f96c75c55f2d52dd15f4bb2e9ab26d |
|
BLAKE2b-256 | 97a522fd834b45d52e39c2c0a4eb6dfc9705bd51205e6f131e22424aa96aa152 |
File details
Details for the file newslynx-url-0.0.6.macosx-10.9-intel.exe
.
File metadata
- Download URL: newslynx-url-0.0.6.macosx-10.9-intel.exe
- Upload date:
- Size: 78.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86268f38753905ccc365697857d7f76732026c2983a155ce41b4e1d46ca85ce6 |
|
MD5 | 0f3de33701dad42723804872e8e754da |
|
BLAKE2b-256 | ac0dc205a80358768872982d687bb7052254fd132822b108d6a160a289c4e8da |