Re: [BangPypers] Simple python database library

2010-03-05 Thread Noufal Ibrahim
On Fri, Mar 5, 2010 at 7:46 PM, Pradeep Gowda  wrote:
> On Fri, Mar 5, 2010 at 8:28 AM, Anand Chitipothu  wrote:
>>> Aaargh, few hours after I decide that I run into this. From an intent
>>> perspective it is much more consistent with what I was looking for -
>>> http://www.pauldeden.com/2009/01/edendb-thin-flexible-and-fast-python.html
>>>
>>> The sample usage is listed here
>>> http://code.google.com/p/edendb/
>
>> web.db is more elegant than that.
>
> Excellent! Anand.
>
> Evidently the "web" part of web.py makes people underestimate the
> power and compactness of web.py
>
> A simple scan through the web.db module [1] would have given all the
> information  about
>
> - abstraction -- Tables are objects, column data is accessible via dot
> operator. So, a very nice abstraction.
> - supports all the databases he wanted  [mysql, pg, sqlite, oracle,
> firebird AND mssql]
>
> The syntax is definitely more pythonic and self-explanatory than  edendb.
>
> And unlike edendb [from what i can i tell from the one blog post],
> web.py is used in production by scores of sites.[..]

Yes. At the very least, web.db is older and more mature than edendb.
I'm confused Dhananjay. What exactly were you looking for that web.db
didn't provide which edendb did whe you evaluated the former?




-- 
~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Pradeep Gowda
On Fri, Mar 5, 2010 at 8:28 AM, Anand Chitipothu  wrote:
>> Aaargh, few hours after I decide that I run into this. From an intent
>> perspective it is much more consistent with what I was looking for -
>> http://www.pauldeden.com/2009/01/edendb-thin-flexible-and-fast-python.html
>>
>> The sample usage is listed here
>> http://code.google.com/p/edendb/

> web.db is more elegant than that.

Excellent! Anand.

Evidently the "web" part of web.py makes people underestimate the
power and compactness of web.py

A simple scan through the web.db module [1] would have given all the
information  about

- abstraction -- Tables are objects, column data is accessible via dot
operator. So, a very nice abstraction.
- supports all the databases he wanted  [mysql, pg, sqlite, oracle,
firebird AND mssql]

The syntax is definitely more pythonic and self-explanatory than  edendb.

And unlike edendb [from what i can i tell from the one blog post],
web.py is used in production by scores of sites.

+PG

[1] http://github.com/webpy/webpy/raw/master/web/db.py
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Anand Chitipothu
> Aaargh, few hours after I decide that I run into this. From an intent
> perspective it is much more consistent with what I was looking for -
> http://www.pauldeden.com/2009/01/edendb-thin-flexible-and-fast-python.html
>
> The sample usage is listed here
> http://code.google.com/p/edendb/

web.db is more elegant than that.

>>> import web
>>> db = web.database(dbn='sqlite', db='test.db')
>>> db.query("create table people (name varchar(10), age integer, pet 
>>> varchar(10))")
0.0 (1): create table people (name varchar(10), age integer, pet varchar(10))
-1
>>> db.insert('people', name='paul', age=2, pet='cat')
0.0 (1): INSERT INTO people (pet, age, name) VALUES ('cat', 2, 'paul')
0.0 (2): SELECT last_insert_rowid();
1
>>> db.insert('people', name='tom', age=88, pet='dog')
0.0 (1): INSERT INTO people (pet, age, name) VALUES ('dog', 88, 'tom')
0.0 (2): SELECT last_insert_rowid();
2
>>> for r in db.select("people"): print r.name, r.age, r.pet
...
0.0 (1): SELECT * FROM people
paul 2 cat
tom 88 dog
>>> for r in db.select("people", where='age > $age', vars={"age": 50}): print 
>>> r.name, r.age, r.pet
...
0.0 (1): SELECT * FROM people WHERE age > 50
tom 88 dog

-Anand
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Dhananjay Nene
On Fri, Mar 5, 2010 at 12:49 PM, Dhananjay Nene wrote:

> I've decided to go ahead with SQLAlchemy even though that was not my
> favourite. FWIW I'm just documenting my thoughts :
>
> Cons : Why I would've not preferred SQL Alchemy
> a. Dependency into a large full function package like sqlalchemy which just
> does a ton of stuff. I didn't need a ton of features .. just needed
> something basic.
> b. I was looking for something that worked at a ODBC/JDBC level
> abstraction. Python DBAPI is actually a good candidate but for the fact it
> doesn't really work cross database
>
> Pros : Why I decided to go ahead with SQLAlchemy
> a. Already use it. So am familiar with it.
> b. It is just too slick and polished a product.
> c. It does offer relational abstractions. eg. Table (even though the
> default, most often used mechanism is with model objects). The entire model
> layer I really am not interested in, but SQLAlchemy does give me the
> abstractions for table, connections etc.
> d. Did not find a widely used competing candidate. Just not sure how widely
> used and thus regularly tested adodb for python is - though did not have any
> specific qualms against that particular package.
>
> Thanks for all the suggestions. I evaluated them all and the suggestions
> were very helpful fodder for the process.
>
>
Aaargh, few hours after I decide that I run into this. From an intent
perspective it is much more consistent with what I was looking for -
http://www.pauldeden.com/2009/01/edendb-thin-flexible-and-fast-python.html

The sample usage is listed here
http://code.google.com/p/edendb/

-- 

blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Dhananjay Nene
On Fri, Mar 5, 2010 at 3:59 PM, steve  wrote:

>
>>
>  I personally prefer SQLObject because it comes across as being more
> pythonic than SQLAlchemy, of course YMMV.
>
> Quite likely .. but it doesn't try to be pythonic, its focused more on
staying consistent with its relational underpinnings. A ^C^V from the
documentation -

DBA Approved

Built to conform to what DBAs demand, including the ability to swap out
generated SQL with hand-optimized statements, full usage of bind parameters
for all literal values, fully transactionalized and batched database writes
using the Unit of Work pattern. All object-relational patterns are designed
around the usage of proper referential integrity, and foreign keys are an
integral part of its usage.
Non-Opinionated

SQLAlchemy places the highest value on not getting in the way of database
and application architecture. Unlike many tools, it *never* "generates"
schemas (not to be confused with issuing user-defined
DDL,
in which it excels) or relies on naming conventions of any kind. SQLAlchemy
supports the widest variety of database and architectural designs as is
reasonably possible.


>
> cheers,
> - steve
> --
> random non tech spiel: http://lonetwin.blogspot.com/
> tech randomness: http://lonehacks.blogspot.com/
> what i'm stumbling into: http://lonetwin.stumbleupon.com/
> ___
> BangPypers mailing list
> BangPypers@python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 

blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene http://twitter.com/_pythonic
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Dhananjay Nene
On Fri, Mar 5, 2010 at 3:58 PM, Noufal Ibrahim  wrote:

