send-to-squey API documentation¶
- class send_to_squey.SqueyInstance(endpoint, auth, disable_server_verification, compression_codec)[source]¶
Bases:
object
- import_data(data, dataset_name=None)[source]¶
Uploads a dataset to the cloud Squey instance and imports it.
- Parameters:
data – any object compatible with pyarrow.record_batch data parameter (see https://arrow.apache.org/docs/python/generated/pyarrow.record_batch.html#pyarrow-record-batch) or the path toward a parquet file.
dataset_name (string) – the name of the dataset that will be displayed in Squey.
- send_to_squey.connect(endpoint, auth, disable_server_verification=False, compression_codec='lz4')[source]¶
Connect to Squey server and returns a
SqueyInstance
object.- Parameters:
endpoint (string) – the connection endpoint.
auth ((string, string)) – a tuple composed of username and password.
port (int) – the apache arrow flight server port.
disable_server_verification (bool) – disable SSL server verification.
compression_codec (string) – compression codec used (“lz4”, “zstd” or None; defaults to “lz4”)
- Returns:
a
SqueyInstance
object
- send_to_squey.start_instance(instance_id, cloud_provider=CloudProvider.AWS, profile_name=None, region_name=None)[source]¶
Start a cloud instance.
- Parameters:
instance_id (string) – the id of the instance
cloud_provider – a value of the CloudProvider enum
profile_name (string) – the profile name
region_name (string) – the region code
Examples¶
Connect and send a dataset¶
from squeylab import send_to_squey
import pandas as pd
squey = send_to_squey.connect(
endpoint="3.222.243.61.aws.squeylab.com",
auth=("squey", "p@$$w0rd!")
)
df = pd.DataFrame(data={'col1': [1, 2], 'col2': [3, 4]})
squey.import_data(df, dataset_name="my_dataset")
Note
import_data data parameter can be any object compatible with pyarrow.record_batch data parameter, or a path toward a parquet file.
Start the instance¶
from squeylab import send_to_squey
send_to_squey.start_instance(instance_id="i-0eb3fbba537abfa95")
Note
Only supporting AWS for the moment. Needs a properly configured credential file.