Tools for taming links.
Project description
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
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
siegfried-0.0.6.tar.gz
(7.9 kB
view details)
Built Distribution
File details
Details for the file siegfried-0.0.6.tar.gz
.
File metadata
- Download URL: siegfried-0.0.6.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd21c470bc654cfe3b267f8d219babc99a2a06950e49f42e7d94a9f6d7cd1ecf |
|
MD5 | cbfc39a12250afc49a898c317483bd2c |
|
BLAKE2b-256 | f735bf5e882a258a260d1ec2cbe7e471fe8fecd50c7ae8eb8900e18f14c911e2 |
File details
Details for the file siegfried-0.0.6.macosx-10.9-intel.exe
.
File metadata
- Download URL: siegfried-0.0.6.macosx-10.9-intel.exe
- Upload date:
- Size: 72.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 049def5881d5a7772f84c9183be9859ad527890a14c949434a237090a6e97984 |
|
MD5 | fc697c8373476eaaac914167ee9c8039 |
|
BLAKE2b-256 | bf0ff4a57c80d4a8df2860f2d173e2cabd163029920b0b7311e95ccdaaadbfdf |