I am seeking advocates of the Python programming language to take a few minutes
and help point the way for me towards their enlightenment. See further below
for what sort of help I had in mind.
I'm now wanting to become an effective programmer of the Python language
quickly, where I currently have no actual experience with *using* it
specifically (but having just done some Python-specific study including a 3-hr
OSCON tutorial), though I do consider myself an expert with dynamic programming
languages in the abstract, and with sufficiently similar languages such as Perl.
I thought that the best way to do this would be to actually try writing a real
project in Python, and not simply go through tutorials and write code that is
ultimately not going to be used for anything.
If possible I'd like to complete this, or at least a working subset, within the
next 7-10 days. My initial reason for doing this is to assist a job prospect,
though I would like to know Python anyway.
I would be writing it in Python 3 specifically, not Python 2.
Specifically, the project I had in mind was to take my Perl module Set::Relation
(specifically, the immutable-object version) and translate it into a
functionally equivalent Python library. This module implements the relational
model of data (sort of what SQL does); it provides an object class to represent
a relation (rowset/table) and methods for all the relational operators such as
join and projection and summarize and so on. The module treats a plain Perl
hash as a relational tuple and the Python version presumably would use a plain
Python dictionary. The project size is on the order of about 3500 lines of
library source code plus documentation and tests. I wrote it from scratch
earlier this year and its design/coding style should reflect "modern Perl" best
practices as I see them. See http://search.cpan.org/dist/Set-Relation/
for the main urls of the Perl version.
The point of the module is to let you do some kinds of data manipulation or
analysis that you might otherwise shunt to a SQL database, without the need for
the separate database; see the documentation for suggested use cases.
This effort should not be one-sided. I would like to think that this
translation effort would also benefit the Python community in general, as I
would like to think the existing version benefits the Perl community. In a
large respect I don't believe there is any Python functionality like what I am
offering (as there wasn't for Perl), though that isn't entirely true.
There is some prior art in another project called "Dee" ("makes Python
relational") which predates my effort, but seems less comprehensive; see
to read about and download that one. I don't know
of any other relevant prior art in Python.
I do not need pointers to generic Python language references or tutorials, which
Google finds easily enough, and I recognize/assume that http://python.org/
good place to start for finding links to other things. I also don't need to be
told about language basics such as Python being whitespace/indent-sensitive,
tending to be more imperative than functional, and not using variable sigils.
What I would appreciate from local Python advocates is specific suggestions
about what forums or resources I should look to or things I should do in order
to try and become an effective contributor to the Python community. I'm
particularly interested in knowing about best practices for and examples of
making a Python library intended for being used by other people as a
self-contained open-source project. I would like to know what is the Python
community's analogy to the Perl community's CPAN, if there is such a thing, as
well as best practices regarding formats for packaging and testing and
documenting and so on.
I would like to jump in the deep end and make my first Python project with the
kind of best practices and community conformity that an experienced community
member would, in so much as is possible. For example, how I should adapt the
project's API so that as a Python library it has the idioms that Python users
would expect, much as the existing version uses Perl idioms (such as $_ for the
implicit input to closure arguments like 'map','grep',etc do) where appropriate.
Also for example some knowledge of common gotchas.
I prefer to have a framework in place from the start so I can regularly say
'make test' and know that what I've just added over time still lets the project
compile without error and that some tests haven't regressed.
Part of what I would be doing is learning Python analogies for not-quite-trivial
things that I do in the Perl module, such as using anonymously defined
multi-dimensional data structures, or using functions/closures as arguments
(used in places such as the analogy to SQL's "WHERE" which is the same as
'grep'), or representing sets of values (maybe using arrays?), or comparing
arbitrary values for identity, or if necessary serializing arbitrary values for
the same reason (to use them as dictionary keys meaning an index), or for doing
various kinds of list processing such as 'map' or 'grep'/'filter' or 'reduce'
etc do, or generating and executing code at runtime (not used much right now).
I will of course be looking through the likes of http://python.org/community/
and such, but I appreciate any local tips to help narrow the list.
Alternately, if any of you think there is a better thing for me to work on as a
means to quickly learn Python than translating my Set::Relation module, feel
free to say so.
Also, is there a Victoria-local Python users' group, or are the generic
programming/etc groups like RCSS and VLUG it for that?
Thank you in advance for any pointers.
-- Darren Duncan
P.S. The translation is expected to be a serious endeavor, and I would plan to
commercially support the result after it is successfully done, as the Perl
version is supported, not just chuck it later. On the other hand, even the Perl
Set::Relation is more of a still-useful proof of concept, and its larger sibling
Muldis Rosetta is planned to supersede it in terms of actually being targeted
for production use and be able to scale up to large data sets and SQL-rivaling
performance, and it implements a whole programming language (Muldis D), not just
some relational operators; but Set::Relation works right now and Muldis Rosetta