Viewing Content Packages

Problem

You want to view the packages installed on Connect for some content.

Solution

Warning

You must have administrator or publisher privileges to view packages.

The content.packages attribute returns a list of packages installed on Connect for the content.

from posit import connect

GUID = "154bd2af-e8fa-4aa4-aab8-dcef701f4af9"

client = connect.Client()
content = client.content.get(GUID)
packages = content.packages

Let’s view the results using Pandas. Here we can see each package installed on Connect for the content.

  • language: Programming language ecosystem, options are ‘python’ and ‘r’.
  • name: The package name.
  • version: The package version.
  • hash: Package description hash for R packages.
>>> pd.DataFrame(packages)
    language                  name version  hash
0     python                 anyio   4.6.0  None
1     python               appdirs   1.4.4  None
2     python           argon2-cffi  23.1.0  None
3     python  argon2-cffi-bindings  21.2.0  None
4     python                 arrow   1.3.0  None
..       ...                   ...     ...   ...
110   python             webcolors  24.8.0  None
111   python          webencodings   0.5.1  None
112   python      websocket-client   1.8.0  None
113   python    widgetsnbextension  4.0.13  None
114   python              yfinance  0.2.37  None

[115 rows x 4 columns]