[CODE4LIB] Simple Flexible ILS written in Django

2010-10-24 Thread Elliot Hallmark
Re: simple, flexible ILS for small library

hello all,

Just wanted to mention that I did decide to code an ILS for a book
sharing library. Tweaking conventional ILS or bartering software would
not accomplish what I want, and programatically the problem isn't very
difficult.  Modern programming frameworks make building something like
this out very quick.

The program currently has all the basic functionality I need including
user front ends for checkin/out, adding new items from downloaded MARC
records and a powerful backend for fixing anything that a user
(librarian) did accidentally or shouldnt have permission to easily do.

I am doing this in Django because Python is awesome.  There are more
defined reasons people use Django, but I will admit that I would never
have done any substantial programming if I had not found python.
Everytime a project comes up, python just happens to have a set of
tools that go well beyond what I need from them.

The code is available for anyone:

I'll gladly explain/document more if anyone cares to hear

-Elliot Hallmark

PS: I am now using a more clean email address.  Previously I was using
an address that I dont mind getting a little spammy because I was just
poking around.  I am the same person as offonoffoffonoff at gmail.

Re: [CODE4LIB] Django

2010-10-27 Thread Elliot Hallmark
Congratulations on discovering python.  It will serve you much better
than php, or any other scripting language.

Skipping to the punch-line, you should dive into python before you
dive in django:


You will have a very much more easy time if you learn how to debug a
script in the shell (rather than running a program endless times with
different print statements), use introspection, slice lists and basic

I also learned php first, inorder to add a shopping cart onto my
friend's website.  However, I switched to this other scripting
language, python, because it could do things php cant.  For instance,
my first project in python involved capturing keyboard input before
windows heard about it.  Then I kept discovering amazing things python
can do that php cant.

I helped write a non-sequential optical ray tracer in python.  When it
needed to be faster there were several libraries for writing C code
directly in a pythonic syntax.  Python has hooks into everything, like
optical character recognition, electronic music
sequeuencing/generation, serial port i/o.  Gnucash, an opensource
quicken like accounting package, has python bindings.  when there were
no decent free unRARing programs available, I discovered python could
do it easily. And if you decide you need to use the parallel vector
processeors of your nvida graphic card's onboard multicore GPU, there
is a package for that: PyCuda.

And they all weave together seamlessly.  Django could use PyCuda in a
custom form validation method to determine if an archived folder of
pictures you have uploaded has an image of a car with a decipherable
licence plate.

Anyways, python is great, and by extension I expect Django is also
(just learning it myself).

good luck,

Re: [CODE4LIB] Django

2010-10-27 Thread Elliot Hallmark
  For instance,
 my first project in python involved capturing keyboard input before
 windows heard about it.  Then I kept discovering amazing things python
 can do that php cant.

 For instance, PHP can do this fine. Was there something in particular
 you're thinking of that PHP can't do?

Yes, It was irresponsible for me to make a blanket statement like that
without having very much experience with php.  I used php to make a
website from data in a database. Other things beyond that seemed
awkward, difficult, or impossible from what I knew. python immediately
jumped out to me as a tool more suited to these tasks.

I guess it was just the way I came across things, my own personal
history.  From my experience, it seemed php was a server side
scripting language.  Can you write a php script that gets key presses
and doesn't pass them along to windows to process?  I thought the OS
would have to process the key press, pass it along to the php server
and then php could process it. (pyhook)

Also, how would you go about using a GPU from a graphics card in php?
(python cuda in google gives many results)

Has anyone written a scientific computing package along the lines of
matlab in php (scipy, numpy, matplotlib)?  Or a non-sequential optical

if you wanted to write a web interface for GNU cash or another well
established accounting program, could you do it? (GNU cash has python
bindings to its internal functions,  I believe no other scripting
language can access the things python can.  This is the case with many
programs, python bindings but nada for php).

please feel free to point me to the php equivilants of pyhook, pycuda,
scipy, numpy and some examples of widely used programs with php

  For the sophisticated hacker, most languages can
 be tweaked to solve almost any problem.

I am sure that is true. Though, I feel many for many tasks php would
require quite a bit more tweaking than python, with much less
community support behind it (I mean, google comes up with fewer
helpful links to the problems I sited above).

Maybe Php can accomplish many things by calling external programs.  Is
that the case?  and then are you limited to whatever commandline
options the external program has?

My impression, based on very little experience with php, is that if
you asked in a forum about using php for advanced scientific
computing, or writing music generation/sequencing software,
knowledgeable folks would first ask: are you sure you want to do this
in php?  how about java or python?

That said, php may be superior for generating websites from databases.
 That is why it is difficult to find help through google about php,
because all the searches turn up websites generated by php, not
written about it.

I'll be more careful about my praising of python over other scripting
languages in the future.


Re: [CODE4LIB] Let's go somewhere [was PHP vs. Python...]

2010-10-30 Thread Elliot Hallmark
 What's wrong with the library world developing its own domain language?


We're already in a world of pain because we have our own data formats and
ways of dealing with them, all of which have basically stood idle while 30
years of advances computer science and information architecture have
by us with a giant WHOOSHing sound.

Having a bunch of non-experts design and implement a language that's
destined from the outset to be stuck in a tiny little ghetto of the
programming world is a guaranteed way to live with half- or un-supported
code, no decent libraries, and yet another legacy of pain we'd have to

 I'm not picking on programming in particular. It's a dumb-ass move  EVERY
