jaccount-auth


Namejaccount-auth JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/linsyking/jaccount-auth
SummaryA small plugin to help use jaccount login in python programs.
upload_time2023-08-31 17:00:46
maintainerlinsyking
docs_urlNone
authorlinsyking
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python Jaccount Auth 

A small plugin to help use jaccount login in python programs.

Forked from tc-imba's [python-jaccount-cli](https://github.com/tc-imba/python-jaccount-cli).

## Example

```python
import asyncio
from getpass import getpass

from jaccount_cli import JaccountCLIAsyncIO


async def main():
    async with JaccountCLIAsyncIO("https://umjicanvas.com/login/openid_connect") as cli:
        await cli.init()

        captcha_ascii = cli.captcha_generate_ascii()
        print()
        print(captcha_ascii)
        print()
        # or you can use
        # cli.captcha_show_external()

        captcha = input("Please enter the shown captcha: ")
        username = input("Please enter jaccount username: ")
        password = getpass("Please enter password: ")

        await cli.login(username, password, captcha)

        async with cli.session.get(
            "https://umjicanvas.com/api/v1/users/self/favorites/courses?include[]=term&exclude[]=enrollments",
            headers={"Accept": "application/json"},
        ) as response:
            print(await response.text())

        # print cookies
        cookies = cli.get_cookies()
        for key, cookie in cookies.items():
            print('Key: "%s", Value: "%s"' % (cookie.key, cookie.value))


if __name__ == "__main__":
    asyncio.get_event_loop().run_until_complete(main())
```

## License

MIT

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/linsyking/jaccount-auth",
    "name": "jaccount-auth",
    "maintainer": "linsyking",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "xiangyiming2002@gmail.com",
    "keywords": "",
    "author": "linsyking",
    "author_email": "xiangyiming2002@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/bc/35/a8d75b13224fa9aaf0523a8afd53035b562f5293b74a726f9f7bacfe24cd/jaccount-auth-0.0.1.tar.gz",
    "platform": null,
    "description": "# Python Jaccount Auth \n\nA small plugin to help use jaccount login in python programs.\n\nForked from tc-imba's [python-jaccount-cli](https://github.com/tc-imba/python-jaccount-cli).\n\n## Example\n\n```python\nimport asyncio\nfrom getpass import getpass\n\nfrom jaccount_cli import JaccountCLIAsyncIO\n\n\nasync def main():\n    async with JaccountCLIAsyncIO(\"https://umjicanvas.com/login/openid_connect\") as cli:\n        await cli.init()\n\n        captcha_ascii = cli.captcha_generate_ascii()\n        print()\n        print(captcha_ascii)\n        print()\n        # or you can use\n        # cli.captcha_show_external()\n\n        captcha = input(\"Please enter the shown captcha: \")\n        username = input(\"Please enter jaccount username: \")\n        password = getpass(\"Please enter password: \")\n\n        await cli.login(username, password, captcha)\n\n        async with cli.session.get(\n            \"https://umjicanvas.com/api/v1/users/self/favorites/courses?include[]=term&exclude[]=enrollments\",\n            headers={\"Accept\": \"application/json\"},\n        ) as response:\n            print(await response.text())\n\n        # print cookies\n        cookies = cli.get_cookies()\n        for key, cookie in cookies.items():\n            print('Key: \"%s\", Value: \"%s\"' % (cookie.key, cookie.value))\n\n\nif __name__ == \"__main__\":\n    asyncio.get_event_loop().run_until_complete(main())\n```\n\n## License\n\nMIT\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A small plugin to help use jaccount login in python programs.",
    "version": "0.0.1",
    "project_urls": {
        "Bug Reports": "https://github.com/linsyking/jaccount-auth/issues",
        "Homepage": "https://github.com/linsyking/jaccount-auth",
        "Source": "https://github.com/linsyking/jaccount-auth"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "956d7ecc127fcfe12e1dd83d35671310637edaba833ea5b4b2cf9b613612d0fc",
                "md5": "09a9e30b9d455b548a5b1ec3ad74feb9",
                "sha256": "0d503fd72261614878ddbc7169c750ff6fab519b303e0e4fcbd395517b212699"
            },
            "downloads": -1,
            "filename": "jaccount_auth-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "09a9e30b9d455b548a5b1ec3ad74feb9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6144,
            "upload_time": "2023-08-31T17:00:45",
            "upload_time_iso_8601": "2023-08-31T17:00:45.069980Z",
            "url": "https://files.pythonhosted.org/packages/95/6d/7ecc127fcfe12e1dd83d35671310637edaba833ea5b4b2cf9b613612d0fc/jaccount_auth-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bc35a8d75b13224fa9aaf0523a8afd53035b562f5293b74a726f9f7bacfe24cd",
                "md5": "48119871740d5c9b982e194bf8ede2a8",
                "sha256": "49e2a22555dfb9e8a9631ea3ebae585fd6989a8f4fc0935cf749843752e204a2"
            },
            "downloads": -1,
            "filename": "jaccount-auth-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "48119871740d5c9b982e194bf8ede2a8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4948,
            "upload_time": "2023-08-31T17:00:46",
            "upload_time_iso_8601": "2023-08-31T17:00:46.872362Z",
            "url": "https://files.pythonhosted.org/packages/bc/35/a8d75b13224fa9aaf0523a8afd53035b562f5293b74a726f9f7bacfe24cd/jaccount-auth-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-31 17:00:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "linsyking",
    "github_project": "jaccount-auth",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "jaccount-auth"
}
        
Elapsed time: 0.84613s