API Documentation

The “getdep” Module

getdep.getdep.get_apt_dependencies(package)

Get list of dependencies from apt command.

You need to have apt and apt-rdepends installed on your system.

Parameters:package (str) – The package name for the apt package you want to install
Returns:list. A list of all dependencies found.

Exemple:

>>> from getdep import getdep
>>> getdep.get_apt_dependencies("nano")
['libc6', 'libncursesw6', 'libtinfo6', 'libcrypt1', 'libgcc-s1', 'gcc-10-base']
getdep.getdep.get_brew_dependencies(package)

Get list of dependencies from homebrew package.

Parameters:package (str) – The package name for the brew formulae you want to install.
Returns:list. A list of all dependencies found.

Exemple:

>>> from getdep import getdep
>>> getdep.get_brew_dependencies("vim")
['gettext', 'lua', 'perl', 'python', 'ruby']
getdep.getdep.get_chocolatey_dependencies(package)

Get list of dependencies for nuget and chocolatey

Parameters:package (str) – The package name for the nuget or chocolatey package you want to install.
Returns:list. A list of all dependencies found.

Exemple:

>>> from getdep import getdep
>>> getdep.get_chocolatey_dependencies("castle.core")
>>> getdep.get_chocolatey_dependencies("castle.core")
['.NETStandard1.3', '.NETFramework4.5', '.NETFramework3.5', '.NETFramework4.0', '.NETStandard1.5']

TODO: separate nuget and chocolatey implementation

getdep.getdep.get_composer_dependencies(package)

Get list of dependencies from composer package.

Parameters:package (str) – The package name for the composer package you want to install. Package need to be in composer format : <vendor>/<product>. Ex : laravel/install.
Returns:list. A list of all dependencies found.

Exemples:

>>> from getdep import getdep
>>> getdep.get_composer_dependencies("twig/twig")
['php', 'symfony/polyfill-mbstring', 'symfony/polyfill-ctype']
getdep.getdep.get_gem_dependencies(package)

Get list of dependencies for gem package.

Parameters:package (str) – The package name for the gem package you want to install.
Returns:list. A list of all dependencies found.

Exemple:

>>> from getdep import getdep
>>> getdep.get_gem_dependencies("rail")
['actioncable', 'actionmailbox', 'actionmailer', 'actionpack', 'actiontext', 'actionview', 'activejob', 'activemodel', 'activerecord', 'activestorage',
'activesupport', 'bundler', 'railties', 'sprockets-rails']
getdep.getdep.get_npm_dependencies(package)

Get list of dependencies for npm and yarn package.

Parameters:package (str) – The package name for the npm/yarn package you want to install.
Returns:list. A list of all dependencies found.

Exemple:

>>> from getdep import getdep
>>> getdep.get_npm_dependencies("express")
['accepts', 'array-flatten', 'body-parser', 'content-disposition', 'content-type', 'cookie', 'cookie-signature',
 'debug', 'depd', 'encodeurl', 'escape-html', 'etag', 'finalhandler', 'fresh', 'merge-descriptors', 'methods',
 'on-finished', 'parseurl', 'path-to-regexp', 'proxy-addr', 'qs', 'range-parser', 'safe-buffer', 'send', 'serve-static',
 'setprototypeof', 'statuses', 'type-is', 'utils-merge', 'vary']
getdep.getdep.get_pip_dependencies(package)

Get list of dependencies from pip package.

Parameters:package (str) – The package name for the pip package you want to install.
Returns:list. A list of all dependencies found.

Exemple:

>>> from getdep import getdep
>>> getdep.get_pip_dependencies("tensorflow")
['absl-py', 'astunparse', 'gast', 'google-pasta', 'h5py', 'keras-preprocessing', 'numpy', 'opt-einsum', 'protobuf', 'tensorboard',
'tensorflow-estimator', 'termcolor', 'wrapt', 'six', 'grpcio', 'wheel', 'mock', 'functools32', 'scipy', 'backports.weakref', 'enum34']
getdep.getdep.get_yum_dependencies(package)

Get list of dependencies from yum command

Also apply for RPM-based Linux distribution like Fedora, SuSE, CentOS

Parameters:package (str) – The package name for the apt package you want to install
Returns:list. A list of all dependencies found.

Exemple:

>>> from getdep import getdep
>>> getdep.get_yum_dependencies("rust")
['gcc-8.3.1-5.el8.0.2.x86_64', 'glibc-2.28-101.el8.i686', 'llvm-libs-9.0.1-4.module_el8.2.0+309+0c7b6b03.x86_64', 'rust-std-static(x86-64)',
'glibc-2.28-101.el8.x86_64', 'libgcc-8.3.1-5.el8.0.2.x86_64', 'libstdc++-8.3.1-5.el8.0.2.x86_64']

The “utility” Module

getdep.utility.get_dependencies(pms_name, package)

Get dependencies for a given package management system (PMS) and a given package.

Args :

pms_name (str): name of the pms sytem you want to use. See get_supported_pms() for supported pms.

package (str): name of the package.

Returns:The return value from subprocess.run, representing a process that has finished. Look at the documentation here We just need subprocess.stdout for getdep module functions.
Return type:subprocess.CompletedProcess or content of the request.get in unicode
TODO :
Separate into two functions to have a uniform return type.
getdep.utility.get_supported_pms()

List of supported and implemented pms.

More to come in the future (rpm, pkg, c/c++, cargo …)

getdep.utility.print_supported_pms()

Print supported pms