pybraries

class pybraries.search.Search[source]

Class for wrapping the libraries.io API for platform, project, repo, and user GET actions

platforms() → Any[source]

Return a list of supported package managers.

Returns

List of dicts of platforms with platform info from libraries.io.

project(platforms: str, name: str) → Any[source]

Return information about a project and its versions from a platform (e.g. PyPI).

Parameters
  • platforms – package manager (e.g. “pypi”).

  • name – project name.

Returns

List of dictionaries with information about the project from libraries.io.

project_dependencies(platforms: str, project: str, version: str = None) → Any[source]

Get dependencies for a version of a project.

Returns latest version info.

Parameters
  • platforms – package manager (e.g. “pypi”).

  • project – project name.

  • version – (optional) project version

Returns

Dict of dependencies for a version of a project from libraries.io.

project_dependents(platforms: str, project: str, version: str = None) → Any[source]

Get projects that have at least one version that depends on a given project.

Parameters
  • platforms – package manager (e.g. “pypi”).

  • project – project name

  • version – project version

Returns

List of dicts project dependents from libraries.io.

project_dependent_repositories(platforms: str, project: str) → Any[source]

Get repositories that depend on a given project.

Parameters
  • platforms – package manager (e.g. “pypi”)

  • project – project name

Returns

List of dicts of dependent repositories from libraries.io.

project_contributors(platforms: str, project: str) → Any[source]

Get users that have contributed to a given project.

Parameters
  • platforms – package manager

  • project – project name

Returns

List of dicts of project contributor info from libraries.io.

project_sourcerank(platforms: str, project: str) → Any[source]

Get breakdown of SourceRank score for a given project.

Parameters
  • platforms – package manager

  • project – project name

Returns

Dict of sourcerank info response from libraries.io.

project_usage(platforms: str, project: str) → Any[source]

Get breakdown of usage for a given project.

Parameters
  • platforms – package manager

  • project – project name

Returns

Dict with info about usage from libraries.io.

Search for projects. Args - keywords only:

keywords (str): required argument: keywords to search languages (str): optional programming languages to filter licenses (str): license type to filter platforms (str):, platforms to filter

sort str: (optional) one of rank, stars,

dependents_count, dependent_repos_count, latest_release_published_at, contributions_count, created_at

Returns

List of dicts of project info from libraries.io.

repository(host: str, owner: str, repo: str) → Any[source]

Return information about a repository and its versions.

Parameters
  • host – host provider name (e.g. GitHub)

  • owner – owner

  • repo – repo

Returns

List of dicts of info about a repository from libraries.io.

repository_dependencies(host: str, owner: str, repo: str) → Any[source]

Return information about a repository’s dependencies.

Parameters
  • host – host provider name (e.g. GitHub)

  • owner – owner

  • repo – repo

Returns

Dict of repo dependency info from libraries.io.

repository_projects(host: str, owner: str, repo: str) → Any[source]

Get a list of projects referencing the given repository.

Parameters
  • host – host provider name (e.g. GitHub)

  • owner – owner

  • repo – repo

Returns

List of dicts of projects referencing a repo from libraries.io.

user(host: str, user: str) → Any[source]

Return information about a user.

Parameters
  • host – host provider name (e.g. GitHub)

  • user – username

Returns: Dict of info about user from libraries.io.

user_repositories(host: str, user: str) → Any[source]

Return information about a user’s repos.

Parameters
  • host – host provider name (e.g. GitHub)

  • user – username

Returns

List of dicts with info about user repos from libraries.io.

user_projects(host: str, user: str) → Any[source]

Return information about projects using a user’s repos.

Parameters
  • host – host provider name (e.g. GitHub)

  • user – username

Returns

List of dicts of project info from libraries.io.

user_projects_contributions(host: str, user: str) → Any[source]

Return information about projects a user has contributed to.

Parameters
  • host – host provider name (e.g. GitHub)

  • user – username

Returns

List of dicts with user project contribution info from libraries.io.

user_repository_contributions(host: str, user: str) → Any[source]

Return information about repositories a user has contributed to.

Parameters
  • host – host provider name (e.g. GitHub)

  • user – username

Returns

list of dicts response from libraries.io

Return type

(list)

user_dependencies(host, user)[source]

Return a list of unique user’s repositories’ dependencies.

Ordered by frequency of use in those repositories.

Parameters
  • host – host provider name (e.g. GitHub)

  • user – username

Returns

List of dicts with user project dependency info.

class pybraries.subscribe.Subscribe[source]

Class for libraries.io API for changing user’s libraries.io subscriptions

list_subscribed() → Any[source]

Return a list of packages a user is subscribed to for release notifications.

Returns

Dict with info for each package subscribed to at libraries.io.

subscribe(manager: str, package: str) → str[source]

Subscribe to receive notifications about new releases of a project.

Not working yet, but hope to include - possible bug at libraries.io: include_prerelease: default = True. Include prerelease notifications.

Parameters
  • manager – package manager name (e.g. PyPI).

  • package – package name.

Returns

Subscription confirmation message.

check_subscribed(manager: str, package: str) → bool[source]

Check if a user is subscribed to notifications for new project releases.

Parameters
  • manager – package manager name (e.g. PyPI).

  • package – package name.

Returns

True if subscribed to the package indicated, else False.

update_subscribe(manager: str, package: str, include_prerelease: bool = True) → str[source]

NOT IMPLEMENTED due to possible bug in libraries.io Update the options for a subscription.

Parameters
  • manager – package manager name (e.g. PyPI).

  • package – package name.

  • include_prerelease (bool) – default = True. Include prerelease notifications.

Returns

Update confirmation message.

unsubscribe(manager: str, package: str) → str[source]

Stop receiving release notifications from a project.

Parameters
  • manager – package manager name (e.g. PyPI).

  • package – package name.

Returns

Message confirming deleted or deletion unnecessary.