Skip to main content

Pyredirect allows you to create redirections by user-agent.

Project description

Install

  • Linux

    python3 -m pip install pyredirect

  • Windows

    python -m pip install pyredirect

Author

Discord : Lactua#1806

Github: https://github.com/lactua

Documentation

Before doing anything, import the class Redirection from the module.

from pyredirect import Redirection
  • Create a redirection

    To create a redirection, use the method create from the Redirection class.

    Parameter Type Description
    name string The name of the redirection
    redirections dictionnary Redirections name and their url

    Example :

    from pyredirect import Redirection
    
    redirection = Redirection.create(
        name = 'name',
        redirections = {
            'default': 'https://google.com',
            'mozilla': 'https://youtube.com'
        }
    )
    
  • Get a redirection

    To get a redirection init the Redirection class.

    Parameter Type Description
    name string The name of the redirection
    secret_key string The secret key of the redirection that allows you to manage it

    Example :

    from pyredirect import Redirection
    
    redirection = Redirection(
        name = 'name',
        secret_key = 'wVXT8ZI81LzPPGp'
    )
    
  • Delete a redirection

    To delete a redirection you must have a Redirection object.

    Example :

    from pyredirect import Redirection
    
    redirection = Redirection(
        name = 'name',
        secret_key = 'wVXT8ZI81LzPPGp'
    )
    
    redirection.delete()
    

    or

    from pyredirect import Redirection
    
    redirection = Redirection.create(
        name = 'name',
        redirections = {
            'default': 'https://google.com',
            'mozilla': 'https://youtube.com'
        }
    )
    
    redirection.delete()
    

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

pyredirect-1.0.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

pyredirect-1.0.0-py3-none-any.whl (2.6 kB view hashes)

Uploaded 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