A python wrapper for the Udemy Instructor API
Project description
UDEMY-PYTHON
A better python wrapper for the Udemy Instructor API
Install
Install
$ pip install udemy-python
Use
>>> from udemy import Api
Authenticate
In order to use this module, you must supply an instructor API token. This can be created by logging into Udemy and creating an instructor API client. Once you have generated the token, the API can be set up with:
>>> udemy_api = Api(<TOKEN>)
Use
Here's a few examples of ways you can use this wrapper.
Courses
Here's a simple script to get all the unanswered questions from each course.
for course in udemy_api.get_all_courses():
print("Getting questions for", course.title)
for question in course.get_questions(status="unanswered"):
print("Unanswered question from", question.user.title)
print(question.title)
print(question.content)
Reviews
Or to get all your bad reviews.
for review in udemy_api.get_all_reviews(stars=[1, 2, 3], page_size=100):
print("\nBad review from", review.user.name, ":(")
print(review.stars, "stars")
print(review.content)
Everything Else
These are just a couple examples of what you can accomplish with this wrapper. Anything you can see on the API is possible, and I will try my best to update this if any changes are made. If you have any issues or errors, please log a issue on the GitHub repo. Want to add a feature? Submit a pull request!
Philosophy
The design philosophy behind this API wrapper was to abstract away as much of the annoying raw json processing as possible. Unlike every other Udemy API wrappers, each model is represented as an object with easily accessible attributes holding the data you want. This wrapper also handles pagination for you, wrapping it up in a generator you can easily iterate through. However, another one of my goals was to not remove any functionality of the original API. Every option shown in the docs is still available, including setting manual pages, page sizes, ordering, and filtering. Most of the names in the API are unchanged, however a few were changed to more sensible alternatives, such as the Answer 'body' to 'content' in order to stay consistent with the other models.
TODO
- Make additional helper functions
- Add bad argument errors
- Write docs
- Add C O M M E N T S
- Add Affiliate API
- Add private API?
- Figure out the meaning of Life
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
File details
Details for the file udemy-python-0.0.3.tar.gz
.
File metadata
- Download URL: udemy-python-0.0.3.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f47026dfe5f3d3be796a96d314659ebcf25b21f33c4749c99ad01279da3f7595 |
|
MD5 | 23e1ded9c0979bdc40de687f1c9dd8a3 |
|
BLAKE2b-256 | 7e65249092428aa5b7bf77c938218a368f9a7ae467847b0b7b589f65d5792567 |
File details
Details for the file udemy_python-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: udemy_python-0.0.3-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 062e02bed096b5f58c50dbdff36533e80ad4b667f0ebac0020efa6a4df4af4c5 |
|
MD5 | bc8f4c0f9b056dd7065ec076af0d0eb9 |
|
BLAKE2b-256 | d9664d3dd432e58e7cbabe4fa369a3023da2d574b1e3ef0f47857d25d55430ea |