Skip to main content

Basic system for tracking website visits and redirecting urls

Project description

web_traffic_monitor

under construction

Documentation
PyPI

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:

  1. Logs visits to a webpage
  2. 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


Download files

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

Source Distribution

web_traffic_monitor-0.3.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

web_traffic_monitor-0.3.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file web_traffic_monitor-0.3.0.tar.gz.

File metadata

  • Download URL: web_traffic_monitor-0.3.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for web_traffic_monitor-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ec5a7c557287236ddfbf28d76ad7f23c5be276aef5bac12c5ec738b734f446f5
MD5 44eff4fd9d527c055faee244c807afc1
BLAKE2b-256 fe6c0dc7eea9c8f3dc8fbdb12c7889513e9a4fd0ffe394019ac82cc592bffada

See more details on using hashes here.

File details

Details for the file web_traffic_monitor-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for web_traffic_monitor-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6fa645ccdf155b8dc105a268efdced6d6ead7f7947f05055ae457c3ed3990ac
MD5 3718596fb39c897012dd788a82c1fe9c
BLAKE2b-256 88c4ea38991f4e97bb2836bf966f605c548b17b6d6e703a484013ab779fe16ca

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