Git Product home page Git Product logo

eventbrite-sdk-python's Introduction

eventbrite-sdk-python

https://badge.fury.io/py/eventbrite.png https://travis-ci.org/eventbrite/eventbrite-sdk-python.svg?branch=master

Installation from PyPI

$ pip install eventbrite

If you need to, you can also use easy_install:

$ easy_install eventbrite

Usage

The Eventbrite Python SDK makes it trivial to interact with the Eventbrite API:

>>> from eventbrite import Eventbrite
>>> eventbrite = Eventbrite('my-oauth-token')
>>> user = eventbrite.get_user()  # Not passing an argument returns yourself
>>> user['id']
1234567890
>>> user['name']
Daniel Roy Greenfeld

You can also specify API endpoints manually:

>>> user = eventbrite.get('/users/me')
>>> user['id']
1234567890
>>> user['name']
Daniel Roy Greenfeld

Expansions can be included in a returned GET resource by simply adding the expand keyword to the calling method:

>>> event = eventbrite.get_event('my-event-id')
>>> 'ticket_classes' in evbobject
False
>>> event = eventbrite.get_event('my-event-id', expand='ticket_classes')
>>> 'ticket_classes' in evbobject
True

Usage with Frameworks

When using Flask, you can convert incoming webhook requests into Eventbrite API objects using the webhook_to_object() method:

@app.route('/webhook', methods=['POST'])
def webhook():


    # Use the API client to convert from a webhook to an API object
    api_object = eventbrite.webhook_to_object(request)

    # Process the API object
    if api_object.type == 'User':
        do_user_process(api_object)

    if api_object.type == 'Event':
        do_event_process(api_object)

    return ""

Versioning

Because this client interacts with Eventbrite's third API (a.k.a. APIv3), we are tying our release numbers against it in a modified-semantic system:

  • 3.x.x where '3' matches the API version. This will not change until Eventbrite releases a new API version.
  • x.0.x where '0' is increased any time there is a significant change to the API that possibly breaks backwards compatibility
  • x.x.1 where '1' is increased on any release that does not break backwards compatibility (small, new features, enhancements, bugfixes)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/eventbrite/eventbrite-sdk-python.

License

The library is available as Open Source under the terms of the Apache License, Version 2.0.

eventbrite-sdk-python's People

Contributors

eb-enzo avatar harlandklauke-eb avatar jon-ga avatar malina-eb avatar mgrdcm avatar michaelmanganiello-eb avatar pbanaszkiewicz avatar pydanny avatar ryanbagwell avatar vartec avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.