-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I/O from file descriptors #57
Comments
That's a great point. Is the file descriptor you have in mind specific to ASCII, binary, or some other format? Or more general? For ASCII you could piggy back on Asciitables, which is what the ASCII parsing in ATpy depends on. Let us know and we'll try to make the feature available. |
By the way, this should already be possible with some of the formats - which format did you (unsuccessfully) try? |
Hi Thomas, well, I actually did not try, but more or less relied on the documentation saying what has to be provided needs to be a filename (string). Anyway if this is something you are considering, I think the behaviour should be the same for all formats. Cheers, On 16/02/2013, at 6:49 PM, Thomas Robitaille notifications@github.com wrote:
|
@awicenec - looking at the code, it seems reading from file objects is supported for all formats, but writing to file objects is not, so I'll see if this can be added. |
I would very much like to see this implemented as well. Which of the formats already support it if you don't mind me asking? I would need to write to stringIO file-like objects so that they can be used as response objects in django... |
@steven-murray - which format do you need to be able to write to? The reason I ask is because Astropy already supports writing to VO tables, ASCII tables, and HDF5 in version 0.2, and I'm pretty sure it allows writing to file objects: http://docs.astropy.org/en/stable/table/index.html If you need FITS output, that will appear in version 0.3 (and is already available in the developer version of Astropy). We are recommending users transition to using Astropy when possible, so let me know if that works for you. |
Sorry I didn't see this reply! I was hoping to output to both ASCII and HDF5, so if they are both supported already that's great! I'll have to look into this again :) Cheers, |
Both these formats are supported by |
It would be very helpful to add support for reading and writing from and to standard file descriptors, rather than just named files. That would allow reading and writing from/to sockets and strings using stringIO.
The text was updated successfully, but these errors were encountered: