Skip to main content

A collection of util functions for extracting domains from urls.

Project description

domain_utils

https://img.shields.io/pypi/v/domain_utils.svg CircleCI Documentation Status

A collection of util functions for extracting domains from urls.

Repo: https://github.com/mozilla/domain_utils

Install:

pip install domain_utils

Use:

import domain_utils as du
# Return just the url `my.domain.cloudfront.net/a/path/to/a/file.html`
du.get_stripped_url('https://my.domain.cloudfront.net/a/path/to/a/file.html?a=1')
# Return just the eTLD+1 `domain.cloudfront.net`
du.get_stripped_url('https://my.domain.cloudfront.net/a/path/to/a/file.html?a=1')

This package was originally extracted from openwpm-utils.

Community Participation Guidelines

This project is governed by Mozilla’s code of conduct and etiquette guidelines.

For more details, please read the Mozilla Community Participation Guidelines.

For more information on how to report violations of the Community Participation Guidelines, please read our How to Report page.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.5.0 (2020-04-03)

  • Remove support for python 3.5

  • Handle more cases in get_stripped_url and change default behavior:

    • handle a lack of scheme

    • boolean flag to return or not non http urls - default is to return them which is a change of behavior as previously they would not return

    • Use netloc by default instead of hostname with a boolean flag to use hostname.

0.4.0 (2020-03-25)

  • Remove py27 support

0.3.0 (2020-03-25)

  • Restore py27 support.

  • Last version with py27 support.

  • Remove tox

0.2.0 (2020-03-24)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

domain_utils-0.5.0.tar.gz (20.4 kB view hashes)

Uploaded Source

Built Distribution

domain_utils-0.5.0-py2.py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page