Welcome to vyoma-download’s documentation!

https://img.shields.io/pypi/v/vyoma_download?color=success Documentation Status Python Version Support GitHub Issues GitHub Followers Twitter Followers

Download course contents from sanskritfromhome.org

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

https://img.shields.io/pypi/v/vyoma_download?color=success Documentation Status Python Version Support GitHub Issues GitHub Followers Twitter Followers

Download course contents from sanskritfromhome.org

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.cli module

Console script for vyoma_download.

vyoma_download.cli.main()[source]

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
download_material(url: str, path: str) → str[source]
get_certificates() → Dict[KT, VT][source]
get_class_resources(class_id: str) → Dict[KT, VT][source]
get_classes_period(date) → Dict[KT, VT][source]
get_course_classes(course_id: str) → Dict[KT, VT][source]
get_courses(search_pattern: str = '', tag_ids: str = '9') → Dict[KT, VT][source]
get_material(class_id: str, material_id: str) → Dict[KT, VT][source]
get_meta_all() → Dict[KT, VT][source]
get_section_resources(class_id: str, section_id: str) → Dict[KT, VT][source]
get_user_basicinfo() → Dict[KT, VT][source]
get_usermeta() → Dict[KT, VT][source]
login() → bool[source]

Login to Edmingle Platform

bool
Indicates whether the login was successful
user_agent

vyoma_download.utils module

Utility Scripts @author: Hrishikesh Terdalkar

vyoma_download.utils.pretty_name(coursename: str) → str[source]

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 the WARNING and INFO levels. :see also: The notice() method of the

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 the INFO and DEBUG levels. :see also: The verbose() method of the

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 methods notice(), spam(), success() and verbose(). You can use verbose_logger.install() to make VerboseLogger the default logger class.

notice(msg, *args, **kw)[source]

Log a message with level NOTICE. The arguments are interpreted as for logging.debug().

verbose(msg, *args, **kw)[source]

Log a message with level VERBOSE. The arguments are interpreted as for logging.debug().

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. The install() function uses setLoggerClass() to configure VerboseLogger as the default class for all loggers created by logging.getLogger() after install() has been called. Here’s how it works: .. code-block:: python

import 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
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]

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.

  1. Fork the vyoma_download repo on GitHub.

  2. Clone your fork locally:

    $ git clone git@github.com:your_name_here/vyoma_download.git
    
  3. 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
    
  4. Create a branch for local development:

    $ git checkout -b name-of-your-bugfix-or-feature
    

    Now you can make your changes locally.

  5. 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.

  6. 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
    
  7. Submit a pull request through the GitHub website.

Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

  1. The pull request should include tests.
  2. 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.
  3. 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.

Tips

To run a subset of tests:

$ python -m unittest tests.test_vyoma_download

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

Contributors

None yet. Why not be the first?

History

1.0.0 (2022-05-11)

  • Major upgrade to support new Edmingle-based system

0.1.0 (2020-09-08)

  • First release on PyPI.

Indices and tables