{ "info": { "author": "Breinify", "author_email": "toddbodnar@breinify.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only" ], "description": ".. image:: https://raw.githubusercontent.com/Breinify/brein-api-library-python/master/documentation/img/logo250px.png\n :align: center\n :alt: Breinify API Python Library\n\n.. class:: center\n\nBreinify's DigitalDNA API puts dynamic behavior-based, people-driven data right at your fingertips.\n\n\nStep By Step Introductions\n==========================\n\nWhat is Breinify's DigitialDNA\n------------------------------\n\nBreinify's DigitalDNA API puts dynamic behavior-based, people-driven data right at your fingertips. We believe that in many situations, a critical component of a great user experience is personalization. With all the data available on the web it should be easy to provide a unique experience to every visitor, and yet, sometimes you may find yourself wondering why it is so difficult.\n\nThanks to **Breinify's DigitalDNA** you are now able to adapt your online presence to your visitors needs and **provide a unique experience**. Let's walk step-by-step through a simple example.\n\nQuick start\n===========\n\nStep 1: Download the Library\n----------------------------\nDownload the library from PyPi and install it with\n\n.. code:: python\n\n python3 setup.py install\n\n\nStep 2: Integrate the library\n-----------------------------\nIntegrate the Library into your Python 3 project by importing the library in the relevant blocks of code.\n\n.. code:: python\n\n import breinify\n\n\n\nStep 3: Configure the library\n-----------------------------\n\nIn order to use the library you need a valid API-key, which you can get for free at https://www.breinify.com. In this example, we assume you have the following api-key:\n\n**772A-47D7-93A3-4EA9-9D73-85B9-479B-16C6**\n\n.. code:: python\n\n ##this is a valid API key\n apiKey = \"772A-47D7-93A3-4EA9-9D73-85B9-479B-16C6\"\n\n breinify.setup(apiKey)\n\nThe Breinify class is now configured with a valid configuration object.\n\n\nStep 4: Start using the library\n-------------------------------\n\nPlacing activity triggers\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe engine powering the DigitalDNA API provides three endpoints. The first endpoint is used to inform the engine about the activities performed by visitors of your site. The activities are used to understand the user's current interest and infer the intent. It becomes more and more accurate across different users and verticals as more activities are collected. It should be noted, that any personal information is not stored within the engine, thus each individual's privacy is well protected. The engine understands several different activities performed by a user, e.g., landing, login, search, item selection, or logout.\n\nFor this example, pretend that a user named \"John Doe\" is logged in to your site with his email address (john.doe@email.com) and is searching for a B2B big data company. You can log this activity with the Breinify API using the following code:\n\n.. code:: python\n\n #create a user you are interested in with their email and last name\n example_user = breinify.user(email=\"john.doe@email.com\")\n\n breinify.send_activity(user,\"search\",\"services\",\"b2b big data companies\")\n\nThat's it! The call will be run asynchronously in the background. All fields in the user class are optional, but the more data you can supply, the more accurate the results will be.\n\nTemporal Data Lookup\n^^^^^^^^^^^^^^^^^^^^\n\nAt the same time, you may want to customize the user's experience based on their local environment.\n\n.. code:: python\n\n #create a user you are interested in based on their ip. Other fields (coordinates, time, etc) can also be included\n example_user = breinify.user(ip=\"143.127.128.10\")\n\n result = breinify.temporal_data(example_user)\n\nThe result variable will contain a dictionary with information about the place the user is at, for example:\n\n.. code:: python\n\n print(result)\n\n {'location': {'state': 'CA', 'lon': -121.827179, 'granularity': 'city', 'city': 'San Jose', 'lat': 37.366051,\n 'country': 'US'}, 'holidays': [{'source': 'United Nations', 'types': ['SPECIAL_DAY'], 'holiday':\n 'World Cities Day'}, {'source': 'Public Information', 'types': ['HALLMARK'], 'holiday': 'Halloween'}], 'time':\n {'localDay': 31, 'epochYear': 2016, 'localMonth': 10, 'localDayName': 'Monday', 'epochMonth': 10,\n 'localFormatIso8601': '2016-10-31T13:17:42-07:00', 'localHour': 13, 'localYear': 2016, 'epoch': 1477945062,\n 'epochHour': 20, 'timezone': 'America/Los_Angeles', 'epochDay': 31, 'localMinute': 17, 'localSecond': 42,\n 'epochSecond': 42, 'epochDayName': 'Monday', 'epochMinute': 17, 'epochFormatIso8601': '2016-10-31T20:17:42+00:00'},\n 'weather': {'description': 'scattered clouds', 'temperature': 13.161000000000001, 'lastMeasured': 1477935065,\n 'precipitation': {'precipitationAmount': 0.0, 'precipitationType': 'none'}, 'windStrength': 1.4, 'measuredAt':\n {'lon': -121.767731, 'lat': 37.23328}, 'cloudCover': 48.0}}\n\n\nPlacing look-up triggers\n^^^^^^^^^^^^^^^^^^^^^^^^\n\nSome time later, you may want to send a message to this user, but you only have their email address. You can query the Breinify lookup API to find necessary fields to personalize the message.\n\n.. code:: python\n\n example_user = breinify.user(email=\"john.doe@email.com\")\n\n result = breinify.lookup(example_user,[\"firstname\",\"gender\"])\n ## should return \"{'gender': {'result': 'MALE', 'accuracy': 1.0},\n ## 'firstname': {'result': 'John', 'accuracy': 0.92}}\"\n name = result[\"firstname\"][\"result\"]\n honorific = \" \"\n if result[\"gender\"][\"result\"]=='MALE' and result[\"gender\"][\"accuracy\"] > 0.80:\n honorific = \" Mr. \"\n if result[\"gender\"][\"result\"]=='FEMALE' and result[\"gender\"][\"accuracy\"] > 0.80:\n honorific = \" Mrs. \"\n if result[\"firstname\"][\"accuracy\"] < 0.8: #don't customize if we're not sure about their name\n honorific = \"\"\n name = \"\"\n print(\"Hi\"+honorific+name+\"! What can we at Breinify do for you today?\")\n ##should print \"Hi Mr. John! What can we at Breinify do for you today?\"\n\nA demonstration function is available in demo.py.\n\nWith Breinify's advanced artificial intelligence engine, you were able to customize a user's experience and probably increase their engagement with just a few lines of code!\n\nFurther links\n-------------\n\nTo understand all the capabilities of Breinify's DigitalDNA API, take a look at:\n\n\n* `Breinify's Website`__.\n\n.. __: https://www.breinify.com", "description_content_type": null, "docs_url": "https://pythonhosted.org/brein-api/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Breinify/brein-api-library-python", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "brein-api", "package_url": "https://pypi.org/project/brein-api/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/brein-api/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Breinify/brein-api-library-python" }, "release_url": "https://pypi.org/project/brein-api/1.2.2/", "requires_dist": null, "requires_python": null, "summary": "Access to Breinify's DigitalDNA API", "version": "1.2.2" }, "last_serial": 2441037, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "d40139c67aa2feb7cc7ecd6b53a5e8a6", "sha256": "d1530e6270d28b08113bea203f0ec9453789e8fbf4a55490d9bb44345f30cbc3" }, "downloads": -1, "filename": "brein-api-1.0.tar.gz", "has_sig": false, "md5_digest": "d40139c67aa2feb7cc7ecd6b53a5e8a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 270955, "upload_time": "2016-08-08T18:24:42", "url": "https://files.pythonhosted.org/packages/dd/db/dbc874b1146de13b06918297f5fc6d9a60e799c7af1801f9ffb61f9f08aa/brein-api-1.0.tar.gz" } ], "1.0": [], "1.1": [ { "comment_text": "", "digests": { "md5": "8c4ebf2c0b8aa75ec9d81abcdf056fb2", "sha256": "88ae3fb222d3d43561f1044a23b31698116cc4646a9bccfb2aed344c49cb08db" }, "downloads": -1, "filename": "brein-api-1.1.tar.gz", "has_sig": false, "md5_digest": "8c4ebf2c0b8aa75ec9d81abcdf056fb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 271181, "upload_time": "2016-09-06T23:11:32", "url": "https://files.pythonhosted.org/packages/c9/a4/2fc28b40754c6d72fd378860b0bfcf054ea47e28e2d068a3ec8152f67b8a/brein-api-1.1.tar.gz" } ], "1.2": [], "1.2.2": [ { "comment_text": "", "digests": { "md5": "a71d05b1e8191711d9ee88d0633e94a5", "sha256": "2e606ca5f084a4683330a1f9529fc07e9717fb480ea94481b3a176342a921e9f" }, "downloads": -1, "filename": "brein_api-1.2.2-py3.egg", "has_sig": false, "md5_digest": "a71d05b1e8191711d9ee88d0633e94a5", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 12929, "upload_time": "2016-11-03T20:33:59", "url": "https://files.pythonhosted.org/packages/9a/1b/efe6f48e5450d6073cea8913ea28875a8cea7510de221c00081a7bf31b2c/brein_api-1.2.2-py3.egg" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a71d05b1e8191711d9ee88d0633e94a5", "sha256": "2e606ca5f084a4683330a1f9529fc07e9717fb480ea94481b3a176342a921e9f" }, "downloads": -1, "filename": "brein_api-1.2.2-py3.egg", "has_sig": false, "md5_digest": "a71d05b1e8191711d9ee88d0633e94a5", "packagetype": "bdist_egg", "python_version": "3.5", "requires_python": null, "size": 12929, "upload_time": "2016-11-03T20:33:59", "url": "https://files.pythonhosted.org/packages/9a/1b/efe6f48e5450d6073cea8913ea28875a8cea7510de221c00081a7bf31b2c/brein_api-1.2.2-py3.egg" } ] }