{"id":16851720,"url":"https://github.com/they4kman/infusionsoft-client","last_synced_at":"2026-03-10T19:32:37.542Z","repository":{"id":62570987,"uuid":"87852354","full_name":"theY4Kman/infusionsoft-client","owner":"theY4Kman","description":"Sexy Infusionsoft XML-RPC API client","archived":false,"fork":false,"pushed_at":"2019-10-23T00:01:18.000Z","size":50,"stargazers_count":7,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T14:06:46.767Z","etag":null,"topics":["infusionsoft","python"],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/infusionsoft-client","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theY4Kman.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-10T20:01:31.000Z","updated_at":"2021-05-20T03:43:23.000Z","dependencies_parsed_at":"2022-11-03T17:15:41.031Z","dependency_job_id":null,"html_url":"https://github.com/theY4Kman/infusionsoft-client","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Finfusionsoft-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Finfusionsoft-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Finfusionsoft-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theY4Kman%2Finfusionsoft-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theY4Kman","download_url":"https://codeload.github.com/theY4Kman/infusionsoft-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248358555,"owners_count":21090402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["infusionsoft","python"],"created_at":"2024-10-13T13:30:05.524Z","updated_at":"2026-03-10T19:32:37.500Z","avatar_url":"https://github.com/theY4Kman.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"infusionsoft-client\n===================\n\n.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg\n    :target: https://github.com/theY4Kman/infusionsoft-client/blob/master/LICENSE\n    \n.. image:: https://badges.gitter.im/they4kman/infusionsoft-client.png\n    :target: https://gitter.im/infusionsoft-client/Lobby\n    \n.. image:: https://badge.fury.io/py/infusionsoft-client.svg\n    :target: https://badge.fury.io/py/infusionsoft-client\n\nA simple-to-use `Infusionsoft XML-RPC API \u003chttps://developer.infusionsoft.com/docs/xml-rpc/\u003e`_ client, with included stubs for code sense. Python 3.5+ only (but pull requests welcome :smirk:).\n\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n    pip install infusionsoft-client\n\n\n\nQuickstart\n----------\n\nFirst, initialize the client with your app name and API key:\n\n.. code-block:: python\n\n    import infusionsoft\n    infusionsoft.initialize('myapp', '098f6bcd4621d373cade4e832627b4f6')\n\n\nAnd use the ``infusionsoft`` like a regular `xmlrpc.client.ServerProxy \u003chttps://docs.python.org/3/library/xmlrpc.client.html\u003e`_:\n\n.. code-block:: python\n\n    import infusionsoft\n    contact_id = infusionsoft.ContactService.add({'FirstName': 'Johnny'})\n\n\n\nSetting XML-RPC Client Options\n------------------------------\n\nAny extra kwargs passed to ``initialize()`` will be passed along to ``xmlrpc.client.ServerProxy``.\n\n.. code-block:: python\n\n    import infusionsoft\n    infusionsoft.initialize('myapp', '098f6bcd4621d373cade4e832627b4f6', use_builtin_types=True)\n\nSome kwargs of interest are:\n\n- ``use_builtin_types``: whether to utilize native Python types, rather than wrappers such as ``xmlrpc.client.DateTime`` or ``xmlrpc.client.Binary``. **I recommend turning this on**. It will be turned on by default in the next major/breaking release.\n- ``verbose``: set to ``True`` to print out the request and response bodies for each RPC call.\n- ``allow_none``: whether to allow ``None`` to be sent over the wire. Infusionsoft, in general, doesn't allow ``None`` (which is ``nil`` in XML-RPC parlance). If a field in a response is null, Infusionsoft will simply not send it.\n- ``retries``: number of times to retry failed requests. Requests are retried on connection/socket errors, and \"InvalidConfig\" faults (if you've never seen them, I envy you). Any other type of fault will still raise an exception.\n\nSee `the docs \u003chttps://docs.python.org/3/library/xmlrpc.client.html#xmlrpc.client.ServerProxy\u003e`_ for more info.\n\n\n\nUsage with Django\n-----------------\n\n``infusionsoft-client`` includes a Django integration out of the box. Just add it to your ``INSTALLED_APPS``:\n\n.. code-block:: python\n\n    INSTALLED_APPS = (\n        # ...\n        'infusionsoft.contrib.django',\n    )\n\nAnd add your app name and API key to your settings:\n\n.. code-block:: python\n\n    INFUSIONSOFT_APP_NAME = 'myapp'\n    INFUSIONSOFT_API_KEY = '098f6bcd4621d373cade4e832627b4f6'\n\n\nPass extra configuration to the XML-RPC client with ``INFUSIONSOFT_CLIENT_OPTIONS``:\n\n.. code-block:: python\n\n    INFUSIONSOFT_CLIENT_OPTIONS = {\n        'use_builtin_types': True,\n    }\n\n\n\nGetting All Rows of a Query\n---------------------------\n\nSome API calls are paginated, and require multiple calls to retrieve all results. This can be a pain, and you may find yourself writing the same code over and over. To this end, ``infusionsoft-client`` provides a ``consume()`` generator function, which will consume all pages of any query function.\n\nTo use it, create a lambda (or regular) function taking ``page`` and ``limit`` as arguments which performs your paginated API call, and pass it to ``consume()``:\n\n.. code-block:: python\n\n    import infusionsoft\n    from infusionsoft.query import consume\n\n    query_fn = lambda page, limit: (\n        infusionsoft.DataService.query('mytable', limit, page, ['Id']))\n\n    # Use with a for-loop, to avoid storing all rows in memory:\n    for row in consume(query_fn):\n        do_stuff(row)\n\n    # Or retrieve all rows at once\n    all_rows = list(consume(query_fn))\n\n\nGenerate Code Stubs\n-------------------\n\nShipped with ``infusionsoft-client`` is code to download the official Infusionsoft XML-RPC docs, parse them with `BeautifulSoup \u003chttps://www.crummy.com/software/BeautifulSoup/bs4/doc/\u003e`_, and generate Python 3.5-compatible stubs for all methods.\n\nTo generate these yourself, first install the extra requirements:\n\n.. code-block:: bash\n\n    pip install -r stub-requirements.txt\n\nThen run the ``generate_stubs()`` function, which will return a string:\n\n.. code-block:: python\n\n    from infusionsoft.gen_stubs import generate_stubs\n    source = generate_stubs()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthey4kman%2Finfusionsoft-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthey4kman%2Finfusionsoft-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthey4kman%2Finfusionsoft-client/lists"}