{ "info": { "author": "Sam Carson", "author_email": "me@samcarson.xyz", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "\n# yggdrasil-py\n [![PyPI Version](https://img.shields.io/pypi/v/yggdrasil-py)](https://pypi.org/project/yggdrasil-py/)\n [![MIT Licence](https://img.shields.io/github/license/samcarsonx/yggdrasil-py)](https://github.com/samcarsonx/yggdrasil-py/blob/master/LICENSE.txt)\n [![Forks](https://img.shields.io/github/forks/samcarsonx/yggdrasil-py)](https://github.com/samcarsonx/yggdrasil-py/fork)\n ![Stars](https://img.shields.io/github/stars/samcarsonx/yggdrasil-py)\n [![Open Issues](https://img.shields.io/github/issues/samcarsonx/yggdrasil-py)](https://github.com/samcarsonx/yggdrasil-py/issues)\n ![Supported Versions](https://img.shields.io/pypi/pyversions/yggdrasil-py)\n ![Last Commit](https://img.shields.io/github/last-commit/samcarsonx/yggdrasil-py)\n ![Commits since last release](https://img.shields.io/github/commits-since/samcarsonx/yggdrasil-py/latest)\n ![](https://img.shields.io/pypi/status/yggdrasil-py)\n\nOpen-source Python 3.6+ wrapper by **Sam Carson** for the **Mojang Yggdrasil authentication service.** Please reference [the documentation](https://wiki.vg/Authentication) for extra information.\n\n**Install via PyPI using the following command:** `pip install yggdrasil-py`\n\nThis wrapper is supported only for Python 3.6 and above because of the use of f-strings when an `Exception` is raised. You could easily modify the code to use `%s` formatting or the `.format()` function, but they are not as efficient.\n\nMinecraft 1.6 introduced a new authentication scheme called **Yggdrasil** which completely replaces the [previous authentication system](https://wiki.vg/Legacy_Authentication \"Legacy Authentication\"). Mojang's other game, Scrolls, uses this method of authentication as well.\n\n## Authenticate\n*Authenticates a user using their password.*\n```python\ndef authenticate(username:str, password:str, agentName:str = 'Minecraft', clientToken:str = None, requestUser:str = False):\n```\n**Arguments:**\n* String *(required)*\nUsername of agent/Mojang email (if migrated)\n* String *(required)*\nPassword for the account used\n* String *(optional)*\nAgent, defaults to `Minecraft`, can also be `Scrolls`\n* String *(optional)*\nClient identifier, must be random and identical per request\n* Boolean *(optional)*\nIf set to `True` request for user object too (default is `False`)\n\n**Response:**\n* Check the Authenticate section of [the documentation](https://wiki.vg/Authentication#Authenticate) for details.\n\n**Example:**\n```python\nfrom yggdrasil import authenticate\nimport random\n\nrandomClientToken = random.randint(10000,99999)\nmc = authenticate('test@example.com','p455w0rd', 'Minecraft', randomClientToken, False)\nprint(mc['accessToken'])\n```\n\n## Refresh\n*Refreshes a valid accessToken. It can be used to keep a user logged in between gaming sessions and is preferred over storing the user's password in a file.*\n```python\ndef refresh(accessToken:str, clientToken:str, requestUser:bool = False):\n```\n**Arguments:**\n* String *(required)*\nValid `accessToken`, gained from `authenticate()`\n* String *(required)*\nIdentical to the `clientToken` used to get the `accessToken` in the first place\n* Boolean *(optional)*\nIf set to `True` request for user object too (default is `False`)\n\n**Response:**\n* Check the Refresh section of [the documentation](https://wiki.vg/Authentication#Refresh) for details.\n\n**Example:**\n```python\nfrom yggdrasil import refresh\nprint(refresh(mc['accessToken'], randomClientToken))\n# Note: invalidates inputted accessToken\n```\n\n## Validate\n*Checks if an accessToken is usable for authentication with a Minecraft server.*\n```python\ndef validate(accessToken:str, clientToken:str = None):\n```\n**Arguments:**\n* String *(required)*\nValid `accessToken`, gained from `authenticate()`\n* String *(optional)*\nIdentical to the `clientToken` used to get the `accessToken` in the first place\n\n**Response:**\n* Returns Boolean for whether `accessToken` is valid (and `clientToken` match, if defined)\n\n**Example:**\n```python\nfrom yggdrasil import validate\nprint(validate(mc['accessToken'], randomClientToken))\n```\n\n## Signout\n*Invalidates accessTokens using an account's username and password.*\n```python\ndef signout(username:str, password:str):\n```\n**Arguments:**\n* String *(required)*\nUsername of agent/Mojang email (if migrated)\n* String *(required)*\nPassword for the account used\n\n**Response:**\n* Returns `True` unless error thrown\n\n**Example:**\n```python\nfrom yggdrasil import signout\nprint(signout('test@example.com','p455w0rd'))\n```\n\n## Invalidate\n*Invalidates accessTokens using a client/access token pair.*\n```python\ndef invalidate(accessToken:str, clientToken:str):\n```\n**Arguments:**\n* String *(required)*\nValid `accessToken`, gained from `authenticate()`\n* String *(required)*\nIdentical to the `clientToken` used to get the `accessToken` in the first place\n\n**Response:**\n* Returns `True` unless error thrown\n\n**Example:**\n```python\nfrom yggdrasil import invalidate\nprint(signout(mc['accessToken'], randomClientToken))\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/samcarsonx/yggdrasil-py/archive/1.0.6.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/samcarsonx/yggdrasil-py", "keywords": "mojang,yggdrasil,minecraft,scrolls,authentication", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "yggdrasil-py", "package_url": "https://pypi.org/project/yggdrasil-py/", "platform": "", "project_url": "https://pypi.org/project/yggdrasil-py/", "project_urls": { "Download": "https://github.com/samcarsonx/yggdrasil-py/archive/1.0.6.tar.gz", "Homepage": "https://github.com/samcarsonx/yggdrasil-py" }, "release_url": "https://pypi.org/project/yggdrasil-py/1.0.6/", "requires_dist": null, "requires_python": "", "summary": "Python wrapper for Mojang's Yggdrasil authentication service.", "version": "1.0.6" }, "last_serial": 5652255, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "f253ccdc6d640f2bd3fefaa0ce5bda9d", "sha256": "9a1f7d3ac0778c11128a0a4194eaff349325fefb6ee7562d9d21a2a967a450a5" }, "downloads": -1, "filename": "yggdrasil-py-1.0.tar.gz", "has_sig": false, "md5_digest": "f253ccdc6d640f2bd3fefaa0ce5bda9d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2080, "upload_time": "2019-08-06T10:39:22", "url": "https://files.pythonhosted.org/packages/1a/4d/71a3c2b17ccfbd20da119c23cd67f5f6735bba3e0f1e99a403e1cec91595/yggdrasil-py-1.0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "3146de91f629251ce54a2d35743faccb", "sha256": "b89f3305f1d1a136fa9dcdfc0a153f99a0a5cd39eb2eb5fa93667228c5667dc8" }, "downloads": -1, "filename": "yggdrasil_py-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3146de91f629251ce54a2d35743faccb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6800, "upload_time": "2019-08-06T11:23:32", "url": "https://files.pythonhosted.org/packages/79/e2/7d2d187e4bfb5017ef75ff0d65e35f21d452db785fd4022763040085ea9d/yggdrasil_py-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5fa35722b670677c5ca674b6d89189f3", "sha256": "90a0cd22dab7da7d96120df4b2d1f3044b9b3601ede087f935a12e1fec16fcc8" }, "downloads": -1, "filename": "yggdrasil-py-1.0.2.tar.gz", "has_sig": false, "md5_digest": "5fa35722b670677c5ca674b6d89189f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3620, "upload_time": "2019-08-06T11:23:33", "url": "https://files.pythonhosted.org/packages/f1/81/d2a5029e7c64c36c5d1e4d9efc33a2c8b5b573538f5c1bda443698ad903b/yggdrasil-py-1.0.2.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "6f41f15a4e02311d1c425473f169f07a", "sha256": "b58bd6f3fdd0536c14d1733efc9d850fd3d9fb7935e022426972fd4deadcaecb" }, "downloads": -1, "filename": "yggdrasil_py-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "6f41f15a4e02311d1c425473f169f07a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6799, "upload_time": "2019-08-06T11:30:36", "url": "https://files.pythonhosted.org/packages/f9/f0/b6b2cfe8ea6fb77c128b8ccad49a02b2bbfdd59497e7146b656adacabd83/yggdrasil_py-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7482b4696bd15e97fd27868f16da0a9f", "sha256": "a9e20bbaff63b0a9feab791a6a15972bf845faf6667b2b14a0201d7e0fb3ba43" }, "downloads": -1, "filename": "yggdrasil-py-1.0.4.tar.gz", "has_sig": false, "md5_digest": "7482b4696bd15e97fd27868f16da0a9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3619, "upload_time": "2019-08-06T11:30:39", "url": "https://files.pythonhosted.org/packages/a9/a1/7dc11b4deb926b1bd1135869c70f9614e40cc123e46dd1c176c67b495aa0/yggdrasil-py-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "4d7ef7157d59bef7f4d1e5b7f5c991d3", "sha256": "947ff06b37703f1e674d2671f93b74040f1bb8dbd69ae15ea3c486408d9aa0f2" }, "downloads": -1, "filename": "yggdrasil_py-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "4d7ef7157d59bef7f4d1e5b7f5c991d3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7058, "upload_time": "2019-08-08T20:47:28", "url": "https://files.pythonhosted.org/packages/7e/83/b29e4da23ece8bc53da27eede9b24fff1127355230c1d044171910fe3ae8/yggdrasil_py-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b315f83fc117581055128d25453fae41", "sha256": "6b6e86dc452a4bdbe6d3583de0110bac3866b46ee39cd21c5360fd5ab446fd32" }, "downloads": -1, "filename": "yggdrasil-py-1.0.5.tar.gz", "has_sig": false, "md5_digest": "b315f83fc117581055128d25453fae41", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3908, "upload_time": "2019-08-08T20:47:31", "url": "https://files.pythonhosted.org/packages/c8/a9/0356ae0fcb8edfb84f93e3856cd2c2365fc23cdcd3e7a8d43d4f98ed0196/yggdrasil-py-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "37b20b41b4ffa6932ebe90b10123815c", "sha256": "c1399a8f0dbde9e0f5b9f93178b6413f2a02a9ce36676e960d316372b5b66e1d" }, "downloads": -1, "filename": "yggdrasil_py-1.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "37b20b41b4ffa6932ebe90b10123815c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7057, "upload_time": "2019-08-08T21:04:11", "url": "https://files.pythonhosted.org/packages/69/04/ef9fc36359c2aa762a531b1e36a684ba71952d9ebb05b93a237f20f5979b/yggdrasil_py-1.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bc1172c363c7eebffd4df3f57c757d63", "sha256": "ceddfcf43f1dbbc5583d61fb748efc8906493840bd5bc641591e8405ae43a1d3" }, "downloads": -1, "filename": "yggdrasil-py-1.0.6.tar.gz", "has_sig": false, "md5_digest": "bc1172c363c7eebffd4df3f57c757d63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3903, "upload_time": "2019-08-08T21:04:15", "url": "https://files.pythonhosted.org/packages/e5/b0/e1ea9886596ed80b00f6d45147d3a870a38cb16f1189d540ac0fcf1e13dc/yggdrasil-py-1.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "37b20b41b4ffa6932ebe90b10123815c", "sha256": "c1399a8f0dbde9e0f5b9f93178b6413f2a02a9ce36676e960d316372b5b66e1d" }, "downloads": -1, "filename": "yggdrasil_py-1.0.6-py3-none-any.whl", "has_sig": false, "md5_digest": "37b20b41b4ffa6932ebe90b10123815c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7057, "upload_time": "2019-08-08T21:04:11", "url": "https://files.pythonhosted.org/packages/69/04/ef9fc36359c2aa762a531b1e36a684ba71952d9ebb05b93a237f20f5979b/yggdrasil_py-1.0.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bc1172c363c7eebffd4df3f57c757d63", "sha256": "ceddfcf43f1dbbc5583d61fb748efc8906493840bd5bc641591e8405ae43a1d3" }, "downloads": -1, "filename": "yggdrasil-py-1.0.6.tar.gz", "has_sig": false, "md5_digest": "bc1172c363c7eebffd4df3f57c757d63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3903, "upload_time": "2019-08-08T21:04:15", "url": "https://files.pythonhosted.org/packages/e5/b0/e1ea9886596ed80b00f6d45147d3a870a38cb16f1189d540ac0fcf1e13dc/yggdrasil-py-1.0.6.tar.gz" } ] }