> On Fri, Mar 5, 2010 at 3:37 PM, Kenneth Gonsalves 
> wrote:
> > On Friday 05 Mar 2010 3:22:12 pm Dhananjay Nene wrote:
> >> > I might add that I've worked with ORMs almost regularly since 1996 in
> >> > C++,
> >>
> >> Java and Python. SQLAlchemy has probably been the most successful ORM I
> >>  have seen which has managed to retain the balance between relational
> and
> >>  object paradigms (almost everyone else completely throws in the towel
> >>  towards providing an object API around database access).
> >>
> >
> > what about django's orm?
>
> I don't expect that it will hold a candle to SQLAlchemy
>  No composite primary key support -
> http://code.djangoproject.com/ticket/373 is the first thing that comes
> to mind (and one of SQLAlchemy's killer features).
>  I don't think it follows a data mapper pattern.
>  I'm not sure how much reflection it can do.
>
> I agree DjangoORM is unlikely to be as full featured and as comprehensive
as SQLAlchemy.
SQLAlchemy really helps when you want to exercise far more control at the
relational
level (eg. reporting etc.) or at legacy database design mapping. But there
are likely to be many
usecases where SQLAlchemy learning cost may be higher than other ORMs eg.
Django ORM.


>
> --
> ~noufal
> http://nibrahim.net.in
> ___
> BangPypers mailing list
> BangPypers@python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 

blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene http://twitter.com/_pythonic
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread steve

On 03/05/2010 03:37 PM, Kenneth Gonsalves wrote:

On Friday 05 Mar 2010 3:22:12 pm Dhananjay Nene wrote:

 >  I might add that I've worked with ORMs almost regularly since 1996 in
 >  C++,

 Java and Python. SQLAlchemy has probably been the most successful ORM I
  have seen which has managed to retain the balance between relational and
  object paradigms (almost everyone else completely throws in the towel
  towards providing an object API around database access).



what about django's orm?


or SQLObject for that matter. I personally prefer SQLObject because it comes 
across as being more pythonic than SQLAlchemy, of course YMMV.


Dhananjay: I know you've already made up your mind on what to use but I just 
wanted to put this in sideways because it is so awesome (for some apps) -- the 
granddaddy of all db-object abstractions -- http://docs.zope.org/zodb/


Maybe not what you currently need but certainly something useful.

cheers,
- steve
--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Noufal Ibrahim
On Fri, Mar 5, 2010 at 3:37 PM, Kenneth Gonsalves  wrote:
> On Friday 05 Mar 2010 3:22:12 pm Dhananjay Nene wrote:
>> > I might add that I've worked with ORMs almost regularly since 1996 in
>> > C++,
>>
>> Java and Python. SQLAlchemy has probably been the most successful ORM I
>>  have seen which has managed to retain the balance between relational and
>>  object paradigms (almost everyone else completely throws in the towel
>>  towards providing an object API around database access).
>>
>
> what about django's orm?

I don't expect that it will hold a candle to SQLAlchemy
 No composite primary key support -
http://code.djangoproject.com/ticket/373 is the first thing that comes
to mind (and one of SQLAlchemy's killer features).
 I don't think it follows a data mapper pattern.
 I'm not sure how much reflection it can do.
 Also, it's 'part' of a larger project so manpower will be limited as
opposed to SQLAlchemy.

I believe there are projects that are trying to stitch in SQLAlchemy
into Django but I haven't really used the framework so I'm not sure.



-- 
~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Kenneth Gonsalves
On Friday 05 Mar 2010 3:22:12 pm Dhananjay Nene wrote:
> > I might add that I've worked with ORMs almost regularly since 1996 in
> > C++,
> 
> Java and Python. SQLAlchemy has probably been the most successful ORM I
>  have seen which has managed to retain the balance between relational and
>  object paradigms (almost everyone else completely throws in the towel
>  towards providing an object API around database access).
> 

what about django's orm?
-- 
regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS
http://certificate.nrcfoss.au-kbc.org.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Dhananjay Nene
On Fri, Mar 5, 2010 at 3:14 PM, Noufal Ibrahim  wrote:
>
>
>
> Are there any real harcode SQLAlchemy people here on the group? A talk
> on the ORM would be much appreciated I'm sure.
>
>
> I might add that I've worked with ORMs almost regularly since 1996 in C++,
Java and Python. SQLAlchemy has probably been the most successful ORM I have
seen which has managed to retain the balance between relational and object
paradigms (almost everyone else completely throws in the towel towards
providing an object API around database access). However as a result it
takes a little bit more time to learn. If one wants a finer control on the
relational side even while requiring a good object API, look no further than
SQLAlchemy.

> --
> ~noufal
> http://nibrahim.net.in
> ___
> BangPypers mailing list
> BangPypers@python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 

blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene http://twitter.com/_pythonic
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Noufal Ibrahim
On Fri, Mar 5, 2010 at 2:25 PM, Vivek Khurana  wrote:
> On Fri, Mar 5, 2010 at 12:49 PM, Dhananjay Nene
>  wrote:
>> I've decided to go ahead with SQLAlchemy even though that was not my
>> favourite. FWIW I'm just documenting my thoughts :
>>
>> Cons : Why I would've not preferred SQL Alchemy
>> a. Dependency into a large full function package like sqlalchemy which just
>> does a ton of stuff. I didn't need a ton of features .. just needed
>> something basic.
>
>  SQLAlchemy allows you to use only specific components. You can use db
> abstraction while not using ORM at all. So, you still have the freedom
> to use the basics that you need, while never bothering to learn the
> advance stuff :)[..]


Are there any real harcode SQLAlchemy people here on the group? A talk
on the ORM would be much appreciated I'm sure.


-- 
~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-05 Thread Vivek Khurana
On Fri, Mar 5, 2010 at 12:49 PM, Dhananjay Nene
 wrote:
> I've decided to go ahead with SQLAlchemy even though that was not my
> favourite. FWIW I'm just documenting my thoughts :
>
> Cons : Why I would've not preferred SQL Alchemy
> a. Dependency into a large full function package like sqlalchemy which just
> does a ton of stuff. I didn't need a ton of features .. just needed
> something basic.

 SQLAlchemy allows you to use only specific components. You can use db
abstraction while not using ORM at all. So, you still have the freedom
to use the basics that you need, while never bothering to learn the
advance stuff :)

