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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file pyredirect-1.0.0.tar.gz.

File metadata

  • Download URL: pyredirect-1.0.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.3

File hashes

Hashes for pyredirect-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9d63c576ce4b9e413ce7c0fc40424a5968609513b632d9f38617c9808cc17904
MD5 6e820cd5095b147d3a08801918c23e7c
BLAKE2b-256 3eba07795754c5cca90db0e95c71289f5dbeeee358ddc84084bf74cc33e0c4f2

See more details on using hashes here.

File details

Details for the file pyredirect-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyredirect-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.3

File hashes

Hashes for pyredirect-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 863a5364313a145ddfb69bdf31bc749883f6e2a5dd3671e85abdec23bcd210e7
MD5 56a7b29a59e967fd32e220e1337d2aaa
BLAKE2b-256 064834b324eb60f5c27d036ec277604e22e2e59b0abc739651f5769b157b76e0

See more details on using hashes here.

Supported by

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