Skip to main content

Token generator for Bakalari API

Jednoduchý Python script pro vygenerování tokenu pro Bakaláři API.

Doporučuji: xmlcurl

Návod

Skript vyžaduje tři argumenty - adresu serveru Bakalářů, uživatelské jméno, heslo.

Pokud použijete argument -k/--keep-url, adresa by měla vypadat zhruba takto:
https://subdomena.skola.cz/bakalari/login.aspx

Tedy včetně protokolu (https://) a /login.aspx, ale bez /next/ (pokud vaše škola používá tuto verzi rozhraní) a bez query stringu (?neco=neco...).

Pokud -k použijete, skript se pokusí adresu upravit. Nejkratší formát, který vygeneruje stejnou adresu jako výše, je subdomena.skola.cz/bakalari.

Vygenerovaný token je platný vždy pouze k danému datu

Python 2

Not supported anymore, if you're really that boomer, checkout commit c555ec1.

Python 3

Z příkazového řádku

použití: bakalari_token.py [-h] [-k] url username [pwd]

poziční argumenty:
  url             URL Bakalářů (např. subdomena.skola.cz/bakalari)
  username        Uživatelské jméno
  pwd             Heslo (volitelné, pokud nezadáno, bude vyžádáno schovaným vstupem)

volitelné argumenty:
  -h, --help      Zobrazí tuto nápovědu a ukončí program
  -k, --keep-url  Nepokoušet se upravit URL. URL by tedy už mělo být něco jako https://subdomena.skola.cz/bakalari/login.aspx
Použití skriptu přímo
git clone https://github.com/bakalari-api/python-token-generator.git
cd python-token-generator
./bakalari_token.py <argumenty>
Instalace
python3 -m pip install bakalari-token
bakalari-token <argumenty>

Použití jako modul

import bakalari_token
if not is_full_url:
    url = bakalari_token.process_url(url)
token = bakalari_token.generate_token(url, "jannovak", "honzovosilnyheslo")

Metadata

Release files for bakalari-token 2.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bakalari-token 2.0.post1
File Size Uploaded Provenance
bakalari-token-2.0.post1.tar.gz 4.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bakalari-token 2.0.post1
File Interpreter ABI Platform
bakalari_token-2.0.post1-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 kB

Release files / bakalari-token-2.0.post1.tar.gz

Download URL bakalari-token-2.0.post1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
16c89dc908a379b1a1b847bc99a2796771c07c1af38b3676ce2970f7efce756b
BLAKE2b-256 checksum
How to use checksums
47ac5cec3386d8b7a017a23ba828c377d631802b948c98e6557df62ea65eb7be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Release files / bakalari_token-2.0.post1-py3-none-any.whl

Download URL bakalari_token-2.0.post1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bdbef41c5cc06ca93ff15aa9ea629b8c45df923c68729418dc67b71bca7a7e4
BLAKE2b-256 checksum
How to use checksums
c835458ace89f18eae9012109ec07c7bb4fc15fc43e0a16a4f6c885a59a194a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.6

Security for bakalari-token 2.0.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page