{ "info": { "author": "Daw-Ran Liou", "author_email": "dawran6@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Terminals" ], "description": "# Environmentalist - use API secrets easily\n\nEnvironmentalist helps API users to retrive API secrets from the environment\neasily.\n\n## The problem\n\nI'm tired of rewriting the following code over and over again to get my app key\nfrom the environment variables.\n\n```python\nimport os\nfrom requests_oauthlib import OAuth1Session\napi = OAuth1Session(client_key=os.environ.get('TWITTER_CLIENT_KEY'),\n client_secret=os.environ.get('TWITTER_CLIENT_SECRET'),\n resource_owner_token=os.environ.get('TWITTER_RESOURCE_OWNER_TOKEN'),\n resource_owner_secret=os.environ.get('TWITTER_RESOURCE_OWNER_SECRET'))\n```\n\n## Project dependencies\n\n1. N/A\n\n## Usage\n\nUse an instance to easily create your API instance, for example:\n\n```bash\n# Create environment variables with the same prefix\nset TWITTER_CLIENT_KEY=xxx\nset TWITTER_CLIENT_SECRET=xxx\nset TWITTER_RESOURCE_OWNER_TOKEN=xxx\nset TWITTER_RESOURCE_OWNER_SECRET=xxx\n```\n\n```python\nfrom environmentalist import E\n\napi = OAuth1Session(**E(prefix='TWITTER'))\n\napi.get('https://api.twitter.com/1.1/statuses/home_timeline.json')\n```\n\nWhen you create the `E` instance, it filter and strips the prefix out of the\nenvironment variables.\n\nOr you can dump all the environment variables for no reason:\n\n```python\nprint(E())\n# {'HOME': '...', ...}\n```\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dawran6/100days/tree/master/006", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "environmentalist", "package_url": "https://pypi.org/project/environmentalist/", "platform": "", "project_url": "https://pypi.org/project/environmentalist/", "project_urls": { "Homepage": "https://github.com/dawran6/100days/tree/master/006" }, "release_url": "https://pypi.org/project/environmentalist/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Accessing environment variables for lazy people.", "version": "0.1.1" }, "last_serial": 3404857, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "24d48c18f4eeb1f0cfe8beeac8b01b2e", "sha256": "194a9fa2fab11d8e9c25eda4aef9171fdd2cc32324186081e0becf06282d017e" }, "downloads": -1, "filename": "environmentalist-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "24d48c18f4eeb1f0cfe8beeac8b01b2e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4119, "upload_time": "2017-12-09T07:06:15", "url": "https://files.pythonhosted.org/packages/52/29/784e9b90688dcc52ac3fd642ecbd72a3d22781c1446f270bea1f1d485004/environmentalist-0.1.0-py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e8afff2515bc47f27f8970068d616c55", "sha256": "b30228b77d69e5bb82865a9c09019f032c0e9a574db7ddbdddbdb2cd440e5f29" }, "downloads": -1, "filename": "environmentalist-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e8afff2515bc47f27f8970068d616c55", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4120, "upload_time": "2017-12-10T07:02:25", "url": "https://files.pythonhosted.org/packages/7c/4b/f72e26182463b28ba3417317b9bf46d09b9a9f8b6137286354669ce3be2f/environmentalist-0.1.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e8afff2515bc47f27f8970068d616c55", "sha256": "b30228b77d69e5bb82865a9c09019f032c0e9a574db7ddbdddbdb2cd440e5f29" }, "downloads": -1, "filename": "environmentalist-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e8afff2515bc47f27f8970068d616c55", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4120, "upload_time": "2017-12-10T07:02:25", "url": "https://files.pythonhosted.org/packages/7c/4b/f72e26182463b28ba3417317b9bf46d09b9a9f8b6137286354669ce3be2f/environmentalist-0.1.1-py3-none-any.whl" } ] }