Giter Site home page Giter Site logo

content-tracking's Introduction

content-tracking

quick demo for tracking content views, interactions...

Working with the Tinybird CLI

To start working with data projects as if they were software projects, let's install the Tinybird CLI in a virtual environment. Check the CLI documentation for other installation options and troubleshooting.

cd data-project
virtualenv -p python3 .e
. .e/bin/activate
pip install tinybird-cli
tb auth --interactive

Choose your region: 1 for us-east, 2 for eu

Go to your workspace, copy a token with admin rights and paste it. A new .tinyb file will be created.

tb push --fixtures --push-deps

Data Project

├── datasources
│   ├── content_daily_mv.datasource
│   ├── content.datasource
│   ├── events.datasource
│   ├── events_enriched_mv.datasource
│   └── fixtures
│       └── content.csv
├── endpoints
│   ├── events_demo.pipe
│   ├── fatser_events_demo.pipe
│   └── most_interacted_content.pipe
└── pipes
    ├── content_daily.pipe
    └── enriching_mat.pipe

Sending dummy events

from the root folder, just run

cd ..
python3 data-generator/send_events.py --create_users

or any combination of flags —see python3 data-generator/send_events.py --help— you want.

For our demo we firstly created some thousands users with the --create_users flag, and then used:

python3 data-generator/send_events.py --repeat 1200000  --events 213 --sample 1009

Clean the workspace

cd data-project

If you want to delete all pipes and dataspurces, be sure you have them in your local folder tb pull and run tb workspace clear

$ tb workspace clear
** Current workspace:
----------------------------------------
name: <your_ws_name>
id: <your_id>
role: admin
plan: Build
current: True
----------------------------------------
Do you want to remove all pipes and Data Sources from this workspace? [y/N]: y
** Removing pipe content_daily
** Removing pipe fatser_events_demo
** Removing pipe events_demo
** Removing pipe most_interacted_content
** Removing pipe enriching_mat
** Removing Data Source content
** Removing Data Source events
** Removing Data Source content_daily_mv
** Removing Data Source events_enriched_mv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.