check_out_text = u'\U0001f44b Check Out' open_duty_slip_text = u'\U000025b6 Open Duty Slip' add_handoff_text = u'\U0001F91D Handoff' add_vehicle_text = u'\U0001F695 Vehicle' send_location_text = u'\U0001F4CD Send Location' send_contact_text = u'\U0001F4CD Send Contact' submit_text = u'\U00002714 Submit' cancel_text = u'\U0000274C Cancel' driver_base_keyboard = [[check_in_text, check_out_text], [open_duty_slip_text]] location_update_keyboard = [[add_handoff_text, add_vehicle_text], [send_location_text], [submit_text, cancel_text]] location_keyboard = [[{'text': send_location_text, 'request_location': True}]] contact_keyboard = [[{'text': send_contact_text, 'request_contact': True}]] #yes_no_keyboard = [[telegram.InlineKeyboardButton("Yes", callback_data='Yes'),telegram.InlineKeyboardButton("No", callback_data='No')]] sakhacabsxpal = xetrapal.Xetrapal( configfile="/home/arjun/sakhacabs/sakhacabsxpal.conf") driverbotconfig = xetrapal.karma.load_config( configfile="/home/arjun/sakhacabs/driversakhabot.conf") driversakhabot = xetrapal.telegramastras.XetrapalTelegramBot( config=driverbotconfig, logger=sakhacabsxpal.logger) logger = driversakhabot.logger MENU_CHOICE, TYPING_REPLY, TYPING_CHOICE, LOCATION_CHOICE = range(4) def facts_to_str(user_data): facts = list() logger.info("Converting facts to string") for key, value in user_data.items(): facts.append(u'{} - {}'.format(key, value)) logger.info("Converted facts to string")
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sat Aug 18 19:04:55 2018 @author: lilhack110 """ import sys sys.path.append("/opt/xetrapal") import xetrapal import tweepy import pandas import datetime import math import json from sklearn.feature_extraction.text import CountVectorizer ananda=xetrapal.Xetrapal(configfile="/home/lilhack110/ab.conf") anandatw=ananda.get_twython() anandagd=ananda.get_googledriver() twconfig=xetrapal.karma.get_section(ananda.config,"Twython") tweep=get_tweepy(twconfig) trollbaitsheet=anandagd.open_by_key(key="1zisiKnhF4cEW4H7fvhpZ7Y8cGfwQybvGgDg6Jnth5j4")
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sun May 27 01:08:24 2018 @author: ananda """ import sys sys.path.append("/opt/xetrapal/") sys.path.append("../lib") from HindiTokenizer import Tokenizer import xetrapal import analyze x = xetrapal.Xetrapal(configfile="/home/ananda/ab/ab.conf") t = x.get_twython() gs = x.get_googledriver() ws = gs.open_by_key("1xF7rqNVyr_VmoIojx3g__M57aV2cKPy6iWaD3YB6rnY") df = ws.worksheet_by_title("datacleaning-orignotnull").get_as_df() df['cleantext'] = df.fulltextsqueezed.apply(analyze.clean)
""" Created on Sat Sep 8 21:52:07 2018 @author: arjun """ import sys import datetime import json import mongoengine sys.path.append("/opt/xetrapal") import xetrapal import pandas from sakhacabs import documents, utils sakhacabsxpal = xetrapal.Xetrapal( configfile="/opt/sakhacabs-appdata/sakhacabsxpal.conf") sakhacabsgd = sakhacabsxpal.get_googledriver() sms = sakhacabsxpal.get_sms_astra() ''' try: datasheet = sakhacabsgd.open_by_key( sakhacabsxpal.config.get("SakhaCabs", "datasheetkey")) bookingsheet = datasheet.worksheet_by_title("bookings") custsheet = datasheet.worksheet_by_title("customers") carsheet = datasheet.worksheet_by_title("cars") driversheet = datasheet.worksheet_by_title("drivers") prodsheet = datasheet.worksheet_by_title("product") except Exception as e: sakhacabsxpal.logger.error( "Error connecting to Google Drive, check connectivity - {} {}".format(repr(e), str(e))) '''
""" Created on Sat Sep 8 21:52:07 2018s @author: arjun """ import mongoengine import xetrapal from samvad import documents, utils samvadxpal = xetrapal.Xetrapal(configfile="/opt/samvad-appdata/samvadxpal.conf") # Setting up mongoengine connections samvadxpal.logger.info("Setting up MongoEngine") mongoengine.connect('samvad', alias='default')