
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Fomo Python SDK is the official SDK wrapper for the Fomo API service <https://fomo.com>
_
API docs: https://docs.fomo.com <https://docs.fomo.com>
_
requests <http://python-requests.org>
_Install the latest version with
.. code-block:: bash
$ pip install fomo
Download Fomo/fomo.py <https://github.com/usefomo/fomo-python-sdk/blob/master/Fomo/fomo.py>
_ and include the file in your Python project.
Check out our examples in tests/test.py <https://github.com/usefomo/fomo-python-sdk/blob/master/tests/test.py>
_, quick usage examples:
Initialize Fomo client:
.. code-block:: python
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:
.. code-block:: python
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@fomo.com' # used to fetch Gravatar for notification image
event.title = 'Test event'
event.city = 'San Francisco'
event.url = 'https://www.fomo.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:
.. code-block:: python
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.fomo.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:
.. code-block:: python
event = client.get_event('<event ID>')
print(event)
Get events:
.. code-block:: python
events = client.get_events(30, 1)
print(events)
Get events with meta data:
.. code-block:: python
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:
.. code-block:: python
client.delete_event('<event ID>')
Update an event:
.. code-block:: python
event['first_name'] = 'Donny'
event['custom_event_fields_attributes'] = { 'amount': 19.99 }
updated_event = client.update_event(event)
print(updated_event)
If you have questions, email us at hello@fomo.com <mailto:hello@fomo.com>
_.
FAQs
Fomo Python SDK is the official SDK wrapper for the Fomo API service
We found that fomo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.