{ "info": { "author": "Layer 7 Solutions (Mike Wohlrab)", "author_email": "Mike@Layer7.Solutions", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# What is this?\n\nThis is a set of utilities used by https://Layer7.Solutions for the software tools we create. It includes a logger with default configuration information we setup as well as an oAuth wrapper to be able to pull login information from a custom database.\n\nTo create the oAuth database, the following creation SQL can be used:\n\n```sql\ncreate table oauth_data\n(\n username text not null\n constraint oauth_pkey\n primary key,\n password text,\n app_id text,\n app_secret text,\n app_refresh text,\n agent_of text\n);\n```\n# How To Build And Install\n\n1. Be inside the root of the folder\n2. Run `python3 setup.py sdist`\n3. Run `pip install .`\n\n---\n\n# How To Use:\n\n### Logger:\n\nThis creates a custom logger using default file handler, sentry.io integration, and log rotation. A default logspath is set to '/opt/skynet/RedditBots/logs/' however you can override that to your own location.\nInitialization and configuration.\n\nNote, if using the new sentry_sdk then you need to add the following import and line after the variables but before the creation of the logger. The `raven` parameter for `LoggerConfig()` also needs to be set to False.\n\n```Python\nimport sentry_sdk\nsentry_sdk.init(dsn=__dsn__, release=__version__)\n```\n\nIf you are going to use the legacy Raven then you need to install Raven as a pre-req: `pip install raven`.\n\n```Python\nimport logging.config\nfrom layer7_utilities import LoggerConfig\n\n__botname__ = 'Short_Name_For_The_Bot'\n__description__ = 'Description of the bot'\n__author__ = 'Authors Name/Info'\n__version__ = '1.2.3'\n__dsn__ = 'Get from Sentry.io'\n\n# Sets up the sentry_sdk integration:\nimport sentry_sdk\nsentry_sdk.init(dsn=__dsn__, release=__version__)\n\n\n# Create the logger (with Raven (legacy) disabled)\nlogspath = 'Path/To/The/Logs/Folder/' # With trailing backslash.\nloggerconfig = LoggerConfig(__dsn__, __botname__, __version__, logspath, raven=False)\nlogging.config.dictConfig(loggerconfig.get_config())\nlogger = logging.getLogger('root')\nlogger.info(u\"/*********Starting App*********\\\\\")\nlogger.info(u\"App Name: {} | Version: {}\".format(__botname__, __version__))\n```\n\n\n### Auth\n\nAuth relies on a custom table housing the Reddit application ID, Secret, Username, Password, etc. This is not intended to be setup by anyone else. However if you have access to our database, or are writing a bot that will take advantage, then it can be setup as such.\n\nIn the Layer 7 environment the Auth Database Table is 'TheTraveler'.\n\n```Python\nfrom layer7_utilities import oAuth\n\n__botname__ = 'Short_Name_For_The_Bot'\n__description__ = 'Description of the bot'\n__author__ = 'Authors Name/Info'\n__version__ = '1.2.3'\n__dsn__ = 'Get from Sentry.io'\n__agent_of__ = 'category value'\n\nauth = oAuth()\nauth.get_accounts(__agent_of__, __description__, __version__, __author__, __botname__, DB_USERNAME, DB_PASSWORD, DB_HOST, DatabaseTableName)\n\nfor account in auth.accounts:\n r = account.login()\n me = r.user.me()\n print('Started Reddit Instance: u/%s' % me)\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://Layer7.Solutions", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Layer-7-Utilities", "package_url": "https://pypi.org/project/Layer-7-Utilities/", "platform": "", "project_url": "https://pypi.org/project/Layer-7-Utilities/", "project_urls": { "Homepage": "https://Layer7.Solutions" }, "release_url": "https://pypi.org/project/Layer-7-Utilities/1.2.11/", "requires_dist": null, "requires_python": "", "summary": "This is a set of utilities used by https://Layer7.Solutions for the software tools we create. It includes a logger with default configuration information we setup as well as an oAuth wrapper to be able to pull login information from a custom database.", "version": "1.2.11" }, "last_serial": 5408096, "releases": { "1.2.10": [ { "comment_text": "", "digests": { "md5": "9b123f2c3896c96772111eb1f8e72e56", "sha256": "e64cfbfcfcd1f74a1be6e61fba2435c212f73ab5ec37739f477077519edd3d1d" }, "downloads": -1, "filename": "Layer-7-Utilities-1.2.10.tar.gz", "has_sig": false, "md5_digest": "9b123f2c3896c96772111eb1f8e72e56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5376, "upload_time": "2019-02-18T20:18:58", "url": "https://files.pythonhosted.org/packages/50/84/4dd3bb978cc66bcba9eb7fdee41c8fe6b39639097c4fcb86a8c409575f40/Layer-7-Utilities-1.2.10.tar.gz" } ], "1.2.11": [ { "comment_text": "", "digests": { "md5": "2c00688bd95c2ddfc88533b21ba2b0af", "sha256": "6f72d1feb8d6644b3c92b8893a349c3765f043fa63622f71c6c73c73d5a321d8" }, "downloads": -1, "filename": "Layer_7_Utilities-1.2.11-py3-none-any.whl", "has_sig": false, "md5_digest": "2c00688bd95c2ddfc88533b21ba2b0af", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7767, "upload_time": "2019-02-25T00:41:08", "url": "https://files.pythonhosted.org/packages/a0/b8/9c716d4c86134a89b4bc642dffaba80f93c96d6cdeb56b6b8e16f858f3f5/Layer_7_Utilities-1.2.11-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37dcaf081c104c9ad562b8c24dc296b7", "sha256": "f0d89a473009dfc23a5e051b9edc788619013a95614634cc39ebf99c60d04dcb" }, "downloads": -1, "filename": "Layer-7-Utilities-1.2.11.tar.gz", "has_sig": false, "md5_digest": "37dcaf081c104c9ad562b8c24dc296b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5627, "upload_time": "2019-02-23T05:22:23", "url": "https://files.pythonhosted.org/packages/29/ec/150e19081385e244814919b1f98d46c00edbab36742ab6e7a2d84388eb8c/Layer-7-Utilities-1.2.11.tar.gz" } ], "1.2.11rc1": [ { "comment_text": "", "digests": { "md5": "a8e478ae5b08c32b7e4d400d0d41d0d4", "sha256": "7041697794adaca5a6df0affb20a63cea1c9c4ba8a583d88cd0bc6677ffc6970" }, "downloads": -1, "filename": "Layer-7-Utilities-1.2.11rc1.tar.gz", "has_sig": false, "md5_digest": "a8e478ae5b08c32b7e4d400d0d41d0d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5432, "upload_time": "2019-02-20T04:50:19", "url": "https://files.pythonhosted.org/packages/c1/25/22626a72de131d03e7a5a0907bd3087c0bac306077869f803ee904d0aadc/Layer-7-Utilities-1.2.11rc1.tar.gz" } ], "1.2.11rc10": [ { "comment_text": "", "digests": { "md5": "5da074d76c7c5dbb9c0e5018a2713f10", "sha256": "c3d6b35552c20bb5bf6d84fd8cf0895a0bbfc37aab4056016d128bb43c6c4f25" }, "downloads": -1, "filename": "Layer-7-Utilities-1.2.11rc10.tar.gz", "has_sig": false, "md5_digest": "5da074d76c7c5dbb9c0e5018a2713f10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5645, "upload_time": "2019-02-21T02:45:35", "url": "https://files.pythonhosted.org/packages/ed/91/45b2b5c2a9b0097241fe102fbe7d33c95f813e4bb739edc8d96d63e6a139/Layer-7-Utilities-1.2.11rc10.tar.gz" } ], "1.2.11rc9": [ { "comment_text": "", "digests": { "md5": "40c788e96af24948c2c05bb5d4db5333", "sha256": "f14c0763f626724e93a89322bbde0bcbf45ad7de73f24c7faa65dfcd6d50ef74" }, "downloads": -1, "filename": "Layer-7-Utilities-1.2.11rc9.tar.gz", "has_sig": false, "md5_digest": "40c788e96af24948c2c05bb5d4db5333", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5678, "upload_time": "2019-02-21T02:23:59", "url": "https://files.pythonhosted.org/packages/d8/7e/4bb472fc3d39d14f70dd49ead6fc017158c1ff7283ce66f68ddd71b9048f/Layer-7-Utilities-1.2.11rc9.tar.gz" } ], "1.2.12rc0": [ { "comment_text": "", "digests": { "md5": "cde2e2ec9c7a3ac61f9ff351c3322d5d", "sha256": "a4500408d26c441ee984c2ef84b4fa0b73b0d41a317887f03a80e5a88d615129" }, "downloads": -1, "filename": "Layer_7_Utilities-1.2.12rc0-py3-none-any.whl", "has_sig": false, "md5_digest": "cde2e2ec9c7a3ac61f9ff351c3322d5d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7804, "upload_time": "2019-06-17T01:36:29", "url": "https://files.pythonhosted.org/packages/bf/28/0915f47dbd7c130a4c5d5aad07ced588fa44deb22618b1902ac6cb216b36/Layer_7_Utilities-1.2.12rc0-py3-none-any.whl" } ], "1.2.9rc1": [ { "comment_text": "", "digests": { "md5": "189d365249588e08a5f31f2a357ce8e9", "sha256": "aecaa62188b5580c2c5266253cd584018abdda96aafa7ca1ac6c935dca913427" }, "downloads": -1, "filename": "Layer-7-Utilities-1.2.9rc1.tar.gz", "has_sig": false, "md5_digest": "189d365249588e08a5f31f2a357ce8e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5387, "upload_time": "2019-02-18T20:18:59", "url": "https://files.pythonhosted.org/packages/cf/78/a6c1d70879c5206db2f4b0f40328b50d541f201a028249b6bd020baccd87/Layer-7-Utilities-1.2.9rc1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2c00688bd95c2ddfc88533b21ba2b0af", "sha256": "6f72d1feb8d6644b3c92b8893a349c3765f043fa63622f71c6c73c73d5a321d8" }, "downloads": -1, "filename": "Layer_7_Utilities-1.2.11-py3-none-any.whl", "has_sig": false, "md5_digest": "2c00688bd95c2ddfc88533b21ba2b0af", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7767, "upload_time": "2019-02-25T00:41:08", "url": "https://files.pythonhosted.org/packages/a0/b8/9c716d4c86134a89b4bc642dffaba80f93c96d6cdeb56b6b8e16f858f3f5/Layer_7_Utilities-1.2.11-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "37dcaf081c104c9ad562b8c24dc296b7", "sha256": "f0d89a473009dfc23a5e051b9edc788619013a95614634cc39ebf99c60d04dcb" }, "downloads": -1, "filename": "Layer-7-Utilities-1.2.11.tar.gz", "has_sig": false, "md5_digest": "37dcaf081c104c9ad562b8c24dc296b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5627, "upload_time": "2019-02-23T05:22:23", "url": "https://files.pythonhosted.org/packages/29/ec/150e19081385e244814919b1f98d46c00edbab36742ab6e7a2d84388eb8c/Layer-7-Utilities-1.2.11.tar.gz" } ] }