{ "info": { "author": "Clinton James", "author_email": "clinton.james@anuit.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7" ], "description": "![version](http://img.shields.io/pypi/v/lds_org.svg)\n![license](http://img.shields.io/pypi/l/lds_org.svg)\n![Travis](https://img.shields.io/travis/jidn/LDS-org.svg)\n![coverage](https://coveralls.io/repos/github/jidn/lds_org/badge.svg?branch=master)\n\n# LDS-org\n\nMost times, I can quickly jump the LDS.org website and get the exact\ninformation I need. However, there are those repeated tasks I don't\nreally want to to run time and time again. Hmm... sounds like a job\nfor a computer.\n\nIn my current role as Clerk, reports and information are my life. I\nwant to make it easier to get that information.\n\n## Install\n\nFor install you can use pip:\n\n```sh\npip install lds-org\n```\n\n## QuickStart\n\nUsing the command line, see the available endpoints and your current ID.\n\n```sh\npython -m lds_org\npython -m lds_org -e current-user-id\n```\n\nNow lets get the same in python.\n\n```python\nimport lds_org\n\nlds = lds_org.LDSOrg()\nlds.signin(username, password)\nrv = lds.get('current-user-id')\nprint(rv.json())\n```\n\nTo make conneciton a bit easier, we can create a session for repeated use.\n\n```python\nwith lds_org.session() as lds:\n rv = lds.get(some_context_of_interest)\n ...\n```\n\n## Endpoints\n\nEndpoints are URLs to resources, most of which provide JSON.\nThe list of endpoints are found at and are somewhat documented at .\n\nSome endpoints need additional data, usually the unit number which appears as `%@` in the endpoints found at [tech.lds.org](https://tech.lds.org/mobile/ldstools/config.json).\nHowever, tech.lds.org uses it for other items as well.\nI alter the URLs for better understanding by replace `%@` with `{unit}` and `{member}` as I currently understand the the endpoints.\n\nThe module will automatically replace `{unit}` with the authorized users unit number if it is not provided. You can also provide a unit number for a different unit in a stake.\n\nFor example, get the number of household in the stake by unit.\n\n```python\nUnit = collections.namedtuple('Unit', 'name number')\nwith lds_org.session() as lds:\n rv = lds.get('stake-units')\n data = rv.json()\n units = sorted(Unit(_['wardName'], _['wardUnitNo'])\n for _ in data)\n for unit in units:\n rv = lds.get('unit-membership', unit=unit.number)\n print('{:4} [unit {}]{}'.format(len(rv.json()), unit.number, unit.name))\n```\n\nYou can also pass in `unit` and `member` information on the command line. See the help at\n\n```sh\npython -m lds_org -h\n```\n\n### Photos\n\nThe `photo-url` endpoint needs two arguments, an member ID and the type of photo. The photo type is either 'household' or 'individual'. See [LDS Tools Web Services](https://tech.lds.org/wiki/LDS_Tools_Web_Services#Signin_services) for more information.\n\n```python\nfrom pprint import pprint\n\n# Get my personal picture\nwith lds_org.session() as lds:\n rv = lds.get('current-user-id')\n my_id = rv.json()\n rv = lds.get('photo-url', 'individual', member=my_id)\n pprint(rv.json())\n```\n\nIf you know the member ID (use endpoint `current-user-id` for yourself), you can do it from the command line as well with\n\n```sh\npython -m lds_org -e current-user-id\npython -m lds_org -e photo-url -m memberId individual\n```\n\n### JSON\n\nWhen asking for endpoint information from the command line, the output is pretty printed.\nHowever, you may want to take the information and use it. You want the output in JSON.\nUsing the command line option of `-j` the endpoint data is given as JSON.\n\n### Secure your username and password\n\nYou need to keep your username and password secret. However, you also\nwant to automate the process of getting and processing information\nfrom LDS.org. You could put your username and password in your code,\nbut the possibility of sharing your information is very possible when\nyou show or share your code.\n\nThis module can use environment variables containing your username and\npassword. In \\*nix based systems, you can add the following to your\n.bashrc or its equivelent.\n\n```sh\nexport LDSORG_USERNAME=username\nexport LDSORG_PASSWORD=\"password\"\n```\n\nPersonally, I create a seperate file to fix the command line environment.\nI take the above and put it in a file 'ldsorg-password.sh'. From the\ncommand line, type the following and you should see your LDS.org username.\n\n```sh\nsource ldsorg-password.sh\necho $LDSORG_USERNAME\n```\n\nOnce this is done, you no longer need to either enter your credentials from\nthe command line or specify a username/password in your code.\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/jidn/lds-org/tarball/0.2.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.github.com/jidn/lds-org/", "keywords": "lds", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "LDS-org", "package_url": "https://pypi.org/project/LDS-org/", "platform": "", "project_url": "https://pypi.org/project/LDS-org/", "project_urls": { "Download": "https://github.com/jidn/lds-org/tarball/0.2.1", "Homepage": "https://www.github.com/jidn/lds-org/" }, "release_url": "https://pypi.org/project/LDS-org/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Access LDS.org json information", "version": "0.2.1" }, "last_serial": 3414228, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7e2104c9db404bac76ba5fd5bfd8070a", "sha256": "3d21d46d11b75e663ec019650f728c15a23759e2bbd182b003b09db5aeb985bd" }, "downloads": -1, "filename": "LDS_org-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "7e2104c9db404bac76ba5fd5bfd8070a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6875, "upload_time": "2015-03-07T03:26:44", "url": "https://files.pythonhosted.org/packages/b1/37/67595f57f7383834c9b690935a044a06244b908443720a6001aa8aaa06a7/LDS_org-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d83134de33dc2f13c85ce8e0683feca0", "sha256": "f8dd48561885997dc1e2f66809253a34e71df414f84f4785dd9b7773cc50bcd3" }, "downloads": -1, "filename": "LDS-org-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d83134de33dc2f13c85ce8e0683feca0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4555, "upload_time": "2015-03-07T03:26:39", "url": "https://files.pythonhosted.org/packages/56/23/1322aa22a18de0d094c4f34a14c9dd0cb66be12f30f36109c15157b55393/LDS-org-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "d844d17b11f98ae40a700739b002a097", "sha256": "5b4fd1aa4a57fcc10442166de973023ca4c39e627e2a291b9edddf3e867d375c" }, "downloads": -1, "filename": "LDS_org-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d844d17b11f98ae40a700739b002a097", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7079, "upload_time": "2017-08-31T14:51:23", "url": "https://files.pythonhosted.org/packages/54/6e/50b0fd43bb8d9838c616f75fd051a539f9be665bc7ef7b9d172ea1c9d629/LDS_org-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "78c55e6ed5488b00d06d1b980fe8f582", "sha256": "00366ff48d113b62ec7d799d7841b368c1883ba14af05bb7f02631356191270d" }, "downloads": -1, "filename": "LDS-org-0.1.1.tar.gz", "has_sig": false, "md5_digest": "78c55e6ed5488b00d06d1b980fe8f582", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5222, "upload_time": "2017-08-31T14:51:21", "url": "https://files.pythonhosted.org/packages/f1/2c/0648bce50f426c8385884cf7f67b0eddbdbc6cae93763c3d3075034fc665/LDS-org-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "c39e5a4065cc1bb4a5501d891d96d147", "sha256": "f3aba248b65b448468f47e75573bc5d3c5bb2d4854e6d5aedf3df22ea49ffc9e" }, "downloads": -1, "filename": "LDS_org-0.2.0-py2-none-any.whl", "has_sig": false, "md5_digest": "c39e5a4065cc1bb4a5501d891d96d147", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9962, "upload_time": "2017-09-19T06:58:29", "url": "https://files.pythonhosted.org/packages/2d/1b/f5876ac6e67184b002daa22c99837fb22b4f2e17613065de6966836373b9/LDS_org-0.2.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a7cf816d43c2fd348937f98b401b676", "sha256": "36adab533452a0618f04ec17f67ddd2297e49cd9e598ab0467e3912807cbd83d" }, "downloads": -1, "filename": "LDS-org-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4a7cf816d43c2fd348937f98b401b676", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7423, "upload_time": "2017-09-19T06:58:26", "url": "https://files.pythonhosted.org/packages/eb/f3/1e6ab1d5bd454e28799f1a4259db5e7efff09e0822e5d1caa63708fadf4e/LDS-org-0.2.0.tar.gz" } ], "0.2.0a1": [ { "comment_text": "", "digests": { "md5": "453ecda5a29272671a150f2a4b264942", "sha256": "fb8356cc43f93a06f801d39e263fa25168ba33b9d3bff532aa7791ce75594062" }, "downloads": -1, "filename": "LDS_org-0.2.0a1-py3-none-any.whl", "has_sig": false, "md5_digest": "453ecda5a29272671a150f2a4b264942", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 8825, "upload_time": "2017-09-01T19:42:51", "url": "https://files.pythonhosted.org/packages/3e/94/fc541f909dc44e4e71e6ade732519b1b4c77f8163462b23ee7d6fe66ee6d/LDS_org-0.2.0a1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "33ef578787167189d1043e2ac4ca9df7", "sha256": "880c2ea1c3a537d97f1142b2e28f9e07825f34f304ea6350e1b52c5a330136a5" }, "downloads": -1, "filename": "LDS-org-0.2.0a1.tar.gz", "has_sig": false, "md5_digest": "33ef578787167189d1043e2ac4ca9df7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6427, "upload_time": "2017-09-01T19:42:50", "url": "https://files.pythonhosted.org/packages/47/ad/6d7f91e028dd76b7e11b75ed783036a6aae50e45233f6654fc8b2dfc3974/LDS-org-0.2.0a1.tar.gz" } ], "0.2.0rc2": [ { "comment_text": "", "digests": { "md5": "61e19cc55763f54b95181f4f39554c64", "sha256": "e3289b5c6b708a334abcb691324dc0d8d17f0b9b801619e87b5ee3b6db8ee5ea" }, "downloads": -1, "filename": "LDS_org-0.2.0rc2-py2-none-any.whl", "has_sig": false, "md5_digest": "61e19cc55763f54b95181f4f39554c64", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9360, "upload_time": "2017-09-04T15:22:16", "url": "https://files.pythonhosted.org/packages/38/ba/084893d088789b1573fee1e26a0d09fa5941a35f4a162976c57231f9ebea/LDS_org-0.2.0rc2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4a3735d0670ceecd4af4c661f29b698b", "sha256": "6fe7edf528d70f20dbec551d7e2c3bde454a943063ea233e2d60ebea06aafb07" }, "downloads": -1, "filename": "LDS-org-0.2.0rc2.tar.gz", "has_sig": false, "md5_digest": "4a3735d0670ceecd4af4c661f29b698b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6801, "upload_time": "2017-09-04T15:22:14", "url": "https://files.pythonhosted.org/packages/f6/b2/87b03594c03573a620c8b602fceab06cbdc56b15efa991fa0cd5c40642b3/LDS-org-0.2.0rc2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f10392519799bc352bbb6f7c7ae2b95a", "sha256": "0a769de07561bc97cd7751a6393e07d1a06bf84f22cf482afe0d238c6111a8d7" }, "downloads": -1, "filename": "LDS_org-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f10392519799bc352bbb6f7c7ae2b95a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9971, "upload_time": "2017-12-13T19:28:57", "url": "https://files.pythonhosted.org/packages/fe/96/e4c9e718d551bd2f54d611595bce3e63ea236688aedcd1e62fe4c54394aa/LDS_org-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "331c19d1230e6a29824a39990c695382", "sha256": "05b1cb61f71dbba8e3f397e4cb4b73dd3ee3b3bcebe1bfe3a3dbde9312a2012b" }, "downloads": -1, "filename": "LDS-org-0.2.1.tar.gz", "has_sig": false, "md5_digest": "331c19d1230e6a29824a39990c695382", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7428, "upload_time": "2017-12-13T19:28:55", "url": "https://files.pythonhosted.org/packages/12/f0/b611fc6e3984ae0f8f21f4431062ace25c59b708879a49c8b7555e16366d/LDS-org-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f10392519799bc352bbb6f7c7ae2b95a", "sha256": "0a769de07561bc97cd7751a6393e07d1a06bf84f22cf482afe0d238c6111a8d7" }, "downloads": -1, "filename": "LDS_org-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f10392519799bc352bbb6f7c7ae2b95a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 9971, "upload_time": "2017-12-13T19:28:57", "url": "https://files.pythonhosted.org/packages/fe/96/e4c9e718d551bd2f54d611595bce3e63ea236688aedcd1e62fe4c54394aa/LDS_org-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "331c19d1230e6a29824a39990c695382", "sha256": "05b1cb61f71dbba8e3f397e4cb4b73dd3ee3b3bcebe1bfe3a3dbde9312a2012b" }, "downloads": -1, "filename": "LDS-org-0.2.1.tar.gz", "has_sig": false, "md5_digest": "331c19d1230e6a29824a39990c695382", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7428, "upload_time": "2017-12-13T19:28:55", "url": "https://files.pythonhosted.org/packages/12/f0/b611fc6e3984ae0f8f21f4431062ace25c59b708879a49c8b7555e16366d/LDS-org-0.2.1.tar.gz" } ] }