Skip to content

Instantly share code, notes, and snippets.


Sharoon Thomas sharoonthomas

View GitHub Profile
sharoonthomas /
Created Oct 9, 2019
Example of using fulfil authentication in a flask app
@blueprint.route('/login', methods=['GET', 'POST'])
def login():
If there is no login, redirect the user to the authorization url
oauth_session = get_oauth_session()
next = flask.request.args.get('next')
authorization_url, state = oauth_session.create_authorization_url(
sharoonthomas /
Created Aug 19, 2016
Difference between using pytz.localize and datetime.replace
from datetime import date, time, datetime
import pytz
pacific = pytz.timezone('US/Pacific')
eastern = pytz.timezone('US/Eastern')
def get_naive_date_time():
date_start = date(2016, 9, 16)
time_start = time(10, 0)
sharoonthomas /
Created Jun 11, 2012 — forked from gingerlime/
Postgresql - Changing ownership on all tables
cat << EOF
usage: $0 options
This script set ownership for all table, sequence and views for a given database
Credit: Based on by Alex Soto
sharoonthomas /
Created Jan 5, 2018
Update supplier inventory from third party shopify store

Supplier Inventory Feed


  • Your supplier uses shopify.
  • They are willing to expose inventory over Shopify API giving you a private app API key and Password.
  • You are using fulfil and has product suppliers defined.

How this works

sharoonthomas / FULFIL_CLA
Last active Mar 20, 2019
Contributor License Agreement (CLA)
# Fulfil.IO Open Source Projects Individual Contributor License Agreement
Thank you for your interest in contributing to Fulfil.IO Open Source Projects ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by contributors to Us. To make this document effective, please sign it and send it to Us by electronic submission, following the instructions at . This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Us.
## 1. Definitions
"You" means the individual who Submits a Contribution to Us.
sharoonthomas /
Created Dec 28, 2018
Benchmark postgres servers
touch /etc/apt/sources.list.d/pgdg.list
echo "deb xenial-pgdg main" > /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - | sudo apt-key add -
apt-get update
apt-get install -y postgresql-10
# now go to pgtune for config
sharoonthomas /
Created Nov 20, 2018
Utilize Fulfil API to download complete Activity Stream Data history
import requests
import pandas as pd
from import json_normalize
import numpy as np
import os
import json
from import storage, bigquery
import datetime
import time
from multiprocessing.pool import ThreadPool
sharoonthomas /
Last active Sep 26, 2018
Update the supplier prices over API by reading a CSV file with sku, supplier_name and price
import os
import csv
import sys
from decimal import Decimal
from fulfil_client import Client
client = Client(
sharoonthomas /
Created Aug 29, 2018
Reading Fulfil interactive reports from API
from datetime import date
from fulfil_client import Client
fulfil = Client('<subdomain>', '<apikey>')
# Fetch the report instance
# The name can be obtained from the URL
report = fulfil.interactive_report('account.invoice.revenue_by_month.ireport')
# Trigger execution with the fields
sharoonthomas /
Created Mar 2, 2018
Find weight from scale using python and usb
# -*- coding: utf-8 -*-
Utilities to fetch weight from weighing scales
:copyright: (c) 2016-2018 by Fulfil.IO Inc.
:license: see LICENSE for details.
from collections import namedtuple
You can’t perform that action at this time.