time a library is presented with a problem for which there are experts and
decades of research literature, and it choses to ignore all of that and
decide to throw a committee of librarians (or whomever else happens to be
the building at the time) at it based on the vague idea that librarians
just that much smarter (or cheaper) than everyone else (I'm looking at

then Peter said:

My hope is that some among us would just undertake these problems ourselves.
  Outside of the realm of the libraries and the limiting mindsets many of us
 work in.  We've all got ideas.  Fire up vi and get busy and make something
 happen, like a library domain-specific language.  Start fresh.  There is
 nothing wrong with that.  What's wrong is how the library community goes
 about such things.

Yes, he hit the nail square on the head.  But i think his point is that a
huge community of really intelligent people (specifically, not librarians,
but generally, not just every isolated pobody with a hair-brain scheme) hit
vi and got busy a long time ago.

What do you expect to gain from the huge PIA you propose at the cost of
sacrificing everything a HUGE community of skilled programmers offers?

have fun.


[CODE4LIB] distributed library alpha server up, feedback welcome

2011-04-23 Thread Elliot Hallmark

It was at the end of last year that I came here saying I was writing an open
source ILS for a distributed (book sharing) library.  While I had lots of
enthusiasm and time for it at the time, our development computer didn't have
the capacity to run a solr based discovery front end.  Even though the back
end was ready for feedback (though still very alpha), I dallied in posting
the IP because there was no discovery layer.

In the interest of moving forward, and since a complex discovery layer may
not be necessary for a while (not for  100 books), here is the IP.  Please
check it out and give feed back.  Play around with whatever, this data isn't

If this IP changes, I'll let y'all know on this thread.

Soon I would like to use this system at our private alternative
schoolhttp://www.clearviewsudburyschool.orgin hopes that it would
facilitate folks letting us use their excellent
books, since they would be lending them, not donating them.  Having a
database keeping track of who owns the books would give a little peace of
mind.  in the future, setting up a network of libraries would be easy.


1. This is a distributed library, where a book enters the system through a
primal loan (from owner to library), and is due back at some point.  The
book or item can be further lent to a regular borrower, or to another
library (which inherits lending privilages).  extending lending privilages
must be done through the administrative back end, so it wouldn't happen

2. The discovery layer is severely crippled because I don't want to write
a indexer for our MARC records unless it becomes necessary (ie, better
searching is needed but writing a VuFind driver or integrating with Kochief
isn't yet feasible).  All books entered in this system also have MARC
records associated with them, so a solr or other front end can be added

3. If you'd like to try uploading a MARC record, email it to me and I'll put
it up for anyone to enter through the cataloging app.

4. This is written in django.  Hooray for python!

5. This is not at all perfect yet.  here is my todolist so far (please add
to it):

when checking a book out, do not allow a due date later than the current
lease on the book.
subtitle, does this really need to be limited to 100 characters?
create an end of day script that:
   sends emails to books that are due back soon
   sends emails to books that are overdue
activate fines model and add an Fine.calcuate() method
make a legit zipcode field. current one accepts 5 digits

thanks for reading,

Re: [CODE4LIB] distributed library alpha server up, feedback welcome

2011-04-25 Thread Elliot Hallmark

 Another thing that differentiates you from other small libraries
 attempting this sort of thing is your contacting of this list. Most of
 the readers here are used to big-data problems, where they're trying
 to make sense of the storage, maintenance, and display of millions of
 records, so it's a bit of work to scale the mind down to a situation
 such as yours.

True, my issues are completely different from those usually tackled here.
 But, still, some folks here may potentially be interested in the
capabilities this circulation system offers.  Also, y'all know what problems
can arise when thousands upon thousands of records accumulate, and I have no
idea what may go awry with this as it handles unexpected cases.  So, you
might have insights for me.

related to indexing records in the app:

Yes, as an intermediate between a title list and a solr catalog (VuFind,
Kochief), I could write a quick app that stores subject, author and pub date
from the MARC records and then do search with icontains queries.  That would
be then next biggish step.


Django is not a CMS, but a package of python libraries one would use to
write a CMS.  The poor use of the database would be my own fault, because I
write the queries (or python code which is compiled into SQL).  For
instance, every blog with a headline that contains (case sensitive)
 Lennon is executed with

read more here if you like:

Also, any host will support php, but only *most* of them support django at
the level of the cheapest possible plan.  At the second cheapest level,
pretty much any established host supports django.

University of Texas is switching to django for all of their internal DB
stuff like accounting and payroll for reasons that are obvious to anyone who
has used django.

Re: [CODE4LIB] distributed library alpha server up, feedback welcome

2011-04-25 Thread Elliot Hallmark
Interesting point about the checkout history.  Not displaying it
automatically is probably a good idea.  I wouldn't drop that info though, or
obscure it in the DB.

Re: [CODE4LIB] distributed library alpha server up, feedback welcome

2011-04-25 Thread Elliot Hallmark
@brice:  good point, its on the list now


 University of Texas is switching to django for all of their internal DB
 stuff like accounting and payroll for reasons that are obvious to anyone
 has used django.

Huh?  Django may be great, but this seems highly unlikely.

I may very well not have the correct information. But (just in theory) it
would be the work of an hour to map any database schema into django and then
use the python shell to navigate your database instead of raw sql.  HUGE
improvement right there (human readable inner joins, simple 'or'
relationships in queries, and on and on).  as an added bonus, all the data
you pull out is then immediately accessible to other python functions and

I'm not saying they are writing a pretty web interface.

Also, I could have been misinformed or misunderstood the UT austin CS
student I heard this from.