• Stars
    star
    271
  • Rank 151,717 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 6 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Analyse your swiggy orders 🍔

swiggy-analytics

version GitHub license

Overview image

swiggy-analytics is CLI for fetching past orders from Swiggy and storing them in a local SQLLite DB. It also displays basic stats on your order history in the terminal, such as your most frequently order dish, your monthly expenditure, weekday wise distribution of orders and much more. For more advanced users, who wish to perform their own analysis, can do so by using the sqlite3 db file which is generated.

NOTE: Only supported by Python3. Seriously, if you're still using Python2, please STOP. I've tested it on Python3.5+ on OSX and Ubuntu 18.04 Vagrant machine.

Important Disclaimer

This tool needs to login to your Swiggy account and fetch the order history. The account username lives on your local file system. If you don't feel comfortable entering these details, you can audit the code yourself to be sure that this information is not used in any evil way. There's an OTP which is sent to your registered mobile number, which is required everytime you fetch orders. Cheers!

Getting Started

Installation

pip install swiggy-analytics

Setting up account

If you run swiggy-analytics for the first time, it will prompt you for your registered mobile number. An OTP will be sent to your phone and after the session is authenticated, a file .swiggy-analytics-config.ini is created in your home directory. The file contains your username to your Swiggy account, so you don't have to re-enter this detail everytime you run the tool.

You can also regenrate your config file by explictly passing the flag with the command executable, such as: swiggy-analytics --configure

NOTE: Username is your phone number which you have registered with your Swiggy account.

Quickstart

swiggy-analytics --save

fetch

  • If you want to persist the orders data to a local database, you should use the --save flag. This option would generate a swiggy.db file in your current working directory.
  • In case you just want to run it once and see basic stats, you can skip this flag and the tool will hold the data in an in memory DB which would last only till the program is running.

Advanced

You can write your own SQL queries by importing swiggy.db in your DB tool. I personally used Metabase and setup a dashboard with interesting charts presenting patterns on my ordering behaviour.

metabase-1 metabase-2

Credits

  • @knadh for the print_bars function which is used to draw simple bar graph on the terminal.
  • Python Prompt Toolkit for helping me flesh out a good looking CLI so easily! <3 this library.

Contribution

PRs on Feature Requests, Bug fixes are welcome. Feel free to open an issue and have a discussion first.

License

MIT

Disclaimer

This tool is only intended for personal use and is a simple demonstration. It is in open domain and I am not responsible if you use it and violate any TnC. Or as they say, it's for science.

More Repositories

1

doggo

🐶 Command-line DNS Client for Humans. Written in Golang
Go
3,034
star
2

awesome-investing

💸💸 Curated list of investment & finance related resources
1,902
star
3

homelab

Infra-as-code for my personal home server setup
HTML
254
star
4

barreldb

A disk based KV store (based on Bitcask implementation)
Go
166
star
5

kubekutr

Cookie cutter templating tool for scaffolding K8s manifests
Go
159
star
6

calert

🔔 Send alert notifications to Google Chat via Prometheus Alertmanager
Go
153
star
7

gullak

A no-frills expense tracker app enabling quick logging of expenses in natural language, using LLMs for parsing and categorization.
Vue
75
star
8

monkeybeat

Generate a random stock portfolio and find out if it beats the markets!
Go
64
star
9

nomad-monitoring

Collection of jobspecs and Grafana dashboards for end to end monitoring of Nomad clusters
HCL
53
star
10

nomad-vector-logger

A daemon which continuously watches jobs running in a Nomad cluster and templates out a Vector configuration file which can be used to collect application logs enriched with Nomad metadata.
Go
53
star
11

webkin

💻 CLI tool to send webpages to kindle. 📔
Python
50
star
12

nomad-events-sink

An events collection agent which processes Nomad Events and dumps to external sink providers like HTTP
Go
49
star
13

nomctx

Faster way to switch between clusters and namespaces in nomad
Go
47
star
14

flexit

Responsive grid based on CSS Flexbox
HTML
45
star
15

notes

Collection of my byte sized notes on programming and other random topics.
Makefile
37
star
16

nomad-external-dns

Set external DNS records for Nomad services
Go
36
star
17

cloak

Securely share sensitive text with others
Go
33
star
18

store-exporter

Utility to extract metrics from arbitary data stores in Prometheus format
Go
32
star
19

clickhouse-keeper-example

Setup ClickHouse cluster with replication using `clickhouse-keeper`
Makefile
30
star
20

website

Personal site, made using Zola
HTML
30
star
21

fate

Browse FontAawesome icons from your shell
Python
29
star
22

coredns-nomad

Go
29
star
23

terraform-provider-kite

Terraform provider for managing long term portfolio with Zerodha Kite
Go
24
star
24

Insta-notFollow

