SuitePY package

bean module

class bean.Bean(module, name_value_list=None, relationship_list=None)[source]

Bases: object

This class represents a SuiteCRM Bean.

fields

Get list of bean fields.

Returns:list with bean fields.
Return type:list[str]
json

Get JSON representation of bean.

Returns:key value dictionary containing all bean fields.
Return type:dict[str, object]
name_value_list

Get name value list of bean fields.

Returns:name value list of bean fields.
Return type:list[dict]
show()[source]

Prints a representation of bean information.

bean_exceptions module

exception bean_exceptions.BeanException(description='')[source]

Bases: exceptions.Exception

Base class for Bean exceptions.

exception bean_exceptions.BeanNotFoundException(description='')[source]

Bases: bean_exceptions.BeanException

Exception raised when requested Bean is not found.

config module

class config.Config(config_file='suitepy.ini')[source]

This class is used to read from a file the access credentials of a SuiteCRM API.

This avoids the need of hard-code the credentials in the code.

application_name

Get application name used when login to SuiteCRM API.

Returns:application name.
Return type:str
password

Get login password.

Returns:login password.
Return type:str
url

Get SuiteCRM REST API URL.

Returns:SuiteCRM REST API URL
Return type:str
username

Get login username.

Returns:login username.
Return type:str
verify_ssl

Specifies whether the SSL certificate should be verified.

Returns:True if SSL certificate must be verified, False otherwise.
Return type:bool

singleton module

class singleton.Singleton[source]

Bases: object

suite_exceptions module

exception suite_exceptions.AccessDeniedException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when logged user does not have permission to perform the requested action.

exception suite_exceptions.AdminCredentialsRequiredException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when the requested action can only be performed by an account with administrator rights.

exception suite_exceptions.CannotAddOfflineClientException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when is not possible to add offline client.

exception suite_exceptions.ClientDeactivatedException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when a client offline instance has been deactivated.

exception suite_exceptions.CustomFieldPropertyNotSuppliedException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when one or more properties are missing for the supplied custom field type.

exception suite_exceptions.CustomFieldTypeNotSupportedException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when a custom type is not supported.

exception suite_exceptions.DuplicateRecordsException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when duplicated records are found.

exception suite_exceptions.FileDoesNotExistException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when the requested file does not exist on the server.

exception suite_exceptions.InvalidCallErrorException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when the requested call is invalid for the given module.

exception suite_exceptions.InvalidDataFormatException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when the data of a request is invalid.

exception suite_exceptions.InvalidLoginException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when login is invalid.

exception suite_exceptions.InvalidPortalClientException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when portal client does not have authorized access.

exception suite_exceptions.InvalidSessionIDException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when session is not valid.

exception suite_exceptions.InvalidSetCampaignMergeDataException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when merge action status will not be updated, because, campaign_id is null or no targets were selected.

exception suite_exceptions.LDAPAuthenticationFailedException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when LDAP Authentication failed but supplied password was already encrypted.

exception suite_exceptions.LockoutReachedException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when you have been locked out of the Sugar application and cannot log in using existing password.

exception suite_exceptions.ModuleDoesNotExistException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when requested module is not available.

exception suite_exceptions.ModuleNotSupportedException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when the requested action is not supported on a module.

exception suite_exceptions.NoErrorException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when no error is specified.

exception suite_exceptions.NoRecordsException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when no records are found.

exception suite_exceptions.NumberOfSessionsExceededException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when max number of sessions is reached.

exception suite_exceptions.PasswordExpiredException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when password of logged user is expired.

exception suite_exceptions.RelationshipNotSupportedException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when a relationship is not supported on a module.

exception suite_exceptions.ResourceManagementErrorException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when the resource query limit specified in config.php has been exceeded during execution of the request.

exception suite_exceptions.SuiteException(data)[source]

Bases: exceptions.Exception

Base class for SuiteCRM requests exceptions.

static get_suite_exception(result)[source]

Get a SuiteException from the error specified in the result of a failed API call.

Parameters:str] result (ict[str,) – result of a failed API call.
Returns:the SuiteException that represents the error of result.
Return type:SuiteException
exception suite_exceptions.UnknownSuiteException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when the request error is unknown.

exception suite_exceptions.UpgradeClientException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when upgrading an offline client.

exception suite_exceptions.UserNotConfiguredException(data)[source]

Bases: suite_exceptions.SuiteException

Exception raised when the authenticated user is not configured.

suitecrm module

suitecrm_cached module

class suitecrm_cached.SuiteCRMCached[source]

Bases: suitecrm.SuiteCRM

This class allows you to make cached calls to SuiteCRM. When making a request, first look if its in the cache and, if is not on the cache, make the request to SuiteCRM, save it in the cache and finally return the result of the request.

The cache has a limit of cached requests, when this limit is reached, the request that has not been accessed for a longer time is eliminated.

This class allows you to make the same calls as the SuiteCRM class. Its the responsibility of the programmer to determine when to use SuiteCRM or SuiteCRMCached, taking into account that the information returned by SuiteCRMCached may not be updated with the existing information on the SuiteCRM instance.

clear_cache()[source]

This method clears all the information stored on the internal cache.

get_number_of_cached_calls()[source]

Get the number of cached calls.

Returns:number of cached calls.
Return type:int