Skip to main content

vaknl-user

Defines the vaknl User class. A user (here identified by a dmp_user_id) is a 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. These Event dataclasses are read and translated into user information. The User class also includes functions to write the user to Firestore.

Prerequisites

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

User

class User

User class where user object is identified by dmp_user_id user.

create_event(clickstream_event_json) @staticmethod

Assigns event to a (event-)dataclass based on event clickstream json.

update_funnel_step(statistics, event) @staticmethod

Updates the funnel step the user is in.

update_statistics(event)

Update user statistics with event.

add_event(clickstream_event_json)

Adds event to user based on clickstream json and updates statistics.

add_multiple_events(clickstream_event_json_list)

Adds multiple events to event_list at a time.

sort_events_by_timestamp()

Sort self.events (event list) ascending on timestamp.

events_to_dict()

Outputs list of event dicts (decoded from the list of event dataclasses).

to_firestore()

Writes user to firestore.

create_user_from_clickstream()

Gets all available website clickstream data from Firestore for the given dmp_user_id and fills the User class with information.

General script functions

Mostly functions that allow the user of this package to manually set private variables in this module.

set_project_id(name: str)

Set global variable _project_id, which represents the GCP project id. When function is called, it also automatically updates the firestore client.

set_firestore_collection_source(name: str)

Set global variable _firestore_collection_source, which should be the name of the Firestore source collection, from which the website clickstream data is gathered.

set_firestore_collection_destination(name: str)

Set global variable _firestore_collection_destination, which should be the name of the Firestore destination collection to which the user is written.

create_firestore_client(project_id: str)

Sets up Firestore client.

Event

Contains Event dataclass and all sub-dataclasses that can go multiple layers deep.

Metadata

Release files for vaknl-user 1.0.18

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 1.0.18
File Size Uploaded
vaknl-user-1.0.18.tar.gz 10.1 kB Details

Built distribution (wheel)

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

Total release size: 21.0 kB

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

Download URL vaknl-user-1.0.18.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4a592bc5f5fdf0f5aa2d41e13b54a978877fc8b10abf7b1247e738d40480e607
BLAKE2b-256 checksum
How to use checksums
80cdf1ba3708e098795bb4c47e30cc3181640d41f7add5f1c39ee457195ff397
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

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

Download URL vaknl_user-1.0.18-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a696bc9bc6b05cf398027f24834a76a152e6b4494a9e26d8701d92d664c892b2
BLAKE2b-256 checksum
How to use checksums
5d41b23eae3e5d92ff323c43656d9ba53bf1e14a23f6f76490c697e9ad143e91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

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

2.0.6

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

This release

1.0.18 This release

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