regards
Vivek

-- 
The hidden harmony is better than the obvious!!
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-04 Thread Dhananjay Nene
I've decided to go ahead with SQLAlchemy even though that was not my
favourite. FWIW I'm just documenting my thoughts :

Cons : Why I would've not preferred SQL Alchemy
a. Dependency into a large full function package like sqlalchemy which just
does a ton of stuff. I didn't need a ton of features .. just needed
something basic.
b. I was looking for something that worked at a ODBC/JDBC level abstraction.
Python DBAPI is actually a good candidate but for the fact it doesn't really
work cross database

Pros : Why I decided to go ahead with SQLAlchemy
a. Already use it. So am familiar with it.
b. It is just too slick and polished a product.
c. It does offer relational abstractions. eg. Table (even though the
default, most often used mechanism is with model objects). The entire model
layer I really am not interested in, but SQLAlchemy does give me the
abstractions for table, connections etc.
d. Did not find a widely used competing candidate. Just not sure how widely
used and thus regularly tested adodb for python is - though did not have any
specific qualms against that particular package.

Thanks for all the suggestions. I evaluated them all and the suggestions
were very helpful fodder for the process.

-- 

blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-04 Thread Anand Balachandran Pillai
On Thu, Mar 4, 2010 at 3:51 PM, L.Guruprasad  wrote:

> Hi,
>
> Dhananjay Nene wrote:
> > I need to build some simple relational database access over 2-3 tables in
> a
> > utility program. While it is quite solvable through ORM, the fairly
> limited
> > scope and nature of database access does not require the capabilities of
> a
> > full blown ORM. I use SQLAlchemy in my day job and I like it. Its just
> that
> > I wouldn't want to introduce a dependency on a much bigger toolset
> > especially when a smaller one could suffice.
>

 Write your own :) Always my choice in these cases.


>
>
>

-- 
--Anand
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-04 Thread Pradeep Gowda
On Wed, Mar 3, 2010 at 9:38 PM, Noufal Ibrahim  wrote:
> You could use the sql builder component of sql alchemy and skip the
> orm part. The web.db part of web.py might work as well.

+1 for web.py

Having used web.py for data munging tasks,
I think that web.db is a step up from writing raw sql without going
the whole hog towards ORMs.

+PG
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-04 Thread L.Guruprasad
Hi,

L.Guruprasad wrote:
> Dhananjay Nene wrote:

> One more lightweight database library - Storm (storm.canonical.net) but

Oops, the correct URL for the project is storm.canonical.com

Regards,
Guruprasad
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-04 Thread L.Guruprasad
Hi,

