當前位置: 首頁>>代碼示例>>Python>>正文


Python Mixpanel.people_set方法代碼示例

本文整理匯總了Python中mixpanel.Mixpanel.people_set方法的典型用法代碼示例。如果您正苦於以下問題:Python Mixpanel.people_set方法的具體用法?Python Mixpanel.people_set怎麽用?Python Mixpanel.people_set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mixpanel.Mixpanel的用法示例。


在下文中一共展示了Mixpanel.people_set方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: users

# 需要導入模塊: from mixpanel import Mixpanel [as 別名]
# 或者: from mixpanel.Mixpanel import people_set [as 別名]
def users(email, name=None, ip=None):
	mp = Mixpanel(TOKEN)
	params = {'$email': email}
	if name:
		params['$name'] = name
	if ip:
		params['$ip'] = ip
	mp.people_set(email, params)
開發者ID:aiyappaganesh,項目名稱:underdogs,代碼行數:10,代碼來源:api.py

示例2: test_people_set

# 需要導入模塊: from mixpanel import Mixpanel [as 別名]
# 或者: from mixpanel.Mixpanel import people_set [as 別名]
 def test_people_set(self):
     token = '12345'
     mp = Mixpanel(token)
     mock_response = Mock()
     mock_response.read.return_value = '1'
     with patch('urllib2.urlopen', return_value = mock_response) as mock_urlopen:
         mp.people_set('amq', {'birth month': 'october', 'favorite color': 'purple'})
     data = mp._prepare_data({'$token': '12345', '$distinct_id': 'amq', '$set': {'birth month': 'october', 'favorite color': 'purple'}})
     mock_urlopen.assert_called_once_with(self.engage_request_url, data)
開發者ID:daemonburrito,項目名稱:mixpanel-python,代碼行數:11,代碼來源:test.py

示例3: mixpanel_people_set

# 需要導入模塊: from mixpanel import Mixpanel [as 別名]
# 或者: from mixpanel.Mixpanel import people_set [as 別名]
def mixpanel_people_set(distinct_id, event_name, value=None, increment=False):
    """
    If value not set value = datetime`
    """
    if not distinct_id:
        return
    if not settings.DEBUG and domain_exclude and distinct_id.endswith(domain_exclude):
        return

    id = settings.METRICS.get('mixpanel', {}).get('id')
    if not id:
        logger.info('Mixpanel id not defined, task ignored')
        return

    mp = Mixpanel(id)
    if increment:
        mp.people_increment(distinct_id, {event_name: value})
    else:
        if value is None:
            value = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')
        mp.people_set(distinct_id, {event_name: value})
開發者ID:,項目名稱:,代碼行數:23,代碼來源:

示例4: str

# 需要導入模塊: from mixpanel import Mixpanel [as 別名]
# 或者: from mixpanel.Mixpanel import people_set [as 別名]
    name = row[0]
    name1 = name.split()
    name1 = "".join(name1)
    username = name1 + str(random.randint(1, 1000)) + \
        random.choice(string.letters)
    phone_no = row[1]
    email = row[2]
    phone_type = row[5]
    android_version = row[6]
    if len(phone_no) == 10:
        if phone_no[:1] == '9':
            phone_no = '+977' + phone_no
            mp.people_set(username, {
                '$phone': phone_no,
                '$name': name,
                '$email': email,
                'phone_type': phone_type,
                'android_version': android_version
            })


f.close()

f = open('feedback2.csv', 'rb')
reader = csv.reader(f)
for row in list(reader)[1:]:
    name = row[0]
    name1 = name.split()
    name1 = "".join(name1)
    username = name1 + str(random.randint(1, 1000)) + \
        random.choice(string.letters)
開發者ID:sijanonly,項目名稱:meroanswer_promo,代碼行數:33,代碼來源:mixpanel.py

示例5: Mixpanel

# 需要導入模塊: from mixpanel import Mixpanel [as 別名]
# 或者: from mixpanel.Mixpanel import people_set [as 別名]
from mixpanel import Mixpanel
from twilio.rest import TwilioRestClient
import mixpanel
# import datetime

mp = Mixpanel(ae91c3869706778b25a08e6f504ab1bd)

# create or update a profile with First Name, Last Name,
# E-Mail Address, Phone Number, and Favorite Color
mp.people_set('johndoe', {
    '$first_name'    : 'John',
    '$last_name'     : 'Doe',
    '$email'         : '[email protected]',
    '$phone'         : '5555555555',
    'Company'        : 'Mylo Real Estate',
    'RERA'           : '49231',
    'Subscription Plan' : 'Free'
})

mp.people_append('johndoe', {
    'Last Logged in' : 'Today'
})

# You can also include properties to describe
# the circumstances of the event
mp.track(johndoe, 'Subscription Plan', {
    'Old Plan': 'Free',
    'New Plan': 'Enterprise'
})

# Your Account Sid and Auth Token from twilio.com/user/account
開發者ID:andregoiano,項目名稱:python_tests,代碼行數:33,代碼來源:mixpanel.py


注:本文中的mixpanel.Mixpanel.people_set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。