Nprstuff - Utility Functionality for NPR Programs and Other Things
I like NPR, so I made some scripts to download my favorite programs from NPR. For now, I have something that downloads NPR Fresh Air, Wait Wait…Don’t Tell Me, and This American Life. This package can probably, straightforwardly be extended to other NPR and PRI programs (although I haven’t yet done so).
Although this project started off as a way to download these three programs, I have expanded it to include a grab bag of altogether different types of functionalities. What remains the same? This distribution consists mainly of executable Python scripts. Detailed documentation lives in the Sphinx repository.
NPR changed their API, which means that old functionality does not work. NPR has discontinued the older NPR API, that powers much of this repository’s functionality. I quote,
This API is no longer publicly available for client integrations; for documentation of current API services, please visit the NPR Developer Center.
Furthermore, the newer NPR One API does not appear to have the necessary functionality to make my magic happen. The rest of the functionality lives in the
The comprehensive documentation lives in HTML created with Sphinx, and now in the NPRStuff Github Page for this project. To generate the documentation, go to the docsrc
subdirectory. In that directory, run make html
. Load docsrc/build/html/index.html
into a browser to see the documentation.
Installation Instructions
Installing this Python module is easy.
If you want to get it from Github, then run this command,
python3 -m pip install --user git+https://github.com/tanimislam/nprstuff#egginfo=nprstuff
If you want to have more control, follow these several steps.
git clone https://github.com/tanimislam/nprstuff cd nprstuff python3 -m pip install --user -e .
Both installation workflows install nprstuff
into your user Python folder (~/.local
by default on Linux and Mac OS X systems). Its executables are installed into ~/.local/bin
by default on Linux or Mac OS X systems.
Table of Contents
- 1. Core Functionality
- 2. New Functionality
- 3. Graphics Functionality
- 4. Oldstuff
- 5. Top Level API
- 6. Core APIs
- 6.1. npr_utils module
MyPool
find_necessary_executables()
get_NPR_URL()
get_api_key()
get_chrome_driver()
get_datestring()
get_decdate()
get_firefox_driver()
get_freshair_downloaddir()
get_order_number_saturday_in_year()
get_order_number_weekday_in_year()
get_saturday_times_in_year()
get_time_from_datestring()
get_waitwait_downloaddir()
get_weekday_times_in_year()
is_saturday()
is_sunday()
is_weekday()
saturdays_of_month_of_year()
store_api_key()
store_freshair_downloaddir()
store_waitwait_downloaddir()
weekdays_of_month_of_year()
- 6.2. convert_image_youtube module
- 6.3. music_to_m4a module
- 6.4. freshair and freshair_by_year modules
get_freshair()
get_freshair_date_from_name()
get_freshair_image()
get_freshair_valid_dates_remaining_tuples()
get_title_mp3_urls_attic()
get_title_mp3_urls_working()
get_title_mp3_urls_working_2023()
process_all_freshairs_by_year()
create_plot_year()
find_occupied_days()
find_underoccupied_dates()
get_color()
suncal()
- 6.5. thisamericanlife module
- 6.6. waitwait and waitwait_realmedia modules
- 6.1. npr_utils module
- 7. Email APIs
TODO
Here are some things I would like to finish.
Get the non-NPR-API functionality working as robustly as the old, working, discontinued NPR API stuff. ☑