F/OSS Flat-File Database? 702
Leemeng writes "I'm looking for a simple, free, and F/OSS flat-file database program. I'm storing info about Wi-Fi access points that I come across, maybe 8-9 fields per entry. I've outgrown Notepad. This info is for my own reference only; it is not going on a Web server. Googling was unhelpful, with results skewed towards SQL, Access (MS), and Oracle, all of which would be overkill for my purposes. My criteria are: it must be simple, F/OSS, must work in Windows Vista, preferably use a portable format, must not be an online app, and must not require Java. Does such a beast exist?"
Python? (Score:5, Informative)
Can't be Java... well, how about Python?
Here is [ideaspike.com] a completely free (PD, not GPL-style "you're free to do as we tell you") database engine that will do what you have described thus far.
The database engine is about 19k bytes (not a typo), has no dependencies (other than Python itself), supports a useful subset of SQL so you can actually create flexible queries that produce well-sorted results from your database, and it works everywhere Python does, which is to say, it works pretty much everywhere. It's just as happy operating on a command line as it is on a web server. The results (the actual databases) are 100% portable from OS to OS. I use it on various linuxes, OS X, and Windows for tasks very similar to yours.
Comes with tutorial examples, sample databases and extensive docs. In a 13k (not a typo) archive.
Err ... (Score:4, Informative)
Otherwise what's wrong with a simple database like MySQL or PostgreSQL on your computer?
OOO? (Score:5, Informative)
sqlite (Score:5, Informative)
I find it amazing that you didn't come across it in Googling...
SQLite (Score:5, Informative)
There are GUI clients that work fine for this sort of thing, SQL is simple for doing basic things. One file, one database.
SQLite (Score:2, Informative)
C based, no client-server. Very small, quite fast. And a very permissive license.
sqlite of course (Score:2, Informative)
http://www.sqlite.org/ [sqlite.org]
Use it all the time for everthing from trivial databases to several 10s of megabytes. Since query's can be entered on the command line it's quite simple to write an ascii results grabber.
Re:OOO? Calc and Base (Score:2, Informative)
Spreadsheet (Score:4, Informative)
SQLIte or BDB (Score:4, Informative)
BDB is *not* a relational database though, it's just a storage/indexing engine, which is used most notably by MySQL as a backend. SQLite on the other hand is a full file-based RDBMS with a small runtime, so it might be a bit of overkill for you in this particular scenario.
But both of them run on Windows, Linux and the BSDs, so you won't have portability problems. And most languages have bindings for them.
Re:SQLite (Score:3, Informative)
GDBM (Score:5, Informative)
If that doesn't satisfy your need, take a look at Berkley DB. It offers a more sophisticated interface than DBM.
Re:SQLite (Score:3, Informative)
How about a spreadsheet? (Score:3, Informative)
I recently moved my collection of serial numbers out of a defunct proprietary program and into a spreadsheet - couldn't be happier.
Re:Err ... (Score:3, Informative)
For example, if you ask it to read and write this:
May 20,5/20,1.000
you get this:
20-May,20-May,1
That might be okay if those were really two dates and a number, but I was never asked if they were. (OOO Calc is just as bad: it asks, and by default modifies the data).
Re:OOO? Calc and Base (Score:3, Informative)
I was using it about a year ago and I found it buggy and hard to use. I was using it to access
PostgreSQL.
I like the other parts of OpenOffice that I use, Write, Calc, Draw.
Of course, I have not had time to look at it since then.
Re:sqlite (Score:5, Informative)
https://addons.mozilla.org/en-US/firefox/addon/5817 [mozilla.org]
Re:Python comes with SQLite (Score:5, Informative)
import sqlite3
mydb = sqlite3.connect('sample.db')
mydb.execute("create table contacts (fname text, lname text, email text)")
mydb.execute("insert into contacts values('Spooky','Monster','spook@spammity.spam')")
mydb.commit()
mydb.close()
You can then use the free and open SQLite database browser [sourceforge.net] to browse, edit, and print your table.
You may think you're keeping it simple by using a flat file, but you're really not. It may be somewhat easier to manually edit, but it's also easier to screw up, and I've never heard of one with the ability to undo changes.
Try Metakit (Score:4, Informative)
sed, awk, and grep... (Score:4, Informative)
Re:Err ... (Score:4, Informative)
Smith,John,703-555-5555
into
Smith,John,-5407
The latter being 703 minus 555 minus 5555.
when importing a CSV file. No joke. There are ways around it, but the default is pretty braindead.
Re:Python? (Score:3, Informative)
No, it isn't just that. It is used to show that what you are quoting is verbatim, for instance in cases where an assertion is unique, questionable, or worded unusually. This also works for obvious spelling errors, of course.
Consider an xml-based db (Score:3, Informative)
eXist [sourceforge.net] is one alternative; while I haven't personally used it the home page indicates it's a fairly capable project.
Sedna [ispras.ru] also appears to be feature-rich.
There was a similar discussion on Slashdot specifically with reference to XML databases, here [slashdot.org].
Happy hunting -
Re:Python? (Score:5, Informative)
That's all I have for ya, offhand. ;-)
Re:Python? (Score:5, Informative)
Re:Python? (Score:2, Informative)
Re:No Java? (Score:1, Informative)
Re:Python? (Score:3, Informative)
Yes, that's pretty much what I said, only with more details. What's your point?
PCFile (Score:3, Informative)
http://www.umich.edu/~archive/msdos/database/pcfile/ [umich.edu]
Mind you, you'll have to toss Jim Button $10 as it's shareware!
It is still a database system but.. (Score:3, Informative)
Otherwise, I agree with most posters who say just use a simple text and/or xml file if the data volume is relatively small. That should be more than enough!
SixD
Requirements (Score:3, Informative)
Re:OOO? Calc and Base (Score:3, Informative)
So really it's 3 main problems are being buggy, hard to use, slow* and totally bloated
Actually it's not half as buggy as it was a few releases back - I can actually use it now to fill in a form without it crashing. Just tried opening a windows XP made odb file in Ubuntu (OOo 2.4) and it's slow as hell and bugged to death, so you might add portability to that list of main problems.
[Yes I've filed bug reports].
---
* slow for searching, takes about 2 mins to do a straight text search on 500 records.
Re:Python? (Score:5, Informative)
Why are we trying to promote python? (Score:5, Informative)
He doesn't need python. He just needs a database. He can download a precompiled binary for windows [sqlite.org] that allows one to work with the database at the command line [sqlite.org]. Python is not necessary.
And if the command line is too much, as others have noted there is already a convenient firefox extension [mozilla.org] for graphically interacting with a sqlite database.
Re:Python? (Score:1, Informative)
- mostly ACID compliant (i.e. transactions w/rollback)
- standard SQL (or close enough to it; de facto, there's no such thing), including joins
- indexes and primary key generation
- concurrent use by multiple processes w/locking
- extremely cross-platform, including many OSs and most languages
- a great command-line editing tool
I'm not surprised that most of the posts here site SQLite, because it is great. And it's public domain, so it can be used by anyone, anywhere, for any commercial or private purpose.
Having a db that is human readable can be a good thing--and a bad thing (anyone can change its contents manually?). Being small is a good thing. But even if you are doing embedded programing, is 800k such a burden that you would give up this feature set?
Re:Python comes with SQLite (What about cPickle?) (Score:2, Informative)
e.g.
import cPickle
class Record:
def __init__(self, fname, lname, email):
self.fname = fname
self.lname = lname
self.email = email
# ---
# Write out the data
records = list()
records.append(Record("John", "Doe", "jd@email.com"))
output = open("records.db", "wb")
cPickle.dump(records, output)
output.close()
# ---
# Read back the data
inputFile = open("records.db", "rb")
data = cPickle.load(inputFile)
for record in data:
print record.fname, record.lname, record.email
inputFile.close()
Berkeley? (Score:3, Informative)
Re:Python? (Score:4, Informative)
Re:Python? (Score:5, Informative)
Re:Python? (Score:3, Informative)
So, the freedom I want is the freedom to license my code as I see fit, while still making use of the high quality of free software (libraries) and supporting them with bugfixes, patches, and another distribution point. With the GPL, you're really only free to make more GPL software. Part of freedom is allowing people to do things you don't like and/or don't agree with. That part seems to have been lost here.
I've been moving my own personal released code to BSD lately, and my professional code, well, is largely internal apps for my employer.
Re:Python? (Score:3, Informative)
It's not just you. Python exposes the locking mechanisms of the underlying platform and doesn't try to abstract any further than that.
If you want simple, portable locking, use this recipe from ASPN:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203 [activestate.com]
Re:Python comes with SQLite (Score:3, Informative)
The sqlite3 module as shipped with Leopard says that it supports question mark substitution, so his example would be better written like:
BTW, the same could be written for PostgreSQL like:
Hopefully sqlite3 will get the same standard substitution in the future, but at least it is possible to do it safely today.
Spectate Swamp Desktop Search (Score:3, Informative)
Re:Err ... (Score:4, Informative)
That's what I do in Excel 2003, anyway, to stop it from stripping the leading zeros in SSNs.
Re:Python? (Score:3, Informative)
Wait a sec... That's not reliability; that's confidence. Reliability is a performance metric; confidence is not. I suspect — looking at some relevant SQLite pages [sqlite.org] — that dbtext might actually be more reliable, because my bug list is at zero and has never moved off zero since release, though it is used thousands of times every day just in my own venues. I have no idea how much others use it, though. ;-)
Re:Python comes with SQLite (Score:3, Informative)
Actually, the Python SQLite adapter supports the standard Python DB API (PEP 249 [python.org]), and so you can just follow its recommendations (which includes using placeholders).
Re:Try Metakit (Score:3, Informative)
For those not familiar with metakit,
it straddles a very interesting (to me at least)
line between "some csv files i threw together" and "full on sql db" in terms of it's storage
and query semantics, while at the same time being
a flat file like sqllite.
And it really deserves to be better known from a
theoretical standpoint, in how it structures the
data... especially some of the more interesting
applications it's been put to, such as a
graph-theory style database written as a layer on
top of metakit (can't remember the name).
Also, it's bound to a number of languages (python
and tcl are the only ones i've played with).
Perhaps if there weren't SO MANY responses saying
"sqllite" over and over, your response would have
gotten the informative rating it needs.
Re:Python? (Score:4, Informative)
Other than that the dbtxt looks very nice indeed.
Re:Python? (Score:4, Informative)
Re:Python? (Score:2, Informative)
(God, I don't know why I keep reading Slashot comments, I really don't; but I guess an eleven year habit habit is hard to break...)
Let's start with the obvious, shall we?
That's the whole bloody point, except that instead of that second 'GPL' you should be saying 'copyleft'. The GPL and other copyleft licenses are specifically designed to prevent covered code from being used in non-copyleft projects. It's a basic design principal!
You still have that freedom, you just don't have the freedom to relicense other people's code. Not even the BSD style licenses allow you this so-called 'freedom'.
I added that [other] above to emphasize my point - that it's other people's code that you want to use. You didn't write it, so you can have no expectations that you should be allowed to use it. In this case, these other folks have decided to let you use the code that they have written, but only under their terms. You either have to agree to these terms, rewrite the library so that you can release the code under your own license, or bitch and moan about how unfair it is that you can't just do whatever the fuck you want with other people's hard work (you appear to have chosen the latter).
Freedom does not mean being able to do whatever the fuck you want to do - that's anarchy, and it doesn't work. Freedom is having a set of universally recognized rights, and the means to enforce those rights on those that seek to trespass against them. Like copyright - it gives you (and only you) the freedom to do whatever you like with your work, and the power to prevent other people from doing whatever they like with your work. In this instance, QuasiEvil, you are the other people.
Until everyone can be trusted to just 'do the right thing' (whatever the hell that is), freedom will always mean trading some small convenience (like the ability to walk into my neighbours house and take his stuff) for a larger convenience (like not having people walk into my house and taking my stuff). The GPL is no different.
The truth is that is is possible to circumvent the GPL (i.e. to mix GPL and non-GPL code in the same project) - you just have to ensure that, when you are running the non-GPL code, the CPU's instruction pointer never refers to a block of GPL-covered code. You can achieve this by using networking and/or message passing techniques to pass information from one module to another, without requiring your non-GPL module to be linked with the GPL module. Yes, it's a fuck around, but one again we are simply trading a small convenience for a larger one.
This post is from someone who releases code under the GPL to everyone in this forum that bashes the GPL at every opportunity (like the first poster). I've made my decision and I'm comfortable with it, so you might as well just shut the fuck up - you're bitching about something that no-one has any intention of changing.
Re:Python? (Score:3, Informative)
Metakit (Score:2, Informative)
Open source java databases (Score:2, Informative)
I have also heard good things about H2 and apache derby. These have been especially valuable for embedded apps