当前位置: 首页>>代码示例>>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;未经允许,请勿转载。