<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">If you've got an arbitrary object in Python, you'll need to serialize it to a file-like object. You could keep it in memory and use a <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">StringIO</code> type, or you could serialize it to disk and <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">open()</code> it like any other file.</p>

<p dir="auto">Ultimately, Swift is storing arbitrary bytes and doesn't care what they are. You, as the Swift client (i.e. API user), need to dump those bytes on the network to send them to Swift. As long as you're transforming your Python object[s] in some regular way that makes sense in your application, it doesn't matter what bytes you send to Swift.</p>

<p dir="auto">--John</p>

<p dir="auto">On 5 Oct 2017, at 8:07, Jialin Liu wrote:</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">Hi,<br>
It seems to me that openstack swift only supports file upload/download, is<br>
it possible to put a python object to swift store?<br>
The doc says we could use file-like object, e.g., StringIO, but this is<br>
very limited. I'd like to write a numpy array or other python object into<br>
the swift store, can anybody tell me the solution?<br>
<br>
Best,<br>
Jialin<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: OpenStack-dev-request@lists.openstack.org?subject:unsubscribe<br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" style="color:#777">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a></p>
</blockquote></div>
<div style="white-space:normal">
</div>
</div>
</body>
</html>