Package: drip-python
drip-pythonPython wrapper for the Drip REST API atdeveloper.drip.comInstallationpipinstalldrip-pythonUsageInitialize the client>>>fromdripimportClient>>>d=Client(API_TOKEN,ACCOUNT_ID)Use the client's methods>>>d.fetch_user(){'email':'ross.hodapp@drip.com','name':'Ross Hodapp','time_zone':'America/Chicago'}Main ConceptsBe sure to check outthe Wiki!1. Additional OptionsBeyond the required arguments, any additional keyword arguments will be added to the call as well. Check the docs for what's available.>>>cfs={'first_name':'Ross'}>>>d.create_or_update_subscriber('ross.hodapp@drip.com',custom_fields=cfs){'email':'ross.hodapp+test@drip.com','custom_fields':{'first_name':'Ross'},...}2. Unpacking the responseThe Drip REST API often returns extra data along side the results you're asking for.The Client takes care of unpacking that data for you, returning lists, dictionaries, or strings as necessary. If the response doesn't have a body, result will returnTrueorFalseif the call wassuccessful or not.If you'd like the rawresponse, pass the keyward argumentmarshall=Falseto the method call.>>>d.fetch_user(marshall=False)<Response[200]>3. PaginationMost calls that return a list are paginated. By default, the Client automatically gets the maximum amount of objects per page and automatically gets all available pages.Use thepageandper_pagekeyword arguments. If a validpageis passed to the function, then this will fetch that page only (or the single Response if notmarshalled per above).Otherwise-- that is, ifpageis 0 (default) or negative-- then this will fetch the entire collection and return the full list. This will ignore theper_pagekeyword argument and use1000for maximum efficiency.Currently, I won't support getting all pages of 1 object per page for example, since I don't see a valid use-case for this.This means essentially thatper_pageonly makes sense when asking for a specific 'page'.
This also means that you can onlymarshalla specificpage(this may change in the future).Anyway, the default case will be what you want most of the time, so don't worry about this too much.>>>all_subscribers=d.subscribers()>>>len(all_subscribers)1234>>>first_page=d.subscribers(page=1)>>>len(first_page)100>>>last_page=d.subscribers(page=13)>>>len(last_page)34>>>big_first_page=d.subscribers(page=1,per_page=1000)>>>len(big_first_page)1000>>>big_last_page=d.subscribers(page=2,per_page=1000)>>>len(big_last_page)234>>>marshall_without_page=d.subscribers(marshall=False)>>>len(marshall_without_a_page)1234>>>marshall_with_page=d.subscribers(page=1,marshall=False)>>>marshall_with_page<Response[200]>FAQStatus - v0.3.0 BetaWhile devotedly and enthusiastically maintained, this is an un-official side-project and Drip Support is unable to fix issues you run into. Create an Issue on GitHub here instead. Thanks!PurposeFull API coverage, including "v3" Shopper Activity and future endpointsFull unittest code coverageEvery endpoint tested liveDocumentation(readthedocs? github wiki?)wiki!Web framework support, namely Django andResponderNoSQL utilitiesAsyncIO supportBasically needs a differend repo?Changelogv0.3.0Repostiry updatesv0.1.4Added raising Errors for when the HTTP call is successful but the API returned that there were errorsv0.1.3Added Product support for the Shopper Activity API! Check that out here:Product Activity