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
Release files for siegfried 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| siegfried-0.2.4.tar.gz | 8.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| siegfried-0.2.4.macosx-10.9-intel.exe | Details |
Total release size: 85.3 kB
Release files / siegfried-0.2.4.tar.gz
| Download URL | siegfried-0.2.4.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec446f4a6a4b3397c75a6225b8722a606cdedbb5b79f158577ca05ead113c799
|
|
BLAKE2b-256 checksum How to use checksums |
b22ed882416c1cbb5292a18b1ec41904efe26cc0ac62bf9eb68237e643a10867
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / siegfried-0.2.4.macosx-10.9-intel.exe
| Download URL | siegfried-0.2.4.macosx-10.9-intel.exe |
|---|---|
| Size | 77.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a922b98e935367cbdb6f9b779ba00605a07afc33baca970062c94b6ac52891f4
|
|
BLAKE2b-256 checksum How to use checksums |
c93b01e0baac7a96956475028149a5a7677cd8ac15a57dbcdd04e9617b73b271
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |