The best way would be sqlite. It's certainly not overkill. If you don't know what sqlite is, look here: http://www.sqlite.org/about.html
It's a very easy read... the way they describe it: Think of SQLite not as a replacement for Oracle <http://www.oracle.com/database/index.html> but as a replacement for fopen() <http://man.he.net/man3/fopen> so yea, you're doing it right. I wouldn't bother storing it in ram, since as you said it's not a lot of data, which means that disk access times will be minimal as well. you could try putting the data in your session object, but that would likely be stored on disk as well, so better leave it as sqlite in that case. The other option is redis, but if this is only one machine, it would be pointless for that.. in other words, you have a small file, and you are complaining about storing it on disk? why? too much disk space? too much work? Does it make that much of a difference if it takes 15ms to access or 1ms? On Monday, September 8, 2014 3:59:39 AM UTC-7, Niels Jensen wrote: > > Hi All, > > I've just started learning Python and have a decent understanding on the > core elements. Most of my programming experience prior to Python was > vb.net, which I'd use it to put together some simple applications that > would help me automate some tasks at work (I'm a sysadmin). I wanted to > step away from a single platform and look at app development that didn't > depend on the OS that was used. > > So I developed my first Python application which uses Paramiko to SFTP a > DNS config file from my enterprise's central DNS servers. It then parses > the file and pulls out the zones and relevant data that's then stored in a > list of tupples. > > I then thought wouldn't it be great to display these zones in a nice > tabular format that can be edited. Did some research and found web2py. > I've since run throuth the Overview section of the docs and built my first > Web2Py App. Instead of saving the information to a list of tupples, it now > saves it to a SQLite DB (which it truncates each time the config file is > fetched). I can then use SQLFORM.grid to generate a nice looking table in > my app. I've not got to the editing part yet, but that will come in time. > > The issue I have with the above method however is that is seems a little > overkill to use a fully functional db. In vb.net, I'd create a datatable > in memory and manipulate the table before writing the changes back to the > config file when told to do so. As any of my colleagues may change the DNS > config file at any time, loading the config file as required into RAM makes > more sense to me than loading it into a database. > I looked at how I might do this in Python and it seems that I can load a > SQLite db into memory or the user's session but from what I can see in > various searches, people are saying that this may not be a good idea. > > So I'm just wondering what would be the best way to do this? Any advice? > > Thanks > Niels > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.