Validating, cleaning, and compactifying URLs simplified.
Project description
neturalise-link
What are the objectives?
- Remove trackers
- Remove referrers
- Identify malicious intent
- Verify URL validity
- Improve URL load speeds
Getting started
Prerequisites
- Have python3 installed (e.g. using anaconda/homebrew)
- Have build installed -
python3 -m pip install --upgrade build
Building the package
Navigate to root directory of the project and run: python3 -m build
Install the package found in neutralise-link/dist/
in your repo using pip3 install
followed by the relative path of the .tar.gz
package file located in the project.
How does it work?
Having imported neutralise-link
you may use the neutralise
function which takes a URL string as the argument.
By default, the function will return None
in two cases:
- The link is invalid
- The link is deemed malicious
You may override the 2nd case by calling the function with the optional parameter,
safe=false
.
Example Code
from neutralise_link import neutralise
def main(url: str) -> str:
"""Validate user URL input for storing."""
url = neutralise(url=url, safe=True)
if not url:
print("URL is malformed or malicious.")
print("URL is safe")
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
neutralise_link-0.0.1.tar.gz
(14.9 kB
view hashes)
Built Distribution
Close
Hashes for neutralise_link-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff8d422920197b2cf2a076b49ffa46eb53a29a5332175ab9654da495ff9be661 |
|
MD5 | de04873026f4ca631ad3d96d8fd31a19 |
|
BLAKE2b-256 | e8d30d4ec29d679e533704cc57a044ec5da61bd0289661e5077051545734de4f |