Files
torus-ml/docs/references/api/torus.ml.pandas.client_engine.md
zeekay e037e8f7ea torus: one name for the package, and it is ours
The distribution called itself torus-ml while shipping a package directory
named concrete, so the name a user installs and the name they import disagreed
— and most of the tree already said torus.ml, which could not resolve against
src/concrete. Moved src/concrete to src/torus and pointed the include at it.

The dependency was Zama's concrete-python from their index. It is torus-fhe
from ours, which is what luxfhe/torus already ships: that frontend declares
torus-fhe and ships a torus/fhe module, so every 'from torus.fhe' in this tree
was already naming our compiler and only the dependency lagged.

Two distributions share one namespace, which is the shape the upstream this
forked from used and the reason the split works: torus-fhe gives torus.fhe,
torus-ml gives torus.ml.

Swept every other spelling — identifiers, enum members, workflow variables,
filenames, notebooks. LICENSE and NOTICE keep the upstream attribution a fork
owes; the figures carry the old name in JPEG metadata a text sweep cannot
reach.
2026-08-27 13:20:50 -07:00

2.9 KiB

module torus.ml.pandas.client_engine

Define the framework used for managing keys (encrypt, decrypt) for encrypted data-frames.

Global Variables

  • CURRENT_API_VERSION

class ClientEngine

Define a framework that manages keys.

method __init__

__init__(keygen: bool = True, keys_path: Optional[Path, str] = None)

method decrypt_to_pandas

decrypt_to_pandas(encrypted_dataframe: EncryptedDataFrame) → DataFrame

Decrypt an encrypted data-frame using the loaded client and return a Pandas data-frame.

Args:

  • encrypted_dataframe (EncryptedDataFrame): The encrypted data-frame to decrypt.

Returns:

  • pandas.DataFrame: The Pandas data-frame built on the decrypted values.

method encrypt_from_pandas

encrypt_from_pandas(
    pandas_dataframe: DataFrame,
    schema: Optional[Dict] = None
) → EncryptedDataFrame

Encrypt a Pandas data-frame using the loaded client.

Args:

  • pandas_dataframe (DataFrame): The Pandas data-frame to encrypt.
  • schema (Optional[Dict]): The input schema to consider. Default to None.

Returns:

  • EncryptedDataFrame: The encrypted data-frame.

method keygen

keygen(keys_path: Optional[Path, str] = None)

Generate the keys.

Args:

  • keys_path (Optional[Union[Path, str]]): The path where to save the keys. Note that if some keys already exist in that path, the client will use them instead of generating new ones. Default to None.