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
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
pyredirect-1.0.0.tar.gz
(2.7 kB
view hashes)
Built Distribution
Close
Hashes for pyredirect-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 863a5364313a145ddfb69bdf31bc749883f6e2a5dd3671e85abdec23bcd210e7 |
|
MD5 | 56a7b29a59e967fd32e220e1337d2aaa |
|
BLAKE2b-256 | 064834b324eb60f5c27d036ec277604e22e2e59b0abc739651f5769b157b76e0 |