Welcome to vyoma-download’s documentation!¶
Download course contents from sanskritfromhome.org
- Free software: MIT license
- Documentation: https://vyoma-download.readthedocs.io.
Features¶
- Download video, audio and documents for courses from sanskritfromhome.org
- Resume download whenever possible
- Keep a list of files that fail to download
vyoma-download¶
Download course contents from sanskritfromhome.org
- Free software: MIT license
- Documentation: https://vyoma-download.readthedocs.io.
Features¶
- Download video, audio and documents for courses from sanskritfromhome.org
- Resume download whenever possible
- Keep a list of files that fail to download
Usage¶
Use in a Project¶
To use vyoma-download in a project:
from vyoma_download.vyoma import Vyoma
vyoma = Vyoma(username, password)
courses = vyoma.find_course("LSK")
course_id = courses[0]["course_id"]
vyoma.download_course(course_id)
Use Console Interface¶
usage: vyoma-dl [-h] [-a] [-d] [-o OUTPUT]
[-u USERNAME] [-p PASSWORD]
[--status] [--verbose]
[--debug] [--version] course-pattern
Download course contents from 'sanskritfromhome.in'.
positional arguments:
course-pattern URL of the relevant course
optional arguments:
-h, --help show this help message and exit
-a, --audio Download audios only
-d, --document Download documents only
-o OUTPUT, --output OUTPUT
Path to the download directory
-u USERNAME, --username USERNAME
-p PASSWORD, --password PASSWORD
--status Display status of the current course
--verbose Enable verbose output
--debug Enable debug information
--version show program's version number and exit
Note:
You must be registered on https://sanskritfromhome.org/.
You must be subscribed to the course that you wish to download.
Installation¶
Stable release¶
To install vyoma-download, run this command in your terminal:
$ pip install vyoma_download
This is the preferred method to install vyoma-download, as it will always install the most recent stable release.
If you don’t have pip installed, this Python installation guide can guide you through the process.
From sources¶
The sources for vyoma-download can be downloaded from the Github repo.
You can either clone the public repository:
$ git clone git://github.com/hrishikeshrt/vyoma_download
Or download the tarball:
$ curl -OJL https://github.com/hrishikeshrt/vyoma_download/tarball/master
Once you have a copy of the source, you can install it with:
$ python setup.py install
Usage¶
Use in a Project¶
To use vyoma-download in a project:
from vyoma_download.vyoma import Vyoma
vyoma = Vyoma(username, password)
courses = vyoma.find_course("LSK")
course_id = courses[0]["course_id"]
vyoma.download_course(course_id)
Use Console Interface¶
usage: vyoma-dl [-h] [-a] [-d] [-o OUTPUT]
[-u USERNAME] [-p PASSWORD]
[--status] [--verbose]
[--debug] [--version] course-pattern
Download course contents from 'sanskritfromhome.in'.
positional arguments:
course-pattern URL of the relevant course
optional arguments:
-h, --help show this help message and exit
-a, --audio Download audios only
-d, --document Download documents only
-o OUTPUT, --output OUTPUT
Path to the download directory
-u USERNAME, --username USERNAME
-p PASSWORD, --password PASSWORD
--status Display status of the current course
--verbose Enable verbose output
--debug Enable debug information
--version show program's version number and exit
Note:
You must be registered on https://sanskritfromhome.org/.
You must be subscribed to the course that you wish to download.
vyoma_download¶
vyoma_download package¶
Submodules¶
vyoma_download.edmingle module¶
Edmingle API
@author: Hrishikesh Terdalkar
-
class
vyoma_download.edmingle.
EdmingleAPI
(username: str, password: str, hostname: str, api_host: str, endpoint: str = '/nuSource/api/v1', protocol: str = 'https:')[source]¶ Bases:
object
-
api
(path: str, data: Dict[KT, VT] = None, is_json: bool = True, method: str = 'GET') → Dict[KT, VT][source]¶ General API Query
- path : str
- API Path
- data : Dict, optional
- Dictionary containing GET or POST data In case of “GET”, the data is used to form the GET options string. In case of “POST”, the data is passed with the POST request. The default is None
- is_json : bool, optional
- Is the response a JSON object? The default is True
- method : str, optional
- HTTP Method (“GET” or “POST”). The default is “GET”
- Dict or str
- Dict, if is_json is True str, otherwise
-
user_agent
¶
-
vyoma_download.utils module¶
Utility Scripts @author: Hrishikesh Terdalkar
vyoma_download.verbose_logger module¶
Created on Mon Jun 07 15:56:56 2021
@author: Hrishikesh Terdalkar
-
vyoma_download.verbose_logger.
NOTICE
= 25¶ The numeric value of the ‘notice’ log level (a number). The value of
NOTICE
positions the notice log level between theWARNING
andINFO
levels. :see also: Thenotice()
method of theVerboseLogger
class.
-
vyoma_download.verbose_logger.
VERBOSE
= 15¶ The numeric value of the ‘verbose’ log level (a number). The value of
VERBOSE
positions the verbose log level between theINFO
andDEBUG
levels. :see also: Theverbose()
method of theVerboseLogger
class.
-
class
vyoma_download.verbose_logger.
VerboseLogger
(*args, **kw)[source]¶ Bases:
logging.Logger
Custom logger class to support the additional logging levels. This subclass of
logging.Logger
adds support for the additional logging methodsnotice()
,spam()
,success()
andverbose()
. You can useverbose_logger.install()
to makeVerboseLogger
the default logger class.
-
vyoma_download.verbose_logger.
add_log_level
(value, name)[source]¶ Add a new log level to the
logging
module. :param value: The log level’s number (an integer). :param name: The name for the log level (a string).
-
vyoma_download.verbose_logger.
install
()[source]¶ Make
VerboseLogger
the default logger class. Theinstall()
function usessetLoggerClass()
to configureVerboseLogger
as the default class for all loggers created bylogging.getLogger()
afterinstall()
has been called. Here’s how it works: .. code-block:: pythonimport logging import verbose_logger verbose_logger.install() logger = logging.getLogger(__name__) # will be a VerboseLogger instance
vyoma_download.vyoma module¶
Vyoma Session
@author: Hrishikesh Terdalkar
-
class
vyoma_download.vyoma.
Vyoma
(username: str, password: str, download_dir: str = None)[source]¶ Bases:
vyoma_download.edmingle.EdmingleAPI
-
download_course
(course_id: str, fetch_audio: bool = False, fetch_document: bool = True) → Dict[KT, VT][source]¶ Download Course Content
- course_id : str
- Course ID from Vyoma Edmingle Platform
- fetch_audio : bool, optional
- If true, the audios are downloaded. The default is True.
- fetch_document : bool, optional
- If true, the adocuments are downloaded. The default is True.
- Dict
- Complete download log
-
vyoma_download.vyoma module¶
Vyoma Session
@author: Hrishikesh Terdalkar
-
class
vyoma_download.vyoma.
Vyoma
(username: str, password: str, download_dir: str = None)[source] Bases:
vyoma_download.edmingle.EdmingleAPI
-
download_course
(course_id: str, fetch_audio: bool = False, fetch_document: bool = True) → Dict[KT, VT][source] Download Course Content
- course_id : str
- Course ID from Vyoma Edmingle Platform
- fetch_audio : bool, optional
- If true, the audios are downloaded. The default is True.
- fetch_document : bool, optional
- If true, the adocuments are downloaded. The default is True.
- Dict
- Complete download log
-
download_section
(class_id: str, section_id: str) → Dict[KT, VT][source]
-
find_course
(search_pattern: str) → str[source]
-
show_course_status
(course_id: str)[source]
-
Module contents¶
Top-level package for vyoma-download.
Contributing¶
Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Types of Contributions¶
Report Bugs¶
Report bugs at https://github.com/hrishikeshrt/vyoma_download/issues.
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
Fix Bugs¶
Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it.
Implement Features¶
Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it.
Write Documentation¶
vyoma-download could always use more documentation, whether as part of the official vyoma-download docs, in docstrings, or even on the web in blog posts, articles, and such.
Submit Feedback¶
The best way to send feedback is to file an issue at https://github.com/hrishikeshrt/vyoma_download/issues.
If you are proposing a feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
Get Started!¶
Ready to contribute? Here’s how to set up vyoma_download for local development.
Fork the vyoma_download repo on GitHub.
Clone your fork locally:
$ git clone git@github.com:your_name_here/vyoma_download.git
Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:
$ mkvirtualenv vyoma_download $ cd vyoma_download/ $ python setup.py develop
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
When you’re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox:
$ flake8 vyoma_download tests $ python setup.py test or pytest $ tox
To get flake8 and tox, just pip install them into your virtualenv.
Commit your changes and push your branch to GitHub:
$ git add . $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature
Submit a pull request through the GitHub website.
Pull Request Guidelines¶
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests.
- If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst.
- The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check https://travis-ci.com/hrishikeshrt/vyoma_download/pull_requests and make sure that the tests pass for all supported Python versions.
Deploying¶
A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in HISTORY.rst). Then run:
$ bump2version patch # possible: major / minor / patch
$ git push
$ git push --tags
Travis will then deploy to PyPI if tests pass.
Credits¶
Development Lead¶
- Hrishikesh Terdalkar <hrishikeshrt@linuxmail.org>
Contributors¶
None yet. Why not be the first?