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.3.tar.gz (4.7 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.3-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: viggoscrape-1.1.3.tar.gz
  • Upload date:
  • Size: 4.7 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.3.tar.gz
Algorithm Hash digest
SHA256 d87b5a5730cd8d030559fd0b0a577dfb81a54630dcb82f2e5031aaecf2e60688
MD5 ebebead584907ea977c520e7f0441aca
BLAKE2b-256 1a467c607cecff2c28446f7860c336346a860d0c0f0d5fd195fe66edcb60363f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: viggoscrape-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 af5760ed95a7d9749d6e3afe81c35a3baa52130bcbb230431e250de0c8c8839b
MD5 3f348b25a8ebaadd6536f17a56963753
BLAKE2b-256 0cf2b1235bd6696520c95a219fd83ef2b75aee16089643ae3def7d941d47ce2d

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