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
Metadata
Release files for jaccount-cli 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jaccount-cli-0.0.5.tar.gz | 5.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jaccount_cli-0.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.1 kB
Release files / jaccount-cli-0.0.5.tar.gz
| Download URL | jaccount-cli-0.0.5.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4aa44dbff5a72d26eb3539408e872fc492f53101627a499f996eb8c58454025
|
|
BLAKE2b-256 checksum How to use checksums |
1b2de25ff4b65704e38fde1597187d59bffe006b7963df3bba6a885084e84a59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
|
Release files / jaccount_cli-0.0.5-py3-none-any.whl
| Download URL | jaccount_cli-0.0.5-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b499b9d2563a310d2509832b855ca8df1ab0d87160ab74335c941618c8a7e1e9
|
|
BLAKE2b-256 checksum How to use checksums |
6887b0ebdd38b884901b3a3c29b21b552eda4e3a0cee54925054a36274b9b2cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
|