+1 for this integration. This is a great feature that I've been using on 
projects as well. I'd love to be able to do it within django rather than 
hack my own sql scripts around it. The efficiency/speed up is very real. 

This solves the problem that when working with data where people replicate 
across machines (because of time/space/security/cost issues ) Sending a csv 
via box/dropbox and then loading it in with postgres COP is great way to 
make sure that everyone has the information they need in a way that they 
can query efficiently and build on using django!


On Saturday, July 18, 2015 at 3:19:49 PM UTC-7, Ben Welsh wrote:
>
> Hello,
>
> I am a big fan of PostgreSQL's excellent bulk loader COPY 
> <http://www.postgresql.org/docs/9.4/static/sql-copy.html>. It can rapidly 
> load a CSV file directly into the database, an oftentimes tedious task that 
> I have to do frequently as part of my job. 
>
> I am not a big fan of having to write my COPY commands in raw SQL. I'd 
> much rather use Django's ORM. 
>
> So last week I put together an app call django-postgres-copy 
> <http://django-postgres-copy.californiacivicdata.org/en/latest/> that 
> attempts to integrate COPY into Django, modeling its design on the 
> excellent LayerMapping 
> <https://docs.djangoproject.com/en/1.8/ref/contrib/gis/layermapping/> 
> utility in contrib.gis, which I also use frequently. 
>
> I wrote a blog post about the approach here
>
> http://www.californiacivicdata.org/2015/07/17/hello-django-postgres-copy/
>
> You can find more complete technical documentation here
>
> http://django-postgres-copy.californiacivicdata.org/en/latest/
>
> And all of the code is up here on GitHub
>
> https://github.com/california-civic-data-coalition/django-postgres-copy
>
> Since Django has already begun to integrate other PostgreSQL-specific 
> features in contrib.postgres, I'm curious if the core developers are be 
> interested in adding COPY support as well. 
>
> I'm not attached to the style of my library and I'd welcome a different 
> approach if it got the job done. I'd be thrilled to have the opportunity to 
> carry the torch and do whatever refactoring and additional coding is 
> necessary to qualify it for a merge.
>
> Please let me know what you think. And if I've overlooked some previous 
> discussion or superior third-party library in this area, please forgive me. 
> I searched around but was unable to find anything.
>
> Sincerely,
>
> Ben Welsh
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/0a63377c-7cfe-440e-99fc-2c35592f2381%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to