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
Metadata
Release files for udemy-python 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| udemy-python-0.0.3.tar.gz | 6.9 kB | Without provenance | Details for udemy-python-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| udemy_python-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for udemy_python-0.0.3-py3-none-any.whl |
Total release size: 13.8 kB
Release files / udemy-python-0.0.3.tar.gz
| Download URL | udemy-python-0.0.3.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f47026dfe5f3d3be796a96d314659ebcf25b21f33c4749c99ad01279da3f7595
|
|
BLAKE2b-256 checksum How to use checksums |
7e65249092428aa5b7bf77c938218a368f9a7ae467847b0b7b589f65d5792567
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / udemy_python-0.0.3-py3-none-any.whl
| Download URL | udemy_python-0.0.3-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
062e02bed096b5f58c50dbdff36533e80ad4b667f0ebac0020efa6a4df4af4c5
|
|
BLAKE2b-256 checksum How to use checksums |
d9664d3dd432e58e7cbabe4fa369a3023da2d574b1e3ef0f47857d25d55430ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for udemy-python 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.