[sqlalchemy] RE: 'Hand Coded Applications with SQLAlchemy' video

2012-11-30 Thread Kent Tenney
Howdy,

I'm a Python programmer setting out to put a bunch of stuff into
a Postgres db, studying the video for direction.

I wonder if any of the practices described have changed
substantially since it was recorded.

Just checked and found it's from Pycon 2012, so probably not,
though SA seems to evolve quickly, I'm using trunk.

Thanks,
Kent

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] live access to postgis database to use in ExtJS, OpenLayers, etc

2012-10-03 Thread Kent Tenney
It sounds like you are trying to do at least 6 quite complicated
things all at once, without really understanding any of them. This
will not be easy.

Sigh. The story of my life in one sentence.

On Tue, Oct 2, 2012 at 8:43 AM, Simon King si...@simonking.org.uk wrote:
 On Mon, Oct 1, 2012 at 11:38 PM, Gery . gameji...@hotmail.com wrote:

 thanks but I want to use that live access to search at first through
 ExtJS/GeoExtJS/OpenLayers and through them there is only a url available
 (protocol HTTP), I also need to get the data as GeoJSON, so I think
 GeoAlchemy might not be the right solution, I think. If I'm wrong, please
 I'd love some points about it, thanks.


 It sounds like you are trying to do at least 6 quite complicated
 things all at once, without really understanding any of them. This
 will not be easy.

 1. The client side of your application is presumably written in
 Javascript and HTML, using javascript libraries such as ExtJS and
 OpenLayers. You need to fully understand how these work.

 2. The application will then make HTTP requests to a web server. You
 need to understand at least the basics of HTTP.

 3. The web server might be a single python script, or it could be
 something running behind Apache. You need to understand your web
 server.

 4. The server side of your application might be using any of a number
 of libraries to connect to the web server (such as
 Django/Pyramid/Flask/cgi/mod_wsgi etc.). You need to understand
 whatever mechanism your application is using to speak HTTP.

 5. Your application can use SQLAlchemy and GeoAlchemy to retrieve data
 from postgis into Python data structures. You will need to understand
 postgis, SQLAlchemy, GeoAlchemy and Python.

 6. Your application can then convert those Python data structures into
 GeoJSON. You will need to understand GeoJSON.

 The SQLAlchemy mailing list can help you with exactly one part of this
 (step 5). SQLAlchemy (and GeoAlchemy) is perfectly capable of querying
 multiple tables and retrieving results. But how you accept the HTTP
 request, and how you pass the results back, are completely outside the
 scope of this list and I'm afraid you are unlikely to find much help
 here with it.

 Sorry I can't be more help,

 Simon

 --
 You received this message because you are subscribed to the Google Groups 
 sqlalchemy group.
 To post to this group, send email to sqlalchemy@googlegroups.com.
 To unsubscribe from this group, send email to 
 sqlalchemy+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/sqlalchemy?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] Newbie question

2011-07-28 Thread Kent Tenney
On Wed, Jul 27, 2011 at 2:48 PM, Michael Bayer mike...@zzzcomputing.com wrote:

 On Jul 27, 2011, at 3:21 PM, Kent Tenney wrote:

 Howdy,

 I'm aggregating data from several Sqlite files into a Postgres db.
 The sqlite files are storage for several apps I use: Shotwell,
 Firefox, Zotero, Banshee ... I just watch and pull from them.

 I've been using import sqlite3 so far, dumping sql from sqlite,
 using it to create the Postgres tables. I then add columns to meet
 my own needs. I now can diff 2 sqlite files, so I know what rows
 need updating and adding in the Postgres tables.

 I feel I should be using Sqlalchemy,

 ok well what problems do you have currently that you'd like to solve ?

With some proof-of-concept working, looking ahead to increasing
complexity, my sense is that SA can hide some complexity behind
a layer which moves data into Postgres. I think this is what you
suggest in your final paragraph.



 but have been intimidated by
 the wealth of choices SA offers.

 It offers choices in that you can A. use core only or B. the ORM, as well 
 as choices in that it works with whatever kind of schema you'd like,

I'll be studying doc for a better idea of the A/B distinction, as
well as what kinds of schemas there are.

I have the O'Reilly book, I understand SA has changed considerably
since then, am I better off sticking with current doc?

 which is the same choice you have anyway, and in this case it seems
you have already made.     Your app sounds like kind of a nuts and
bolts table-to-table thing, i.e. is SQL centric, so using constructs
like table.select() and table.insert() could perhaps reduce the
verbosity of generating those statements by hand, the Table construct
itself can turn the equation of what columns am i dealing with here?
into a data driven one (the Table is a datastructure, which stores a
list of Column objects - a data driven description of a schema).


 - comfortable in Python, SQL not so much

 dont sell yourself short, you're moving rows and adding columns and that's a 
 fair degree of knowledge right there.

  - pull into the Postgres db from other sources
    - file system content
    - email
    - other db's: Mysql, rdf, ...
  - feed Sphinxsearch from the Postgres db

 for all of these you'd probably want to figure out some intermediary format 
 that everything goes into, then goes to the database.  Depending on how much 
 this format is hardwired to the SQL schema or not, as well as if you're 
 generally dealing with one big table to store a format versus many tables 
 storing a more normalized structure, would determine how well the ORM may or 
 may not be useful. The ORM is good when you have multiple tables in some 
 hierarchical structure that is to be related to an object hierarchy.   For a 
 straight up I'd like the columns in this Excel spreadsheet to become columns 
 in a new database table, it might be overkill.

I appreciate the advice, I'll be back.

Thanks,
Kent




 --
 You received this message because you are subscribed to the Google Groups 
 sqlalchemy group.
 To post to this group, send email to sqlalchemy@googlegroups.com.
 To unsubscribe from this group, send email to 
 sqlalchemy+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/sqlalchemy?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



[sqlalchemy] Newbie question

2011-07-27 Thread Kent Tenney
Howdy,

I'm aggregating data from several Sqlite files into a Postgres db.
The sqlite files are storage for several apps I use: Shotwell,
Firefox, Zotero, Banshee ... I just watch and pull from them.

I've been using import sqlite3 so far, dumping sql from sqlite,
using it to create the Postgres tables. I then add columns to meet
my own needs. I now can diff 2 sqlite files, so I know what rows
need updating and adding in the Postgres tables.

I feel I should be using Sqlalchemy, but have been intimidated by
the wealth of choices SA offers. I don't want to start down the
wrong road.

However, as I look towards coding change merging, and
the new level of complexity it presents, I think it's time to
take the plunge.

Data specs:

- source data lives in other-owned files
- replicate source data tables in Postgres
- add columns to Postgres tables
- keep Postgres synced with sqlite sources

My proclivities:

- comfortable in Python, SQL not so much
- roadmap
  - pull into the Postgres db from other sources
- file system content
- email
- other db's: Mysql, rdf, ...
  - feed Sphinxsearch from the Postgres db

I would greatly appreciate any suggestions
on how to proceed.

Thanks,
Kent

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.