Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Fomo Python SDK is the official SDK wrapper for the Fomo API service

Project description

Fomo Python SDK is the official SDK wrapper for the Fomo API service

API docs: http://docs.usefomo.com/reference

Requirements

  • Python version [2.7+, 3.x+]
  • pyOpenSSL / OpenSSL with SNI support
  • Python module requests

Installation

Install the latest version with

$ pip install fomo

Manual User Installation

Download Fomo/fomo.py and include the file in your Python project.

Check out our examples in tests/test.py, quick usage examples:

Basic Usage

Initialize Fomo client:

import Fomo
client = Fomo.FomoClient('<token>')  # Auth token can be found Fomo application admin dashboard (App -> API Access)

Create a new event with template name:

event = Fomo.FomoEventBasic()
event.event_type_tag = 'new_order'  # Event type tag is found on Fomo dashboard (Templates -> Template name)
event.email_address = 'ryan.kulp@usefomo.com' # used to fetch Gravatar for notification image
event.title = 'Test event'
event.city = 'San Francisco'
event.url = 'https://www.usefomo.com'

# Add event custom attribute value
event.add_custom_event_field('variable_name', 'value')

created_event = client.create_event(event)
print(created_event)

or with template ID:

event = Fomo.FomoEventBasic()
event.event_type_id = '183'  # Event type ID is found on Fomo dashboard (Templates -> Template ID)
event.title = 'Test event'
event.city = 'San Francisco'
event.url = 'https://www.usefomo.com'

# Add event custom attribute value
event.add_custom_event_field('variable_name', 'value')

created_event = client.create_event(event)
print(created_event)

Fetch an event:

event = client.get_event('<event ID>')
print(event)

Get events:

events = client.get_events(30, 1)
print(events)

Get events with meta data:

data = client.get_events_with_meta(30, 1)
print(data.events)
print(data.meta.per_page)
print(data.meta.page)
print(data.meta.total_count)
print(data.meta.total_pages)

Delete an event:

client.delete_event('<event ID>')

Update an event:

event = client.get_event('<event ID>')
event.first_name = 'John'
updated_event = client.update_event(event)
print(updated_event)

Support

If you have questions, email us at hello@usefomo.com.

Project details


Release history Release notifications

This version
History Node

1.0.6

History Node

1.0.5

History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
fomo-1.0.6-py2.py3-none-any.whl (6.8 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Jun 10, 2017
fomo-1.0.6.tar.gz (6.0 kB) Copy SHA256 hash SHA256 Source None Jun 10, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page