LCCS

class lccs.lccs.LCCS(url: str, validate=False, access_token=None, language=None)

This class implements a Python API client wrapper for LCCS-WS.

See https://github.com/brazil-data-cube/lccs-ws for more information on LCCS-WS.

Parameters:

url (str) – The LCCS-WS server URL.

__init__(url: str, validate=False, access_token=None, language=None)

Create a LCCS-WS client attached to the given host address (an URL).

property allowed_language

Retrieve a list of languages allowed by the service.

property classification_systems

Retrieve the list of names of all available classification systems in the service.

Returns:

list of Classification Systems.

Return type:

dict

classification_system(system: str) ClassificationSystem

Return information about the given classification system.

Parameters:

system (str) – A str with name-version for a given classification_system.

Returns:

A ClassificationSystem.

Return type:

dict

available_mappings(system_source: str) list

Return the available mappings of classification system.

Parameters:

system_source (str) – The name or identifier of classification system.

Returns:

Available Classification Systems Mappings.

Return type:

list

mappings(system_source: str, system_target: str) MappingGroup

Return the given classification_system.

Parameters:
  • system_source (str) – The name or identifier of classification system.

  • system_target (str) – The name or identifier of classification system.

Returns:

Mappings of classification Systems.

Return type:

list

available_style_formats() list

Fetch the available style formats.

Returns:

Available style formats.

Return type:

list

style_formats(system) list[StyleFormats]

Fetch styles of the a giving classification system.

Parameters:

system (str) – The id or identifier of a classification system.

Returns:

Available Classification Systems Styles.

Return type:

list

get_style(system, style_format, path=None)

Fetch styles of a giving classification system.

Parameters:
  • system (str) – The id or identifier of a classification system.

  • style_format (str) – The id or name of style format.

  • path (str) – Directory path to save the file

Returns:

Style

Return type:

File

add_classification_system(system_path: str | dict) list[dict]

Add new classification system.

update_class(system: str, class_id: int, class_info: dict) list[dict]

Update class to a classification system.

add_classes(system: str, classes: str | list[dict[str, Any]]) dict[str, Any]

Add new classes to an classification system.

add_style(system: str, style_format: str, style_path: str = None, style_tex: str = None, style_name: str = None, style_extension: str = None) list[dict]

Add a new style to a system.

add_mapping(system_source: str, system_target: str, mappings) list

Add new classification system mapping.

add_style_format(name: str) dict

Add a new style format.

delete_classification_system(system: str) int

Delete a specific classification system.

delete_class(system: str, class_name_or_id: str) int

Delete a specific class.

delete_style_format(style_format: str) int

Delete a specific style format.

delete_style(system: str, style_format: str) int

Delete the style of a classification system.

delete_mapping(system_source: str, system_target: str) int

Delete the mapping.

create_style(system: str, style_format: str, options: dict, rules: list)

Create style sld.

property url

Return the LCSS server instance URL.