Report

Report class definition.

This module contains the Report class definition

class pycic.report.Report(base_url='http://api.cic.mx', version=0, account='nl', proxies=None)[source]

Bases: pycic.base.BaseMethod

Retrieve and save Reports.

get(**kwargs)[source]

Retrieve reports, by default we get all the reports.

Parameters:
  • limit (int or None) – The total reports to get
  • for_category (int or None) – The ID of the category to filter.
  • until (datetime or None) – Show previous reports to the date indicated
Returns:

JSON object representation of the list of Reports

Return type:

dict

Raises:

TypeError, ValueError, InvalidCategory

raise_for_category(field)[source]

Raise InvalidCategory if one ocurred for category.

raise_for_field(field, type_of_field)[source]

Raise TypeError if occurred for field.

raise_for_lat_or_lng(field, limits)[source]

Raise ValueError if one ocurred for latitude or longitude fields.

raise_for_limit()[source]

Raise ValueError or TypeError if one occurred for limit filter.

raise_for_return_path()[source]

Raise ValueError if occurred for return_path field.

raise_for_until()[source]

Raise TypeError if ocurred for until filter.

save(**kwargs)[source]

Create report.

Parameters:
  • title (str) – Report title
  • content (str) – Report content (required)
  • first_name (str) – Report Contact, name of sender in string format
  • last_name (str) – Report Contact, name of sender in string format.
  • return_path (str) – Report Contact in URI format Valid schemes supported: HTTP HTTPS MAILTO
  • lat (float) – The report latitude in WGS84 decimal
  • lng (float) – The report longitude in WGS84 decimal
  • video_url (str) – Asset for the current report, the field accepts a single string with an URL for a valid asset.
  • category (str) – Send here the category name. You can get valid names from Categories (required)
Raises:

NameError, InvalidCategory, TypeError

Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.