Skip to main content

A python wrapper for a LearnDash API

Project description

LearnDash Python Library

The LearnDash Python Library provides a simple wrapper for a LearnDash API.

Documentation

See the LearnDash API V2 Docs.

Usage

import learndash
learndash.api_host = https://my-learndash-website.com

# Auth is provided via wordpress user credentials when needed
import os
learndash.wordpress_un = os.environ.get('WORDPRESS_UN')
learndash.wordpress_pw = os.environ.get('WORDPRESS_PW')

# list Courses
courses_resp = learndash.Course.list()

print(courses_resp.json())

# retrieve specific Course
course_resp = learndash.Course.retrieve(12)

print(course_resp.json())

Configuring API Paths

The LearnDash Wordpress plugin allows admins to configure the paths for each API resource. By default, this library will use the LearnDash plugin's default paths, but you can reconfigure those paths:

import learndash
learndash.path_courses = 'courses'  # Leave out slashes

Dependencies

Requires the requests library.

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

learndash-0.0.2.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

learndash-0.0.2-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

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