Skip to content
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

CSV return format #5

Open
pudo opened this issue Dec 4, 2015 · 4 comments · May be fixed by #38
Open

CSV return format #5

pudo opened this issue Dec 4, 2015 · 4 comments · May be fixed by #38
Milestone

Comments

@pudo
Copy link
Contributor

pudo commented Dec 4, 2015

All HTTP API queries should be able to return a simple CSV response. In a fancy scenario, this would allow switching between naming the columns according to logical model fields and the original column names which are mentioned in the model.

This should use streaming responses, rather than pre-generating the full response.

@pwalsh
Copy link
Member

pwalsh commented Dec 4, 2015

Yes! This means Babbage itself can return a stream to write directly to a file server for static aggregation.

@pwalsh
Copy link
Member

pwalsh commented Dec 7, 2015

@akariv we'd certainly want to be able to write aggregate endpoints for a single package as CSV.

@pwalsh pwalsh added this to the Current milestone Dec 7, 2015
@pwalsh
Copy link
Member

pwalsh commented Dec 15, 2015

We are definitely doing this, but it might be in the next sprint so I'm putting on backlog for now.

@pwalsh pwalsh modified the milestones: Backlog, Current Dec 15, 2015
@jbothma
Copy link

jbothma commented Nov 1, 2018

This seems to be implemented but generates invalid CSV when the values contain commas because it's just joining values with ,
https://github.com/openspending/babbage/blob/master/babbage/api.py#L75

It should probably use https://docs.python.org/2/library/csv.html#csv.DictWriter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants