Skip to main content

vaknl-user

Defines the vaknl User dataclass. A user (here identified by a dmp_user_id) is an object that is defined by website clickstream data as a basis. The User class contains functions that can transform raw Firestore website clickstream data to well defined Event dataclasses and update the statistics of the User accordingly. These Event dataclasses are read and translated into user information. The User dataclass also includes methods to read from and write to Firestore.

Authors

Date Name
2020-07-17 Merijn van Es

Prerequisites

Firestore read and write permissions within the Google Cloud Platform (GCP), if one wants to make use of the Firestore functionality.

Project structure

vaknl-user
    |__ data
        |__ ...                                     # Data used for testing.
    |__ tests
        |__ event
            |__ __init__.py                         # Empty, but required for package.
            |__ test_create_event.py                # Unit testing on create_event() function.
            |__ test_event.py                       # Unit testing on Event and Events dataclasses.
            |__ test_search_page_search_query.py    # Unit testing on SearchPageSearchQuery (Event) dataclass.
        |__ user
            |__ __init__.py                         # Empty, but required for package.
            |__ test_statistics.py                  # Unit testing on Statistics dataclass.
            |__ test_user.py                        # Unit testing on User dataclass.
        |__ __init__.py
        |__ README.md                               # Explanation on testing.
        |__ utils.py                                # Utility functions for testing.
    |__ vaknl_NBC                                   # Package that creates a NBC API on local data.
        |__ __init__.py                             # Includes NBC class.
        |__ (NBC.pkl)                               # NBC data; should not be included in distributed versions.
    |__ vaknl_user
        |__ event
            |__ __init__.py                         # Imports all package modules and contains create_event function.
            |__ event.py                            # Contains Event and Events dataclasses.
            |__ filter.py                           # Contains all filter event dataclasses.
            |__ other.py                            # Contains all other event dataclasses.
            |__ pageview.py                         # Contains all pageview event dataclasses.
            |__ reservation.py                      # Contains all reservation event dataclasses.
            |__ utils.py                            # Utility functions for testing.
        |__ user
            |__ __init__.py                         # Imports all package modules.
            |__ statistics.py                       # Contains all statistic dataclasses and subsidiaries.
            |__ user.py                             # Contains User dataclass.
            |__ utils.py                            # Utility functions for testing.
        |__ __init__.py                             # Empty, but required for package.
    |__ LICENSE                                     # Licensing information.
    |__ MANIFEST.in                                 # Adds and removes files from distribution.
    |__ README.md                                   # Project explanation.
    |__ setup.py                                    # Package build script.

User dataclass

Can be found under vaknl_user.user.user.User and has the following useful methods:

import_statistics(self, client: utils.firestore.Client)

Imports all statistics of the User from Firestore.

export_statistics(self, client: utils.firestore.Client)

Exports all statistics of the User to Firestore.

create_user_from_clickstream(self, client: firestore.Client)

Imports all raw clickstream event data from Firestore and updates the User accordingly. Overwrites all existing statistics.

update_user_from_clickstream(self, client: firestore.Client)

Imports all raw clickstream event data from Firestore with a timestamp greater than statistics.general.activity_last_timestampand updates the User accordingly. Adds statistics to existing.

Event dataclass

This dataclass has many children (can be found in the same package directory under filer.py, other.py, pageview.py or reservation.py, which represent the individual clickstream events of interest. The Event dataclass can be found under vaknl_user.event.event.Event and should, in practice, only be called through the methods of the User dataclass.

Events dataclass

This dataclass contains a list of Event instances, but has some useful methods that make it more desirable than a plain list. The Events dataclass can be found under vaknl_user.event.event.Events and should, in practice, only be called through the methods of the User dataclass.

create_event(data: dict)

The create_event() function is used to transform single raw clickstream event dictionaries to a instance of Event (and one of it child dataclasses). The create_event() function can be found under vaknl_user.event.event.Event and should, in practice, only be called through the methods of the User dataclass.

Release files for vaknl-user 2.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vaknl-user 2.0.6
File Size Uploaded
vaknl-user-2.0.6.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vaknl-user 2.0.6
File Interpreter ABI Platform
vaknl_user-2.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 35.7 kB

Release files / vaknl-user-2.0.6.tar.gz

Download URL vaknl-user-2.0.6.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ce386383246b0fa00a63f9a86ce114c9f3391b0b01b57745ecb245c153007772
BLAKE2b-256 checksum
How to use checksums
44b8567eee6d31f8d81339fe849309fd7916faa6d2fa2c991b2580b2f72a9781
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

Release files / vaknl_user-2.0.6-py3-none-any.whl

Download URL vaknl_user-2.0.6-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
713cbd26ae78a50d20aec64d31b7265b693f385c777983bbf5e758519461e66f
BLAKE2b-256 checksum
How to use checksums
830646128cc1d8ee65c32bfce0068586dfd007da2f1a46b4cff3acab64ee2eda
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.9

Release history Release notifications | RSS feed

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

This release

2.0.6 This release

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.21

2 release files

1.0.20

2 release files

1.0.19

2 release files

1.0.16

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page