Usage

ossindex-lib is designed to be included into other Python projects, not used as a standalone application.

Library Configuration

There are two key configurations that are possible:

  1. Caching of response from OSS Index

  2. Authentication for OSS Index

Caching of OSS Index Responses

By default, caching is enabled and the cache will be stored in $HOME/.ossindex/.

You can disable caching as follows:

ossi = OssIndex(enable_cache=False)

You can control the base directory where the cache directory .ossindex is created by supplying a directory as follows:

ossi = OssIndex(cache_location='/my/other/directory')

In this last example, caching will be enabled and the cache will be stored in /my/other/directory/.ossindex.

Authenticating to OSS Index

By default, this library will attempt authenticated calls to OSS Index if authentication credentials exist in $HOME/.oss-index.config.

.oss-index.config is a YAML formatted file and the example below shows how a username and password can be added to enable authenticated calls to OSS Index:

username: my-oss-index-username
password: my-oss-index-password