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 2 pieces of information:

  • Username
  • Password

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"
}
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.1.0.tar.gz (4.6 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.1.0-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viggoscrape-1.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for viggoscrape-1.1.0.tar.gz
Algorithm Hash digest
SHA256 e572b103be4821f20bbcbd84d7334772d061592aca12f0ab1518fa1753d9aab1
MD5 db441e7b1d5fe66b2d0467d1f4a2ef05
BLAKE2b-256 2b2371c150b83cd59d962dc477d9ebf1f20779cd03e20658d3e35741cde1327f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viggoscrape-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for viggoscrape-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c338b6f1210f3ea2a46479dc0d191e1950f060e89c2f6acd9c7662a4bde50bb
MD5 c2382a5ae0759635deac40e212a4ea54
BLAKE2b-256 4e627102316945103e70bb1a7341f732316dc5aaaf87b865f3572f0214768320

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