Dhananjay Nene wrote:
> I need to build some simple relational database access over 2-3 tables in a
> utility program. While it is quite solvable through ORM, the fairly limited
> scope and nature of database access does not require the capabilities of a
> full blown ORM. I use SQLAlchemy in my day job and I like it. Its just that
> I wouldn't want to introduce a dependency on a much bigger toolset
> especially when a smaller one could suffice.


One more lightweight database library - Storm (storm.canonical.net) but
it is ORM. It is lightweight when compared to SQLAlchemy.

Regards,
Guruprasad
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread Noufal Ibrahim
You could use the sql builder component of sql alchemy and skip the
orm part. The web.db part of web.py might work as well.

On 3/3/10, Dhananjay Nene  wrote:
> Hi,
>
> On Wed, Mar 3, 2010 at 6:51 PM, steve  wrote:
>
>> Hi,
>>
>> On 03/03/2010 04:36 PM, Dhananjay Nene wrote:
>>
>>> Looking for a simple opensource python database library
>>>
>>> Objectives :
>>> - Should work at a level of abstraction above DB-Api. I should not have
>>> to
>>> change code generally except for changing database configuration
>>> parameters.
>>> - Should be able to write code independent of the database (except where
>>> the
>>> SQL itself was to be different in which case thats beyond the library's
>>> control)
>>> - Should support most reasonably popular databases (I am looking
>>> primarily
>>> for MySQL but at least Postgres, SQL Server and Oracle support will be
>>> useful)
>>>
>>
>> All of that is available in popular ORMs. I prefer SQLObject to
>> SQLAlchemy.
>> Could you elaborate a bit on why an ORM would not be suitable ?
>
>
> I need to build some simple relational database access over 2-3 tables in a
> utility program. While it is quite solvable through ORM, the fairly limited
> scope and nature of database access does not require the capabilities of a
> full blown ORM. I use SQLAlchemy in my day job and I like it. Its just that
> I wouldn't want to introduce a dependency on a much bigger toolset
> especially when a smaller one could suffice.
>
>
>>
>>  - Abstractions should be at a relational level. Thus any ORMs are out of
>>> scope.
>>>
>>>  ehe .. ORM == Object /Relational/ Mapper. What do you mean by
>> "Abstractions should be at a relational level" ?
>
>
> I meant the API should reflect cursors, sqlcommands etc (not objects,
> relationships, inheritance etc.). Having said that I realise "at a
> relational level" was not the most appropriate wording.
>
>
>>
>>  I have found ADODb for Python so far. Looking for additional
>>> recommendations.
>>>
>>>  anydbm ? ( http://docs.python.org/library/anydbm.html ), of course that
>> though is not relational.
>>
>
> Thanks for the tip. It got me thinking whether I could just choose to use it
> instead. Thats still a thought under progress.
>
>
>>
>> A quick google OTOH gives me this:
>>
>> http://wiki.python.org/moin/DbApiModuleComparison
>
>
>
>>
>>
>> Also, the little that i read online, I see that at least in theory all
>> python DBI should follow: http://www.python.org/dev/peps/pep-0249/
>>
>> ...which if is also true in practice takes care of concerns you might have
>> about cross DB API.
>>
>
> Thats not how I have seen it work. For example mysql prepared sql uses "%s"
> whereas others use "?". The database connection parameters are actually
> different between different databases. SQLAlchemy works with and deals with
> these issues. For example it has separate derived classes per database to
> handle some of these variations. Also it uses a connection URI to skip over
> the differences in the connection parameter differences. (The URI is always
> a string - even if the string itself is composed quite differently .. thus
> the code which uses the URI doesn't have to change even when the connection
> parameters change). So essentially what I am looking for (being the lazy
> person I am) is if someone has done this hard work of abstracting away the
> database dbapi implementation differences :)
>
>>
>> cheers,
>> - steve
>>
>> --
>> random non tech spiel: http://lonetwin.blogspot.com/
>> tech randomness: http://lonehacks.blogspot.com/
>> what i'm stumbling into: http://lonetwin.stumbleupon.com/
>>
>
> Thanks
> Dhananjay
>
> --
> 
> blog: http://blog.dhananjaynene.com
> twitter: http://twitter.com/dnene http://twitter.com/_pythonic
> ___
> BangPypers mailing list
> BangPypers@python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>

