Skip to content

Conversation

maurizi
Copy link
Contributor

@maurizi maurizi commented Jul 22, 2016

Builds on top of #84

maryokhin and others added 3 commits May 16, 2016 18:01
Most changes were minor changes to switch to methods that work on both
Python 2 & 3.

The major change was a switch to the underlying CSV library.

Based on a suggestion from the Django documentation I switched to the
python-unicodecsv library, which handles unicode encoding and works
properly with both Python 2 & 3, and is capable of writing to Django's
HttpResponse, which presents an interface of a binary file-like object.
(https://docs.djangoproject.com/en/1.9/howto/outputting-csv/#using-the-python-csv-library)
coverage==3.6
flake8==2.5.1
django>=1.5
unicodecsv==0.14.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be unicodecsv>=0.14

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in 351a114

@steventlamb
Copy link
Contributor

steventlamb commented Jul 22, 2016

LGTM.

Bringing in python-unicodecsv looks like the right way to deal with this problem.

Is this planned for a major or minor version increase?

maurizi added 3 commits July 22, 2016 16:56
Since unicode handling is now done by the unicodecsv library, the function
name was a bit misleading
Since it is intended to provide a drop-in replacement for the standard
library CSV module, I don't expect we'll have to deal with breaking changes
@maurizi
Copy link
Contributor Author

maurizi commented Jul 22, 2016

Is this planned for a major or minor version increase?

Since this library is fairly stable and this is the last major item on the "TODO" list, I figured I'd do a 1.0 release.

@coveralls
Copy link

coveralls commented Jul 22, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 351a114 on maurizi:villoid-feature/python-3 into a5f7398 on azavea:master.

@ddohler
Copy link

ddohler commented Jul 26, 2016

I only have theoretical knowledge of unicode handling in Python 3 but the broad strokes here look right.

@jwalgran
Copy link
Member

While working on other things I tried provisioning an OpenTreeMap VM with this branch by adding a git url to the requirements.txt file. I hit an error but will make another attempt at doing some regression testing in the context of a Python 2.7 app.

@zzzuzik
Copy link

zzzuzik commented Sep 9, 2016

+1

Copy link
Member

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I built a new OpenTreeMap development app server VM replacing the existing django-queryset-csv line in requirements.txt with this line:

git+https://github.com/maurizi/django-queryset-csv.git@villoid-feature/python-3#egg=django-queryset-csv

All unit tests pass.

I was able to successfully create exports of multiple datasets, including data with unicode characters.

@maurizi maurizi merged commit 3ab7a2c into azavea:master Sep 23, 2016
@maurizi maurizi deleted the villoid-feature/python-3 branch September 23, 2016 14:38
@maurizi maurizi mentioned this pull request Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants