MCPcopy
hub / github.com/diffgram/diffgram / upload_from_string

Method upload_from_string

shared/data_tools_core_s3.py:190–212  ·  view source on GitHub ↗

Uploads the given string to S3 blob storage service. :param blob_path: the blob path where the file will be uploaded in the bucket :param string_data: the string data to upload :param content_type: content type of the string data :param bucket_type: the D

(self,
                           blob_path: str,
                           string_data: str,
                           content_type: str,
                           bucket_type: str = "web")

Source from the content-addressed store, hash-verified

188 ExtraArgs = {'ContentType': content_type})
189
190 def upload_from_string(self,
191 blob_path: str,
192 string_data: str,
193 content_type: str,
194 bucket_type: str = "web"):
195 """
196 Uploads the given string to S3 blob storage service.
197 :param blob_path: the blob path where the file will be uploaded in the bucket
198 :param string_data: the string data to upload
199 :param content_type: content type of the string data
200 :param bucket_type: the Diffgram bucket type (either 'web' or 'ml'). Defaults to 'web'
201 :return: None
202 """
203 if bucket_type == "web":
204 bucket_name = self.s3_bucket_name
205
206 if bucket_type == "ml":
207 bucket_name = self.s3_bucket_name_ml
208
209 self.s3_client.put_object(Body = string_data,
210 Bucket = bucket_name,
211 Key = blob_path,
212 ContentType = content_type)
213
214 def download_bytes(self, blob_path: str):
215 """

Callers 6

save_text_tokensMethod · 0.45
save_raw_text_fileMethod · 0.45
__send_exportMethod · 0.45
new_external_exportFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected