Introduction¶
The khorosjx library acts as a Python software development kit (SDK) to administer and manage Khoros JX (formerly Jive-x) and Jive-n online community platforms.
Installation¶
The package can be installed via pip using the syntax below.
# pip install khorosjx
You may also clone the repository and install from source using the syntax below.
# git clone git://github.com/jeffshurtliff/khorosjx.git
# cd khorosjx/
# python3 setup.py install
Change Log¶
Changes for each release can be found on the Change Log page.
Basic Usage¶
This section provides basic usage instructions for the package.
Importing the package¶
The package can be imported into a Python script using the syntax below.
import khorosjx
Initializing the modules¶
While it is certainly possible to import modules directly (e.g. from khorosjx import users
), it is
recommended that you instead leverage the init_module()
function as shown below.
khorosjx.init_module('content', 'users')
In the example above, both the khorosjx.content
and the khoros.users
modules have been initiated.
Note
It is not necessary to import the khorosjx.core
module as it is imported by default.
Establishing the API connection¶
Before leveraging the API in function calls, you must first establish your connection by providing the
base URL for the environment (e.g. https://community.example.com
) and the username and password for
the unfederated service account through which the API calls will be made. This is demonstrated below.
base_url = 'https://community.example.com'
credentials = ('adminuser', 'password123!')
khorosjx.core.connect(base_url, credentials)
Note
At this time the library only allow connections using basic authentication, but there are plans to include the ability to leverage OAuth 2.0 in a future release.
Once the connection has been established, you can proceed to leverage the library of functions in the various modules as needed.
Requirements¶
The following packages are leveraged within the khorosjx package:
numpy 1.17.4
pandas-0.25.3
python-dateutil 2.8.1
pytz 2019.3
requests 2.22.0
urllib3 1.25.7
The full requirements list can be found in the requirements.txt file.
Modules¶
The KhorosJX Python Library consists of the following primary modules:
- Core Module (khorosjx.core)
This module contains core functions such as initializing the connection to the API, getting API version information, performing GET and PUT requests, etc.
- Admin Module (khorosjx.admin)
This module contains administrative functions that would only be performed by a platform administrator or a community manager.
- Content Module (khorosjx.content)
This module contains functions relating to content within the platform which allows for creating, editing and managing content such as documents, ideas, videos, etc.
- Groups Module (khorosjx.groups)
This module contains functions for working with security groups (and eventually social groups) such as obtaining and managing group membership.
- Spaces Module (khorosjx.spaces)
This module contains functions for working with spaces, such as identifying content within spaces, etc.
- Users Module (khorosjx.users)
This module contains functions for working with users, such as obtaining their account/profile information, getting a count of their created content, etc.
The library also includes some supporting modules to support the overall functionality of the primary modules, as well as modules containing global Classes and Exceptions for the library, which are listed below.
- Core Utilities Module (khorosjx.utils.core_utils)
This module includes various utilities to assist in converting dictionaries to JSON, formatting timestamps, etc.
- Classes Module (khorosjx.utils.classes)
This module contains nearly all classes utilized by other modules within the library.
- Exceptions Module (khorosjx.errors.exceptions)
This module contains all of the exception classes leveraged in functions throughout the library.
License¶
This package falls under the MIT License.
Reporting Issues¶
Issues can be reported within the GitHub repository.
Disclaimer¶
This package is in no way endorsed or supported by the Khoros or Aurea Software, Inc. companies.