api.v2.reports module

api.v2.reports.create_python_report(name, python_code, run_when, export_options, report_id=None)[source]

Creates a new python-based Report

Parameters:
  • name (str) – The name of the new Report
  • python_code (str) – The base64-encoded python code
  • run_when (str) – The scheduled time to run a report
  • export_options (dict) –
    {
    ‘action’: ‘none’, ‘queue’ or ‘automatic’, ‘method’: ‘email’ or ‘ftp’ ... # Other options change depending on ‘email’ or ‘ftp’

    }

Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str) – List of human-readable error messages

  • data (dict) – {

    ‘id’: ‘Some UUID id’

    }

api.v2.reports.create_report_category(category_name)[source]

Creates a new Report Category

Parameters:category_name (str) – The name of the new Report Category
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – The data response having the form:
    {
        'id': 'Some UUID id',
        'name': 'Category Name'
    }
    
api.v2.reports.data_frame_preview(df_name, numberOfRows=20, prepared=False)[source]

Get a preview of the selected dataframe :param df_name: the name of the dataframe :type df_name: string :param numberOfRows: The number of rows to take from head of dataframe for sample :type numberOfRows: int :param prepared: Indicated if this dataframe is a prepared dataframe (defaults to false) :type prepared: boolean

Returns:
  • success (bool) – True if successful, False if not
  • messages (list of str) – List of human-readable error messages
  • data (dict with dataframe preview)
api.v2.reports.delete_file(report_id, file_id)[source]

Deletes file from File table

Parameters:
  • report_id (string) – UUID of the report associated with the file
  • file_id (string) – UUID of the file wishing to delete
Returns:

  • success (bool) – True if successful, False if not
  • messages (list of str) – List of human-readable error messages
  • data (dict of File deleted)

api.v2.reports.delete_report(report_id)[source]

Deletes an existing Report

Parameters:report_id (str) – The UUID of the existing Report
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
api.v2.reports.delete_report_category(category_id)[source]

Deletes an existing Report Category

Parameters:category_id (str) – The UUID of the existing Report Category
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
api.v2.reports.fetch_prepared_yml()[source]

Get the prepared.yml file :returns: * success (bool) – True if successful, False if not

  • messages (list of str) – List of human-readable error messages
  • data (dict with yaml information)
api.v2.reports.get_s3_token()[source]

Gets authentication token from S3 Gateway for DF and PDF retrieval.

S3 Gateway is a service that allows restricted access to S3 assets. This call will return an Authentication key used for making calls to S3 Gateway. The Authentication key will be restricted to dataframes for the client associated with the login.

NOTE: Only users with roles of Admin or Vendor can receive a S3 Auth key

Parameters:None
Returns:
  • success (bool) – True if successful, False if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – Authentication key and expiration time :: {
    ‘client’: ‘Client Name’, ‘expires’: ‘UTC Time’, ‘key’: ‘UUID Authentication key’

    }

api.v2.reports.list_df_cache_files(prefix, auth_token, prepared=False)[source]

Retrieves a list of df_cache files

Parameters:
  • prefix (string) – Prefix of the files. Usually a date in YYYYMMDD format
  • auth_token (string) – S3 authentication token
  • prepared (bool (Optional)) – Get prepared df_cache files
Returns:

  • success (bool) – True if successful, False if not

  • messages (dict) – List of error messages

  • data (dict) – {
    ‘files’: [
    {

    ‘url’: ‘...’, #download link for file ‘expired’: ‘2014-09-08T08:02:17.127178’, #expiration of url (ISO 8601) ‘id’: ‘...’ #unique (in line) id for the file

    },

    ]

    }

api.v2.reports.list_files(report_id)[source]

Get list of files associated with report

Parameters:report_id (string) – UUID of the report associated with the file
Returns:
  • success (bool) – True if successful, False if not
  • messages (list of str) – List of human-readable error messages
  • data (list of related files)
api.v2.reports.rename_report_category(category_id=None, category_name=None)[source]

Renames an existing Report Category

Parameters:
  • category_id (str) – The UUID of the existing Report Category
  • category_name (str) – The new name of the new Report Category
Returns:

  • success (bool) – True if successful, false if not

  • messages (list of str) – List of human-readable error messages

  • data (dict) – The data response having the form:

    {
        'id': 'Some UUID id',
        'name': 'Category Name'
    }
    

api.v2.reports.retrieve_python_reports()[source]

Retrieves all available python Reports

Parameters:None
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – {
    ‘reports’: [
    {
    ‘report_id’: ‘Report UUID’, ‘name’: ‘Report Name’, ‘export_options’: {...}, ‘run_when’: ‘manual’

    },

    ]

    }

api.v2.reports.retrieve_reports()[source]

Retrieves all available Reports, grouped in their Report Categories

Parameters:None
Returns:
  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – The data response having the form:
    {
        'report_categories': [
            {
                'name': 'Category Name', 'id': 'Category UUID',
                'reports': [
                    {
                        'name': 'Report Name', 'id': 'Report UUID',
                        'category_id': 'Parent Category UUID',
                        'description': 'Markdown Lite Description',
                        'output_format': 'xls, xml, csv, etc.',
                        'css': 'Custom CSS',
                        'yaml': {...}, # complex BriteData report YAML, in JSON format
                        'template': 'BriteData report template',
                        'custom': bool, # true if created by a user
                        'date_type': 'single/range',
                        'legacy': bool, # true if this is NOT a BriteData report
                        'run_when': 'manual, daily, weekly, monthly, or annually',
                        'custom_start_date': 'MM/DD/YYYY',
                        'export_options': {...} # complex custom export options
                    },
                ]
            },
        ]
    }
    
api.v2.reports.update_python_report(report_id, **kwargs)[source]

Updates a python-based Report

Parameters:
  • report_id (str) – The id of the existing Report
  • name (str) – The new name of the Report
  • python_code (str) – The new base64-encoded python code
  • run_when (str) – The scheduled time to run a report
  • export_options (dict) –
    {
    ‘action’: ‘none’, ‘queue’ or ‘automatic’, ‘method’: ‘email’ or ‘ftp’ ... # Other options change depending on ‘email’ or ‘ftp’

    }

Returns:

  • success (bool) – True if successful, false if not
  • messages (list of str) – List of human-readable error messages
  • data (dict) – {}

api.v2.reports.upload_file(report_id, title, data, kwargs=None)[source]

Uploads file in Files table and stores to S3

Parameters:
  • report_id (string) – UUID of the report uploading files for
  • title (string) – Title of the file being uploaded
  • data (str) – Base64-encoded of the file
  • kwargs (dict (Optional)) –

    Additional parameters in file creation. Must be valid args. See File model for full list of properties.

    {
        'reference_id': 'Some UUID'
    }
    
Returns:

  • success (bool) – True if successful, False if not
  • messages (list of str) – List of human-readable error messages
  • data (dict of new File model)