{ "info": { "author": "John-Paul Jorissen", "author_email": "jjorissen52@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: Microsoft :: Windows :: Windows 10", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.6", "Topic :: Office/Business" ], "description": "\n# tokenbox\nRESTful API token management utility \n\n### Description\nRESTful APIs require you to manage and refresh authorization tokens. When starting out with a new API, you don't really want to mess with that stuff; you just want the tokens to go somewhere you can get them whenever you need them and ignore them the rest of the time. `tokenbox` is designed to facilitate putting them somewhere, like a nice neat little box in the corner.\n\nTokenbox will ensure that there is only 1 row in any database that it manages, so you don't need to worry about databases taking up unnecessary disk space.\n\nWith no configuration, `tokenbox` is capable of generating SQLite databases. Here is a description the arguments that an instance of TokenBox expects from `tokenbox.py`\n\n* `db_user (string)`: user of db login role (must be capable of creating a PG database)\n* `db_password (string)`: password of db login role\n* `db_name (string)`: name of database to be created/managed\n* `use_sqlite (bool)`: whether or not to use sqlite\n* `metadata (sqlalchemy.MetaData)`: metadata used in table definitions \n* `kwargs (sqlalchemy.Table)`: names of Tables and corresponding definitions \n\nBelow is an example of creating an SQLite database for multiple tokens. These tables were designed for use with the Bullhorn api.\n\n\n```python\nfrom sqlalchemy import Table, MetaData, Column, Integer, String\nfrom tokenbox import TokenBox\n\nmetadata = MetaData()\n\ntable_definitions = {\n \"login_token\": Table(\"login_token\", metadata,\n # primary key must be in the format '{table_name}_pk`\n Column(\"login_token_pk\", Integer, primary_key=True),\n Column('access_token', String(45), nullable=False),\n Column('expires_in', Integer, nullable=False),\n Column('refresh_token', String(45), nullable=False),\n Column('token_type', String(45), nullable=False),\n Column('expiry', Integer, nullable=False),\n ),\n \"access_token\": Table(\"access_token\", metadata,\n # primary key must be in the format '{table_name}_pk` \n Column(\"access_token_pk\", Integer, primary_key=True),\n Column('rest_token', String(45), nullable=False),\n Column('rest_url', String(60), nullable=False)\n )\n}\n\nuse_sqlite = True\n\ntokenbox = TokenBox('db_user', 'db_pass', 'tokenbox_test', use_sqlite, metadata, **table_definitions)\n# Creates a database corresponding to the arguments passed during TokenBox initialization\ntokenbox.create_database()\n# Updates (or inserts) the row into the 'login_token' table (there can only be one row!)\ntokenbox.update_token('login_token', access_token=\"12341234123asdfasdf4\", expires_in=300,\n refresh_token=\"asdfkk23784987123khjga\", token_type=\"login\", expiry=12312312)\n# Updates (or inserts) the row into the 'access_token' table (there can only be one row!)\ntokenbox.update_token('access_token', rest_token=\"12341234123asdfasdf4\", rest_url=\"asdfkk23784987123khjga\")\n# Gets the row from the 'login_token' table (there's only one row in storage!)\nlogin_token = tokenbox.get_token('login_token')\nprint(login_token.items())\n# Gets the row from the 'access_token' table (there's only one row in storage!)\naccess_token = tokenbox.get_token('access_token')\nprint(access_token.items())\n\ntokenbox.destroy_database()\n```\n\n [('login_token_pk', 1), ('access_token', '12341234123asdfasdf4'), ('expires_in', 300), ('refresh_token', 'asdfkk23784987123khjga'), ('token_type', 'login'), ('expiry', 12312312)]\n [('access_token_pk', 1), ('rest_token', '12341234123asdfasdf4'), ('rest_url', 'asdfkk23784987123khjga')]\n This will destroy the database named tokenbox_test. Perform Keyboard Interrupt to abort.\n tokenbox_test dropped successfully.\n\n\nHope this does you some good!\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/jjorissen52/tokenbox", "keywords": "RESTful API Authorization Token Storage", "license": "Apache", "maintainer": "", "maintainer_email": "", "name": "tokenbox", "package_url": "https://pypi.org/project/tokenbox/", "platform": "", "project_url": "https://pypi.org/project/tokenbox/", "project_urls": { "Homepage": "https://github.com/jjorissen52/tokenbox" }, "release_url": "https://pypi.org/project/tokenbox/1.1.1.dev0/", "requires_dist": null, "requires_python": "", "summary": "RESTful API token management utility", "version": "1.1.1.dev0" }, "last_serial": 3159346, "releases": { "1.0.0.dev0": [ { "comment_text": "", "digests": { "md5": "73a9246cb9a8668d0cdd1c6a53cc857b", "sha256": "f0ece6f9041e7450415490647c3601287e693885ba5b78e151bf9ce9bd283eaf" }, "downloads": -1, "filename": "tokenbox-1.0.0.dev0.tar.gz", "has_sig": false, "md5_digest": "73a9246cb9a8668d0cdd1c6a53cc857b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4556, "upload_time": "2017-08-24T21:48:27", "url": "https://files.pythonhosted.org/packages/6b/41/5107e992d7af6ccdb3e712ecb8f417ca2500eed6b3b6a19b1b02ee1cb128/tokenbox-1.0.0.dev0.tar.gz" } ], "1.0.1.dev0": [ { "comment_text": "", "digests": { "md5": "68c87095770f885d09dec48cc5fea5cd", "sha256": "c2298e2467591cd182e6ece96f23b19c3e9cc09ce3488b886fa6d7965dc3b52b" }, "downloads": -1, "filename": "tokenbox-1.0.1.dev0.tar.gz", "has_sig": false, "md5_digest": "68c87095770f885d09dec48cc5fea5cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4582, "upload_time": "2017-08-25T16:53:35", "url": "https://files.pythonhosted.org/packages/6c/fd/edad25566f00cb075d91cbd4b599beecb73c68c4b43c13d78665c6931ef1/tokenbox-1.0.1.dev0.tar.gz" } ], "1.0.2.dev0": [ { "comment_text": "", "digests": { "md5": "7c1c647655675e6c780e9ca0194f5bfa", "sha256": "fc33a4f8788b94a2c18c93d6c85f807ae375544d0dcf62a45f4faaad7789fe61" }, "downloads": -1, "filename": "tokenbox-1.0.2.dev0.tar.gz", "has_sig": false, "md5_digest": "7c1c647655675e6c780e9ca0194f5bfa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4587, "upload_time": "2017-08-25T16:56:34", "url": "https://files.pythonhosted.org/packages/2f/a0/5745d5d73a9f11c72229a9bdb7b4ca4d417bfaeadecf3914a2a34338ee31/tokenbox-1.0.2.dev0.tar.gz" } ], "1.0.3.dev0": [ { "comment_text": "", "digests": { "md5": "2d297a5ca76ef878caca96cf677369bc", "sha256": "475a066a9db712eebaf083b4873c1dbc018ba13fe4c38ebd7fcefcea557311a9" }, "downloads": -1, "filename": "tokenbox-1.0.3.dev0.tar.gz", "has_sig": false, "md5_digest": "2d297a5ca76ef878caca96cf677369bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4611, "upload_time": "2017-08-25T17:06:36", "url": "https://files.pythonhosted.org/packages/9f/52/1c03a1977425891c5329f15a3c5bafc4b6c5a51afaf9ae1d59637760a21f/tokenbox-1.0.3.dev0.tar.gz" } ], "1.0.4.dev0": [ { "comment_text": "", "digests": { "md5": "4196dca86cda98457fd5bfd619bb4017", "sha256": "694a4b63b1779e9760718afa73e854eafcd365e6f5129df37b64ef184e95ec0d" }, "downloads": -1, "filename": "tokenbox-1.0.4.dev0.tar.gz", "has_sig": false, "md5_digest": "4196dca86cda98457fd5bfd619bb4017", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4603, "upload_time": "2017-08-25T17:32:41", "url": "https://files.pythonhosted.org/packages/ee/02/ac7342c88f467bf82a383aafa8633166491f523779237e05d6f671092496/tokenbox-1.0.4.dev0.tar.gz" } ], "1.0.5.dev0": [ { "comment_text": "", "digests": { "md5": "b1fbdbe314b72101f601ca17546f5491", "sha256": "acb6df8d5514387a53144ffa8dc14c2de94edca462920ac0129bbb036c236039" }, "downloads": -1, "filename": "tokenbox-1.0.5.dev0.tar.gz", "has_sig": false, "md5_digest": "b1fbdbe314b72101f601ca17546f5491", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4620, "upload_time": "2017-08-28T14:42:01", "url": "https://files.pythonhosted.org/packages/6a/bf/816d6ef8cd160c69a0912eac1144f9de01574e9db6858116edc090bd384b/tokenbox-1.0.5.dev0.tar.gz" } ], "1.1.0.dev0": [ { "comment_text": "", "digests": { "md5": "1ba94d0b5f5b01799ef2937b9951687a", "sha256": "5bc8e63ce93014526d341e599dad876bb02c7ac7d7717a6086f43646f77ae425" }, "downloads": -1, "filename": "tokenbox-1.1.0.dev0.tar.gz", "has_sig": false, "md5_digest": "1ba94d0b5f5b01799ef2937b9951687a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4630, "upload_time": "2017-08-31T16:29:14", "url": "https://files.pythonhosted.org/packages/a2/e8/9c194ee8d3f1068d9c258a97d3534231b36f2b2259051879b02db499aa12/tokenbox-1.1.0.dev0.tar.gz" } ], "1.1.1.dev0": [ { "comment_text": "", "digests": { "md5": "47d7d24d3331f93a7d5bc60a9b7a552e", "sha256": "b72233a0c707f80f19a3f0037155ea5df21a39dece23e66066af516b1cc93bfc" }, "downloads": -1, "filename": "tokenbox-1.1.1.dev0.tar.gz", "has_sig": false, "md5_digest": "47d7d24d3331f93a7d5bc60a9b7a552e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4733, "upload_time": "2017-09-08T14:16:54", "url": "https://files.pythonhosted.org/packages/61/85/cbbca53e3c7056e494c1c67de9f9764015899038baa9e4b4e96e55b51143/tokenbox-1.1.1.dev0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "47d7d24d3331f93a7d5bc60a9b7a552e", "sha256": "b72233a0c707f80f19a3f0037155ea5df21a39dece23e66066af516b1cc93bfc" }, "downloads": -1, "filename": "tokenbox-1.1.1.dev0.tar.gz", "has_sig": false, "md5_digest": "47d7d24d3331f93a7d5bc60a9b7a552e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4733, "upload_time": "2017-09-08T14:16:54", "url": "https://files.pythonhosted.org/packages/61/85/cbbca53e3c7056e494c1c67de9f9764015899038baa9e4b4e96e55b51143/tokenbox-1.1.1.dev0.tar.gz" } ] }