-- 
Sent from my mobile device

~noufal
http://nibrahim.net.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread Dhananjay Nene
Hi,

On Wed, Mar 3, 2010 at 6:51 PM, steve  wrote:

> Hi,
>
> On 03/03/2010 04:36 PM, Dhananjay Nene wrote:
>
>> Looking for a simple opensource python database library
>>
>> Objectives :
>> - Should work at a level of abstraction above DB-Api. I should not have to
>> change code generally except for changing database configuration
>> parameters.
>> - Should be able to write code independent of the database (except where
>> the
>> SQL itself was to be different in which case thats beyond the library's
>> control)
>> - Should support most reasonably popular databases (I am looking primarily
>> for MySQL but at least Postgres, SQL Server and Oracle support will be
>> useful)
>>
>
> All of that is available in popular ORMs. I prefer SQLObject to SQLAlchemy.
> Could you elaborate a bit on why an ORM would not be suitable ?


I need to build some simple relational database access over 2-3 tables in a
utility program. While it is quite solvable through ORM, the fairly limited
scope and nature of database access does not require the capabilities of a
full blown ORM. I use SQLAlchemy in my day job and I like it. Its just that
I wouldn't want to introduce a dependency on a much bigger toolset
especially when a smaller one could suffice.


>
>  - Abstractions should be at a relational level. Thus any ORMs are out of
>> scope.
>>
>>  ehe .. ORM == Object /Relational/ Mapper. What do you mean by
> "Abstractions should be at a relational level" ?


I meant the API should reflect cursors, sqlcommands etc (not objects,
relationships, inheritance etc.). Having said that I realise "at a
relational level" was not the most appropriate wording.


>
>  I have found ADODb for Python so far. Looking for additional
>> recommendations.
>>
>>  anydbm ? ( http://docs.python.org/library/anydbm.html ), of course that
> though is not relational.
>

Thanks for the tip. It got me thinking whether I could just choose to use it
instead. Thats still a thought under progress.


>
> A quick google OTOH gives me this:
>
> http://wiki.python.org/moin/DbApiModuleComparison



>
>
> Also, the little that i read online, I see that at least in theory all
> python DBI should follow: http://www.python.org/dev/peps/pep-0249/
>
> ...which if is also true in practice takes care of concerns you might have
> about cross DB API.
>

Thats not how I have seen it work. For example mysql prepared sql uses "%s"
whereas others use "?". The database connection parameters are actually
different between different databases. SQLAlchemy works with and deals with
these issues. For example it has separate derived classes per database to
handle some of these variations. Also it uses a connection URI to skip over
the differences in the connection parameter differences. (The URI is always
a string - even if the string itself is composed quite differently .. thus
the code which uses the URI doesn't have to change even when the connection
parameters change). So essentially what I am looking for (being the lazy
person I am) is if someone has done this hard work of abstracting away the
database dbapi implementation differences :)

>
> cheers,
> - steve
>
> --
> random non tech spiel: http://lonetwin.blogspot.com/
> tech randomness: http://lonehacks.blogspot.com/
> what i'm stumbling into: http://lonetwin.stumbleupon.com/
>

Thanks
Dhananjay

-- 

blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene http://twitter.com/_pythonic
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread steve

Hi,
On 03/03/2010 04:36 PM, Dhananjay Nene wrote:

Looking for a simple opensource python database library

Objectives :
- Should work at a level of abstraction above DB-Api. I should not have to
change code generally except for changing database configuration
parameters.
- Should be able to write code independent of the database (except where the
SQL itself was to be different in which case thats beyond the library's
control)
- Should support most reasonably popular databases (I am looking primarily
for MySQL but at least Postgres, SQL Server and Oracle support will be
useful)


