Skip to main content

Python library for scraping viggo assignments

Project description

Viggoscrape

Python library for scraping Viggo assignments.

This library is designed for danish users, and time will be adjusted to the CET timezone.

Quickstart

Information syntax

To use Viggoscrape, you need to provide it with login info and a subdomain.

Subdomain

For your subdomain, specify only the subdomain, like this:

subdomain-example

And not like this:

subdomain-example.viggo.dk

Login info

The login info uses 3 pieces of information:

  • Username
  • Password
  • Fingerprint

The first two items are obvious. But to find your fingerprint, you'll need to look through the html of your login page's source code, and look for a ViggoLog=x value.

Usage example

Let's try this out! We'll import the library, give it the required info and print the resulting dictionary.

from viggoscrape import get_assignments
subdomain = "subdomain-example"
login_info = {
    "USERNAME": "example@example.com",
    "PASSWORD": "Password1234",
    "FINGERPRINT": "ViggoLog=f8f567-19t7-5hg7-d68n-and85mba2"
}
assignment_data = get_assignments(subdomain, login_info)
print(assignment_data)

Our output would look something like this:

{
    "subject": ["English", "Math"],
    "time": ["31. aug 12:00", "2. sep 08:55"],
    "description": ["Read pages 30 and 31", "Finish A, B and C"],
    "author": ["28. aug 11:25 by John Doe", "31. aug 15:30 by Peter Anker"],
    "files": ["None", "example.com/algebra.pdf"],
    "file_names": ["None", "Intro to algebra"],
    "url": ["https://example-subdomain.viggo.dk/Basic/HomewordAndAssignment/Details/1234/#modal", "https://example-subdomain.viggo.dk/Basic/HomewordAndAssignment/Details/1235/#modal"]
}

Now, you can do anything you want with this newfound data, like save it to a json file, create an embed for your discord bot, or any other purpose. Just use the same index on all lists and the data should match.

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

viggoscrape-1.0.5.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

viggoscrape-1.0.5-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file viggoscrape-1.0.5.tar.gz.

File metadata

  • Download URL: viggoscrape-1.0.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.3

File hashes

Hashes for viggoscrape-1.0.5.tar.gz
Algorithm Hash digest
SHA256 3fc3108d003c4a5a73c67ab013236bc6127c1a4d5249c1ff59636bee6238eddf
MD5 122c3e45eae2137e383317c6a50aebe2
BLAKE2b-256 9da9eed51310b59aeb0b2bf10c4e44239e6387e36b5cedb2f927296eae24907b

See more details on using hashes here.

File details

Details for the file viggoscrape-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: viggoscrape-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.3

File hashes

Hashes for viggoscrape-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eda61c309e095a9e6890f51ba2ad55b14ea2286e38d25f06c34c6fd204ecbe63
MD5 f925d68e11b463344b0d0b10642488b4
BLAKE2b-256 e902e4b2f4c5b533d666059675c1732f747d0ca91272cb651728a7d980c79541

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page