A python wrapper for a LearnDash API
Project description
LearnDash Python Library
Warning, early alpha. Most functionality is missing. The LearnDash Python Library provides a simple wrapper for a LearnDash API.
Documentation
See the LearnDash API V2 Docs.
Installation
pip install learndash
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.4.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for learndash-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e656c1858b5b60cf6907e492fde2cab753c153073225c70759ce880c94432f11 |
|
MD5 | 638e6087206b26bdf196b4247c7569bc |
|
BLAKE2b-256 | e0e4311161fb85d5bdcca3b10b968cfe3a5ad5169044d7520434a8355aa4cd4c |