All of that is available in popular ORMs. I prefer SQLObject to SQLAlchemy. 
Could you elaborate a bit on why an ORM would not be suitable ?



- Abstractions should be at a relational level. Thus any ORMs are out of
scope.

ehe .. ORM == Object /Relational/ Mapper. What do you mean by "Abstractions 
should be at a relational level" ?



I have found ADODb for Python so far. Looking for additional
recommendations.

anydbm ? ( http://docs.python.org/library/anydbm.html ), of course that though 
is not relational.


A quick google OTOH gives me this:

http://wiki.python.org/moin/DbApiModuleComparison

Also, the little that i read online, I see that at least in theory all python 
DBI should follow: http://www.python.org/dev/peps/pep-0249/


...which if is also true in practice takes care of concerns you might have about 
cross DB API.


cheers,
- steve

--
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread S.Ramaswamy
>
> Am explicitly looking for lightweight libraries, not heavy weight ORM
> solutions.
>
> AntiORM: http://furius.ca/antiorm/ . Not sure if this an active project.

Ramaswamy
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread kausikram krishnasayee
>
> there is a light weight library called Autumn, but again its ORM, but
> atleast its much lighter than alchemy.
>
http://autumn-orm.org/


-- 
Kausikram Krishnasayee
Company: http://silverstripesoftware.com | Webpage: kausikram.net | Blog:
blog.kausikram.net | Twitter: http://twitter.com/kausikram | Email:
kausik...@gmail.com | Mobile: +91 9884246490
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread kausikram krishnasayee
>
> >  Look at sqlalchemy. It will satisfy all your requirements.
> >
>
> Am explicitly looking for lightweight libraries, not heavy weight ORM
> solutions.


there is a light weight library called Autumn, but again its ORM, but
atleast its much lighter than alchemy.

-- 
Kausikram Krishnasayee
Company: http://silverstripesoftware.com | Webpage: kausikram.net | Blog:
blog.kausikram.net | Twitter: http://twitter.com/kausikram | Email:
kausik...@gmail.com | Mobile: +91 9884246490
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread Dhananjay Nene
On Wed, Mar 3, 2010 at 5:53 PM, Vivek Khurana wrote:

> On Wed, Mar 3, 2010 at 4:36 PM, Dhananjay Nene 
> wrote:
> > Looking for a simple opensource python database library
> >
> > Objectives :
> > - Should work at a level of abstraction above DB-Api. I should not have
> to
> > change code generally except for changing database configuration
> > parameters.
> > - Should be able to write code independent of the database (except where
> the
> > SQL itself was to be different in which case thats beyond the library's
> > control)
> > - Should support most reasonably popular databases (I am looking
> primarily
> > for MySQL but at least Postgres, SQL Server and Oracle support will be
> > useful)
> > - Abstractions should be at a relational level. Thus any ORMs are out of
> > scope.
> >
> > I have found ADODb for Python so far. Looking for additional
> > recommendations.
>
>  Look at sqlalchemy. It will satisfy all your requirements.
>

Am explicitly looking for lightweight libraries, not heavy weight ORM
solutions.

>
> regards
> Vivek
>
> --
> The hidden harmony is better than the obvious!!
> ___
> BangPypers mailing list
> BangPypers@python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 

blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene http://twitter.com/_pythonic
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread Vivek Khurana
On Wed, Mar 3, 2010 at 4:36 PM, Dhananjay Nene  wrote:
> Looking for a simple opensource python database library
>
> Objectives :
> - Should work at a level of abstraction above DB-Api. I should not have to
> change code generally except for changing database configuration
> parameters.
> - Should be able to write code independent of the database (except where the
> SQL itself was to be different in which case thats beyond the library's
> control)
> - Should support most reasonably popular databases (I am looking primarily
> for MySQL but at least Postgres, SQL Server and Oracle support will be
> useful)
> - Abstractions should be at a relational level. Thus any ORMs are out of
> scope.
>
> I have found ADODb for Python so far. Looking for additional
> recommendations.

 Look at sqlalchemy. It will satisfy all your requirements.

regards
Vivek

-- 
The hidden harmony is better than the obvious!!
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread Dhananjay Nene
On Wed, Mar 3, 2010 at 5:49 PM, Dhananjay Nene wrote:

> On Wed, Mar 3, 2010 at 4:44 PM, Kenneth Gonsalves wrote:
>
>> On Wednesday 03 Mar 2010 4:36:10 pm Dhananjay Nene wrote:
>> > Looking for a simple opensource python database library
>> >
>> I was under the impression that python does not recommend a db library for
>> all
>> databases and rests content with giving a general spec which people can
>> use
>> for implementing particular libraries (like pyscopg for postgresql and
>> mysqldb
>> for mysql)
>>
>
> Python has a DB API spec which is implemented by different database
> vendors. However the spec is not implemented the same way by different
> driver authors leading to code having to change when switching to a
> different database. Precisely the reason why there is a space for someone to
> write a generic db library which can work through the differences across
> different drivers (ie. DB API implementations). Most ORMs such as SQLAlchemy
> and django already have such capabilities built in - but I am looking for a
> relatively thin library over DBAPI. I did find one such implementation in
> ADOdb which essentially wraps mysqldb or psygogb etc. Looking for more
> options if such exist.
>
> I am not unclear if at all what python recommending a db library would mean
> in this context.
>

I meant "I am *not clear* if at all ... "


> --
>>
>> regards
>> Kenneth Gonsalves
>> Senior Associate
>> NRC-FOSS
>> http://certificate.nrcfoss.au-kbc.org.in
>> ___
>> BangPypers mailing list
>> BangPypers@python.org
>> http://mail.python.org/mailman/listinfo/bangpypers
>>
>
>
>
> --
> 
> blog: http://blog.dhananjaynene.com
> twitter: http://twitter.com/dnene http://twitter.com/_pythonic
>
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread Dhananjay Nene
On Wed, Mar 3, 2010 at 4:44 PM, Kenneth Gonsalves  wrote:

> On Wednesday 03 Mar 2010 4:36:10 pm Dhananjay Nene wrote:
> > Looking for a simple opensource python database library
> >
> I was under the impression that python does not recommend a db library for
> all
> databases and rests content with giving a general spec which people can use
> for implementing particular libraries (like pyscopg for postgresql and
> mysqldb
> for mysql)
>

Python has a DB API spec which is implemented by different database vendors.
However the spec is not implemented the same way by different driver authors
leading to code having to change when switching to a different database.
Precisely the reason why there is a space for someone to write a generic db
library which can work through the differences across different drivers (ie.
DB API implementations). Most ORMs such as SQLAlchemy and django already
have such capabilities built in - but I am looking for a relatively thin
library over DBAPI. I did find one such implementation in ADOdb which
essentially wraps mysqldb or psygogb etc. Looking for more options if such
exist.

I am not unclear if at all what python recommending a db library would mean
in this context.

--
> regards
> Kenneth Gonsalves
> Senior Associate
> NRC-FOSS
> http://certificate.nrcfoss.au-kbc.org.in
> ___
> BangPypers mailing list
> BangPypers@python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>



-- 

blog: http://blog.dhananjaynene.com
twitter: http://twitter.com/dnene http://twitter.com/_pythonic
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers


Re: [BangPypers] Simple python database library

2010-03-03 Thread Kenneth Gonsalves
On Wednesday 03 Mar 2010 4:36:10 pm Dhananjay Nene wrote:
> Looking for a simple opensource python database library
> 
I was under the impression that python does not recommend a db library for all 
databases and rests content with giving a general spec which people can use 
for implementing particular libraries (like pyscopg for postgresql and mysqldb 
for mysql)
-- 
regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS
http://certificate.nrcfoss.au-kbc.org.in
___
BangPypers mailing list
BangPypers@python.org
http://mail.python.org/mailman/listinfo/bangpypers