A Flask web app to find out people whom you follow on Instagram but they don't follow you back 😈
HTML
22
star
25

toru

Toru is a Go module proxy with caching and rewrite capabilities
Go
22
star
26

balance

Minimal Golang library for implemeting weighted round robin load balancing.
Go
21
star
27

1brc-go

1️⃣🐝🏎️ The One Billion Row Challenge -- A fun exploration of how quickly 1B rows from a text file can be aggregated with Golang
Go
16
star
28

clx

Generate CLI commands using AI for common ops
Go
16
star
29

haraka-plugin-outbound-logger

Haraka SMTP plugin for logging outbound traffic. Useful for storing audit information of delivered/bounced emails.
JavaScript
15
star
30

nomcfg

HTML
15
star
31

kiteHistory

🤑 Kite History API wrapper
Python
14
star
32

vscode-kite

Visual Studio Code extension for KiteConnect API
JavaScript
13
star
33

kite-yoda

Ignorance is bliss.
JavaScript
12
star
34

k8s-deployment-book

⭐ Kubernetes - Production Deployments for Developers (Book) ⭐
HTML
12
star
35

nomadev

Docker based development workflow with Nomad and Consul
Dockerfile
12
star
36

simplehealth

Tiny lib for exposing health-check endpoints as Prometheus/JSON format
Go
11
star
37

localhashi

Vagrant based setup for local Nomad/Consul clusters. Helpful for experimenting with Nomad job specs in an environment similar to production.
Jinja
10
star
38

junbi

Shell
9
star
39

ebs-snapshot-exporter

Export AWS EBS Snapshots data as Prometheus metrics
Go
8
star
40

kong-service-exporter

Utility to create a export a service registry Markdown file from Kong's config
Python
8
star
41

alertmatter

Alertmanager - Mattermost Webhook Receiver
Go
7
star
42

calwarrior

Calendar web view for Takwarrior
Vue
7
star
43

NoiseInspector

📢 Arduino + Python + ESP8266 Wifi = Noise Level Monitor
Arduino
7
star
44

ansible-server-logs-monitoring

Ansible playbook to install ELK stack for log analysis and Prometheus/AlertManager/Node Exporter/Grafana for Server monitoring. Or as they say, One 💍 to rule them all!
7
star
45

eks-gitops

Set of utilities to do deployments in an EKS cluster
Dockerfile
6
star
46

caddy-plugins-docker

Docker image for Caddy with custom plugins baked into the image.
Dockerfile
5
star
47

haraka-docker

Docker image for Haraka SMTP server
Dockerfile
5
star
48

listmonk-infra

Source code for deploying listmonk on Kubernetes
Makefile
4
star
49

mfp-calorie-extract

Copy macronutrients information from MFP and paste them in Google Sheets for calorie tracking
JavaScript
4
star
50

cgroup-stats

Tiny Go library designed for retrieving CPU and Memory quota information from Linux control groups (cgroups).
Go
4
star
51

pinkFloyd-Lyrics

Analyzing Pink Floyd lyrics
HTML
4
star
52

SNUMessApp

Android App for SNU Weekly Mess Menu
Jupyter Notebook
3
star
53

notion-weightbot

A Telegram bot which tracks bodyweight and stores the records in a Notion Database and CSV
Go
3
star
54

fritter

Know if it's a good time to call your posh NRI fraands
Go
2
star
55

k8s-pruner

Cleanup unused configmaps in a Kubernetes namespace
Shell
2
star
56

talks

HTML
2
star
57

NetNeutralityBadge

Add SaveTheInternet Badge to your Facebook DP to show support for Net Neutrality
HTML
2
star
58

vscode-nomfmt

Visual Studio Code extension for on-the-fly formatting of Nomad job specs in HCL using `nomad fmt`.
TypeScript
1
star
59

Algorithm-Implementations--Python

Some Implementations of Algorithms in Python
Python
1
star
60

aws-dc-exporter

Prometheus metrics exporter for AWS Direct Connect
Go
1
star
61

kong-ansible

Ansible Playbook for setting up Kong node and using Cassandra as datastore
1
star
62

koanf-test

Go
1
star
63

rubberduck

Toolbox of useful utilities for debugging inside Containers
Go
1
star
64

Python-Scripts

Writing Python Scripts to do boring monotonous work the fun way :D
Python
1
star
65

telegramBot-YtDownload

Telegram Bot which downloads Youtube videos
Python
1
star
66

newsletter

HTML
1
star
67

weather-Twitter-Bot

Made a Weather Twitter Bot using Python
Python
1
star
68

HackerRank-Problems

My codes for some problems on HackerRank : https://www.hackerrank.com/domains/miscellaneous/python-tutorials
Python
1
star
69

khoj

CSE SNU Project Final Year
Python
1
star