Basic system for tracking website visits and redirecting urls
Project description
web_traffic_monitor
under construction
Usage
import web_traffic_monitor
client = web_traffic_monitor.Client()
Client functionality
log_visit( slug, dt: defaults to current datetime )
Logs a visit for a given slug at a specified datetime.
get_active_redirect( slug )
Returns the active redirect for a given slug, or None if it doesn't exist.
add_redirect( slug, redirect, dt: defaults to current time )
Deactives existing redirect for given slug, and adds a new redirect at given datetime.
deactivate_redirect( slug, dt: defaults to current time )
Deactivates active redirect for a given slug, by specifying and END_DATETIME = dt
Description
This repo serves a couple of basic purposes:
- Logs visits to a webpage
- Redirects slugs to new addresses
The functionality is pretty basic, and the most important piecs are contained in the database schema. A DB class (built for sqlite) is provided with the package. Feel free to overwrite the class functionality if you want to use your own database engine.
Schema
visits
| slug | datetime |
|---|---|
| /home | 2023-09-22 08:15:00+0000 |
| /about-us | 2023-09-23 14:32:00+0000 |
| /contact | 2023-09-24 10:45:00+0000 |
| /products/latest-deals | 2023-09-25 18:20:00+0000 |
| /blog/post-1 | 2023-09-26 09:10:00+0000 |
| /services | 2023-09-27 12:55:00+0000 |
| /blog/post-2 | 2023-09-28 16:40:00+0000 |
| /portfolio/project-xyz | 2023-09-29 11:25:00+0000 |
| /products/sale-items | 2023-09-30 08:50:00+0000 |
| /blog/post-3 | 2023-10-01 13:05:00+0000 |
redirects
| id | slug | redirect | start_datetime | end_datetime |
|---|---|---|---|---|
| 1 | /old-page | /new-page1 | 2023-09-22 08:15:00+0000 | 2023-09-23 14:32:00+0000 |
| 2 | /old-page | /new-page2 | 2023-09-23 14:32:00+0000 | 2023-09-24 10:45:00+0000 |
| 3 | /old-page | /new-page3 | 2023-09-24 10:45:00+0000 | |
| 4 | /coming-soon | /modern-version | 2023-09-23 14:32:00+0000 | 2023-09-24 10:45:00+0000 |
| 5 | /coming-soon | /modern-version2 | 2023-09-24 10:45:00+0000 | |
| 6 | /outdated-info | /updated-info | 2023-09-25 18:20:00+0000 | |
| 7 | /contact-old | /contact-new | 2023-09-26 09:10:00+0000 | |
| 8 | /expired1 | /events/event-2021 | 2023-09-22 08:15:00+0000 | 2023-09-23 14:32:00+0000 |
| 9 | /expired2 | /new-offer | 2023-09-23 14:32:00+0000 | 2023-09-24 10:45:00+0000 |
| 10 | /expired3 | /fallback-page | 2023-09-24 10:45:00+0000 |
Author
James Kabbes
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file web_traffic_monitor-0.2.0.tar.gz.
File metadata
- Download URL: web_traffic_monitor-0.2.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.1 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cf43423f0ae51d3d25170eeb29b1612f712152af91ccf68c44993dafe19a745
|
|
| MD5 |
7c16a9ef804e4255af0a92114472b780
|
|
| BLAKE2b-256 |
1d8391dff1a67b04fde31240e6d42e1ccbcf599effdad4561d473036be3d2cb2
|
File details
Details for the file web_traffic_monitor-0.2.0-py3-none-any.whl.
File metadata
- Download URL: web_traffic_monitor-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.63.1 importlib-metadata/4.8.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d03136d906bf9844c38993f66abf8f8b8ac527f52b69037c4e07e0483d0d7a5
|
|
| MD5 |
05318ae8736d1b7214e0f163e5030606
|
|
| BLAKE2b-256 |
e35d627047b17978b1f0116ea868a0432d1afd9aeefa11d51f6016d763a86d32
|