{ "info": { "author": "LogUp Inc.", "author_email": "it@logup.co", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Build Tools" ], "description": "====================\nLogUp SDK for Python\n====================\n\nThe LogUp SDK for Python enables Python developers to easily integrate LogUp service in their projects.\n\nGetting Started\n---------------\n\nSign up for LogUp\n:::::::::::::::::\n\nBefore you begin, you need a LogUp account. Please see the `Getting started `_\nsection of the developer guide for information about how to create a LogUp account and create your first `gate\n`_.\n\nInstall the SDK\n:::::::::::::::\n\nInstall the SDK library using `pip `_\n\n.. code-block:: bash\n\n pip install logup\n\nInitialize the LogUp Client Object\n::::::::::::::::::::::::::::::::::\n\n.. code-block:: python\n\n id_gate = \"{your-id-gate}\"\n gate_secret_key = \"{your-gate-secret-key}\"\n # Create an instance of LogupClient using the default API Version\n logup_client = LogupClient(\n id_gate,\n gate_secret_key\n )\n\n # Create an instance of LogupClient specifying the API version\n\n api_version = \"v1_1\"\n logup_client_1 = LogupClient(\n id_gate,\n gate_secret_key,\n api_version\n )\n\nNow you're ready to verify the token received. On the redirect page where the user is sent to after the LogUp, get from\nthe URL those parameters:\n\n- **logupToken** : the unique token to verify user identity\n\n- **isNewUser** : true if the user is new for your website, false if the user said he has already an account on your website. `More about this parameter `_\n\nVerify user identity\n::::::::::::::::::::\n\nThis code is how you can verify that the **token received** is correct and see **who the user is**.\n\n.. code-block:: python\n\n logup_token = \"{very-long-token-received-as-URL-query-parameter}\"\n is_new_user = True or False\n\n if logup_client.is_logup_verified(logup_token, is_new_user):\n # user was successfully logged in!\n # get the subscription object\n subscription = logup_client.subscription\n else:\n print(\"Ops, the user did not log in\")\n\nSubscription\n------------\n\nWith the subscription object you can get more information about the actor who logged in, as well as access to its saved\nDB. A DB is a key-value store of parameters you can associated to your user. `Read mode about DB `_.\n\nRead the values\n:::::::::::::::\n\nThis is how a Subscription object is made:\n\n.. code-block:: python\n\n subscription.id_subscription # the id of the subscription\n subscription.id_actor # the id of the actor that access the subscription\n subscription.is_new_user # true if it is a new user, false otherwise\n\nFor difference explanation between id actor and id subscription `see our documentation `_.\n\nGet subscription DB values\n::::::::::::::::::::::::::\n\nTo read DB values of that subscription.\n\n.. code-block:: python\n\n db = subscription.db\n print(\"idSubscription retrieved: \" + subscription.id_subscription)\n print(\"With this DB associated: \")\n print(db)\n\nAdd / Update DB values\n::::::::::::::::::::::\n\nAdd or update a DB value.\n\n.. code-block:: python\n\n data = {\n \"key-test\": \"\",\n \"second-key-test\": 1,\n \"third-key-test\": True\n }\n db = subscription.update_db(data)\n print(\"Db values updated: \")\n print(db)\n\nSome **limitations** may apply to the values you want to add to a DB: read them in our\n`documentation `_.\nWhen you update or add values, you do not need to give all the previous values, but **just those you need to update / add**.\nThe db in response will have all the values currently stored in the DB.\n\n\nDelete DB values\n::::::::::::::::\n\n.. code-block:: python\n\n keys = [\"third-key-test\"]\n db = subscription.delete_db_value(keys)\n print(\"New db values: \")\n print(db)\n\nEnter an array with one or more strings representing the **keys you want to remove** from the DB. The **response** will have\nthe **current db** without the removed values.\n\nOperate on custom object\n::::::::::::::::::::::::\n\nIf you want to operate on a subscription that is not the one retrieved during login, you need to create a new\nSubscription object with **the subscription id you are looking for.** This is an example:\n\n.. code-block:: python\n\n id_subscription = \"sub_XXXXXXXXXXX\"\n subscription = logup_client.subscription_custom(id_subscription)\n # on subscription now you can perform all the operation mentioned above\n\nRemember that if you create a custom new subscription, *you won't have the values of*\n\n- idActor\n- isNewUser\n\nSince they are related to the user trying to access your website, and not to a generic loaded subscription.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.logup.co", "keywords": "logup logup-sdk-python logup-python logup-sdk", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "logup", "package_url": "https://pypi.org/project/logup/", "platform": "", "project_url": "https://pypi.org/project/logup/", "project_urls": { "Homepage": "https://www.logup.co" }, "release_url": "https://pypi.org/project/logup/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "The LogUp SDK for Python", "version": "1.0.1" }, "last_serial": 3683535, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "2fbcc2ff453cfe54f56fb0126e701184", "sha256": "08be9888fe0254f84918ecd7b70183493b188790ba1639cb6bdaa4e792ee5158" }, "downloads": -1, "filename": "logup-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2fbcc2ff453cfe54f56fb0126e701184", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10663, "upload_time": "2018-03-05T14:21:42", "url": "https://files.pythonhosted.org/packages/4f/cd/af45432d7484b8c385a11a464b41775825f46b718f843639ae3ed66f667b/logup-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf2e6a1dc61d4b4649738409ac002627", "sha256": "cb415af413aa3cd0615c52f316d3063cb0846edbd2db912a5472e1d0f88b8638" }, "downloads": -1, "filename": "logup-1.0.0.tar.gz", "has_sig": false, "md5_digest": "cf2e6a1dc61d4b4649738409ac002627", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10704, "upload_time": "2018-03-05T14:21:44", "url": "https://files.pythonhosted.org/packages/61/40/9ac83ca453633e54b4be8f8f5e4119adac229ef50b4c3678bf7a9c0e7cf8/logup-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "6058b63149bb6ae0c387d77466865f04", "sha256": "27152676ffaebb4f6a80b1d5cbd97f961cb8f1425cbb854c8e961f8c0834ff4e" }, "downloads": -1, "filename": "logup-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6058b63149bb6ae0c387d77466865f04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10530, "upload_time": "2018-03-19T11:53:32", "url": "https://files.pythonhosted.org/packages/71/1f/6959687964ba9d82dee89c378f1ae496336c64a4126940560e0aa2ded1b0/logup-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6058b63149bb6ae0c387d77466865f04", "sha256": "27152676ffaebb4f6a80b1d5cbd97f961cb8f1425cbb854c8e961f8c0834ff4e" }, "downloads": -1, "filename": "logup-1.0.1.tar.gz", "has_sig": false, "md5_digest": "6058b63149bb6ae0c387d77466865f04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10530, "upload_time": "2018-03-19T11:53:32", "url": "https://files.pythonhosted.org/packages/71/1f/6959687964ba9d82dee89c378f1ae496336c64a4126940560e0aa2ded1b0/logup-1.0.1.tar.gz" } ] }