Python library for scraping viggo assignments
Project description
Viggoscrape.py
Python library for scraping Viggo assignments by interacting with the Viggoscrape API.
The API is designed for danish users, and time will be adjusted to the CET timezone.
Quickstart
Information syntax
To use Viggoscrape.py, you need to provide it with login info in the form of a dictionary.
The login info uses 3 pieces of information:
- Subdomain
- Username
- Password
For your subdomain, specify only the subdomain, like this:
subdomain-example
And not like this:
subdomain-example.viggo.dk
Usage example
Let's try this out! We'll import the library, give it the required info and print the result, catching any error that may happen.
from viggoscrape import get_assignments
try:
data = get_assignments(
{
"subdomain": "example-subdomain",
"username": "johndoe@gmail.com",
"password": "Password1234"
}
)
print(data)
except Exception as e:
print(e)
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/HomeworkAndAssignment/Details/1234/#modal", "https://example-subdomain.viggo.dk/Basic/HomeworkAndAssignment/Details/1235/#modal"]
}
Or if something went wrong and the provided subdomain is invalid:
"Invalid subdomain"
Or if the password or username is misspelt:
"Invalid credentials"
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file viggoscrape-1.2.1.tar.gz.
File metadata
- Download URL: viggoscrape-1.2.1.tar.gz
- Upload date:
- Size: 3.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
387af458e49d138a34593d05374d3d45ccc8b686411d108cd9510cdf267e3fe0
|
|
| MD5 |
db200e1b8a2f71342664a6a312ca7fe4
|
|
| BLAKE2b-256 |
e6c9b4b170af520c6702265a3bea6aeb1bfc79e55d546f667fe7872fd01dd596
|
File details
Details for the file viggoscrape-1.2.1-py3-none-any.whl.
File metadata
- Download URL: viggoscrape-1.2.1-py3-none-any.whl
- Upload date:
- Size: 3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c6b1685488d54f496f8e6fc36cf85698a6bd78377727847f324f48791ed3bc5
|
|
| MD5 |
c5de341b87be4df16594affa32b8ff07
|
|
| BLAKE2b-256 |
3fa36ad89e6b56e00d628a4329daa27dd9d80370fe7833ab0e28b20598dc2923
|