A small plugin to help use jaccount login in cli programs.
Project description
Python Jaccount CLI
A small plugin to help use jaccount login in cli programs.
Example
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jaccount-cli-0.0.4.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for jaccount_cli-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b45a63de037dcbfddb0effa602cc3979434dfd53ad95815975c827adee9b0fb9 |
|
MD5 | c84e5dc983a30be6f4aef44a00d05cff |
|
BLAKE2b-256 | e953f09bdad15d4d1d1398d6fc673da22828247474a5cc7266433409c42f6564 |