Skip to content

LiteApplication/cdpdocs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CDPDocs

Document downloader for cahier-de-prepa.fr

Usage

from cdpdocs.auth import Auth, set_class_name
from cdpdocs.doctree import SubjectTree

# Authenticate using username and password
set_class_name("myclass")
auth = Auth()
auth.authenticate("username", "password")

# Authenticate using a json file
auth = Auth(from_file="credentials.json")
# credentials.json : 
# { "username": "myusername", "password": "password1234" }

# Get a subject tree
maths = SubjectTree("maths")

# Explore the tree
maths.explore()

# List all documents
def list_docs_recursive(doctree):
    for doc in doctree.documents:
        print(doc)
    for child in doctree.children:
        list_docs_recursive(child)

list_docs_recursive(maths)

# Download a document
maths.children[0].documents[0].download() # Assuming the first child of maths has at least one document 

About

A python frontend to download documents from cahier-de-prepa.fr

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages