Skip to main content

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

Release files for newslynx-url 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for newslynx-url 0.1.0
File Size Uploaded
newslynx-url-0.1.0.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for newslynx-url 0.1.0
File Interpreter ABI Platform
newslynx-url-0.1.0.macosx-10.9-intel.exe Details

Total release size: 86.6 kB

Release files / newslynx-url-0.1.0.tar.gz

Download URL newslynx-url-0.1.0.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8fb0c17840ba1f27adf44402f1fd0eadf5426ebee38054c1ee0295c9779cacbd
BLAKE2b-256 checksum
How to use checksums
99c6b5d4ab7ea5e73b699acc23d7f6dc51c87bbd30770a971a92d35f551dc587
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / newslynx-url-0.1.0.macosx-10.9-intel.exe

Download URL newslynx-url-0.1.0.macosx-10.9-intel.exe
Size 78.8 kB
Tags Source
SHA-256 checksum
How to use checksums
10882293c4cc71b218605df61eb58113fb6a7b97a60c1dc8eacb8e5d7f459ccc
BLAKE2b-256 checksum
How to use checksums
7bc8f6685a419260d27d94de5801e85f24e8c1b84046c1f740544969d3715d4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page