zeff.cloud package

Submodules

zeff.cloud.dataset module

Zeff Cloud Dataset access.

class zeff.cloud.dataset.Dataset(dataset_id: str, resource_map)[source]

Bases: zeff.cloud.resource.Resource

Dataset in the Zeff Cloud API.

add_record(record)[source]

Add a record to this dataset.

Parameters

record – The record data structure to be added.

Raises

ZeffCloudException – Exception in communication with Zeff Cloud.

classmethod create_dataset(resource_map, dataset_type: zeff.zeffdatasettype.ZeffDatasetType, title: str, description: str) → zeff.cloud.dataset.Dataset[source]

Create a new dataset on Zeff Cloud server.

Parameters
  • resource_map – Map of tags to Zeff Cloud resource objects.

  • dataset_type – Type of dataset to create.

  • title – Title of the new dataset.

  • description – Description of the new dataset.

  • temporal – Type of dataset to create.

Returns

A Dataset which maps to the instance in Zeff Cloud.

Raises

ZeffCloudException – Exception in communication with Zeff Cloud.

classmethod datasets() → Iterator[zeff.cloud.dataset.Dataset][source]

Return iterator of all datasets in Zeff Cloud server.

models()[source]

Return iterator over all models in the dataset.

Raises

ZeffCloudException – Exception in communication with Zeff Cloud.

records()[source]

Return iterator over all records in the dataset.

Raises

ZeffCloudException – Exception in communication with Zeff Cloud.

start_training()[source]

Start or restart the current training session.

stop_training()[source]

Stop the current training session.

property training_status

Return current training status metrics object.

zeff.cloud.encoder module

Zeff CLI record encoders.

class zeff.cloud.encoder.RecordEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: json.encoder.JSONEncoder

Encode Zeff Records.

default(o)[source]

Return primative objects for Record.

zeff.cloud.record module

Zeff Cloud Datasets Record.

class zeff.cloud.record.Record(dataset, record_id: str)[source]

Bases: zeff.cloud.resource.Resource

Zeff Cloud Record access.

property created_timestamp

Return the timestamp when this record was created.

property dataset_id

Return dataset id for this record.

property errors

Return errors for this record.

property predictions

Return predictions for this record.

property record_id

Return this record’s id.

property structured_data

Return the structured data list for this record.

property unstructured_data

Return the unstructured data list for this record.

update()[source]

Update record information from Zeff Cloud.

property updated_timestamp

Return the timestamp when this record was updated.

zeff.cloud.resource module

Zeff Cloud REST resource.

class zeff.cloud.resource.Resource(resource_map)[source]

Bases: object

Base class for accessing Zeff Cloud REST resources.

add_resource(rsrc, rsrc_name, rsrc_id_name, tag, **kwargs)[source]

Add a resource to this resource.

This generalizes the operation of adding to a set of resources contained by this resource.

Warning

There must be a class in encoder.py that has the name {rsrc.__name__}Encoder for this method to operate correctly.

Parameters
  • rsrc – The resource to be added.

  • rsrc_name – The unique name to be used for the resource.

  • rsrc_id_name – The id key name in the returned data.

  • tag – The tag in the resource map that identifies the URL.

  • args – TBD

  • kwargs – Additional keyword arguments that match named variables in the tagged URL. This list should not included variables that name properties of this resource as those will be looked up.

request(tag, method='GET', data=None, headers=None, **kwargs)[source]

Send request to Zeff Cloud server and return response.

Parameters
  • tag – Tag that identifies anchor and methods.

  • data – Data to send in request.

  • headers – Additional headers to send with request.

  • ** – Arguments to use in creating the URL. The key should match the variable in the anchor.

Returns

The response from the server.

Default Headers:

  • Accept

  • Content-Type

  • Content-Length

  • x-api-key

classmethod snake_case(name)[source]

Convert camel case name to snake case.

Module contents

Zeff Cloud access.