473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

recommendations for personal journaling application

Hi. I've been sort of standing back on the sidelines reading this list
for awhile, and this is my first posting. So a little about myself and
my skill level. My name is Bryan. I'm new to Python and have very
little experience. I've gone through a few of the tutorials. I
understand the different data-types, basic syntax, functions and
function definition, basic iteration, and calling from modules.

I might be getting ahead of myself, but I think the best way for me to
learn things is by having a goal and working towards it. My goal is to
create a personal command line journaling application. I would like to
store all the entries in one file, have them searchable by keywords,
date, topic, etc... I think I would like to use "/*" type commands. For
instance, you call the application from a terminal window and start
with a generic prompt. You would type '/ne /t "topic"' to begin a new
entry and assign the topic; '/d' to set a date. You should be able to
use the slash commands while editing as well. For instance while
writing in an entry you could isolate a phrase or word with /k "phrase
to be marked as searchable keyword" / to mark the enclosed text as a
searchable keyword/keyphrase.

So what I'm interested in is how this would work. Is this 'event
driven' in nature? Would I define the bulk of these slash commands in a
function and then call it at the end of the script? What would be a
good module to look at for the text processing and searching aspects?
Anyways, I'm not sure how you would create a program that would
"listen" for commands and then parse them accordingly. I think for
starters I will sketch out on paper the slash commands I need, and try
to break apart the general operations into pseudo code. How would you
all approach this?

Thank you all and I hope I'm not biting off too much at once...

Oct 8 '06 #1
4 1294
Hi!

Donnie Rhodes wrote:
So what I'm interested in is how this would work. Is this 'event
driven' in nature? Would I define the bulk of these slash commands in a
function and then call it at the end of the script? What would be a
good module to look at for the text processing and searching aspects?
For implementing the commandline interface, have a look at the getopt
module.

If you store your data in a flat text file, you might use string.find()
or the re module to do the searching. The re module can search case
insensitive and is more versatile.

But maybe you want let your script create some SQL statements and use
the pysqlite module to store and search the data.

Kind regards,
Karsten.

Oct 8 '06 #2
Ant

Donnie Rhodes wrote:
....
>
Thank you all and I hope I'm not biting off too much at once...
Not if you break it up into pieces. Look at the things you want to do,
and in the first instance, create a function for each. Then you can
start to fill in the blanks, and if neccessary ask back here for advice
on each bit.

For example, your skeleton script may look something like:

def main():
options = get_options()
text = fetch_body()
entry_data = parse_text(text, options)
store_entry(entry_data)

def get_options():
pass

def fetch_body()
pass
....

if __name__ == "__main__":
main()

Ideas for the various parts:

get_options() - getopt or optparse modules (the former is simpler to
start with);

fetch_body() - just read from sys.stdin (that way you can also pipe
text into it from a file or the output from another program as well);

parse_text() - regexes could suffice if the flags and what they are
supposed to do is simple, otherwise a grammar parsing module could be
useful such as pyparsing (http://pyparsing.wikispaces.com/);

store_entry() - I'd probably go with XML for the storage format if you
really want to store the entries in a single text file, as you can
structure it well, there are good tools in python 2.5 for building xml
(xml.etree.ElementTree) and you could implement a fast search engine
using SAX. Otherwise a database may be a better option (e.g. sqlite).

Oct 8 '06 #3

"Donnie Rhodes" <da****@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
keyword/keyphrase.
>
So what I'm interested in is how this would work. Is this 'event
driven' in nature?
I would call it line-input driven -- a special case that is easier to
program.
Would I define the bulk of these slash commands in a
function and then call it at the end of the script?
I would consider a dict mapping command letters to functions.

tjr

Oct 8 '06 #4
before you use re there is a quote I have seen on different boards to
remember. So you have a problem and you want to use re now you have
two problems.!!!! It was someone from thescripts.com that helped me
realise how to fix my program without re. (sorry if I have thier
website name somewhat wrong.
https://sourceforge.net/project/show...kage_id=202823
Donnie Rhodes wrote:
Hi. I've been sort of standing back on the sidelines reading this list
for awhile, and this is my first posting. So a little about myself and
my skill level. My name is Bryan. I'm new to Python and have very
little experience. I've gone through a few of the tutorials. I
understand the different data-types, basic syntax, functions and
function definition, basic iteration, and calling from modules.

I might be getting ahead of myself, but I think the best way for me to
learn things is by having a goal and working towards it. My goal is to
create a personal command line journaling application. I would like to
store all the entries in one file, have them searchable by keywords,
date, topic, etc... I think I would like to use "/*" type commands. For
instance, you call the application from a terminal window and start
with a generic prompt. You would type '/ne /t "topic"' to begin a new
entry and assign the topic; '/d' to set a date. You should be able to
use the slash commands while editing as well. For instance while
writing in an entry you could isolate a phrase or word with /k "phrase
to be marked as searchable keyword" / to mark the enclosed text as a
searchable keyword/keyphrase.

So what I'm interested in is how this would work. Is this 'event
driven' in nature? Would I define the bulk of these slash commands in a
function and then call it at the end of the script? What would be a
good module to look at for the text processing and searching aspects?
Anyways, I'm not sure how you would create a program that would
"listen" for commands and then parse them accordingly. I think for
starters I will sketch out on paper the slash commands I need, and try
to break apart the general operations into pseudo code. How would you
all approach this?

Thank you all and I hope I'm not biting off too much at once...
Oct 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Schneider | last post by:
Hi forum, can anyone tell me wether it is possible to adjust the journaling via JDBC? I have created a database (library) via CREATE SCHEMA which creates a journal and journal receiver...
14
by: Lester Manry | last post by:
First I wish to appoligies if this is OT and should be posted elsewhere. I've done a google group search and read the Comp.Lang.C FAQ in hopes of avoiding a OT or FAQ. Please direct me to a better...
23
by: craig | last post by:
This is a little off topic, but I thought it couldn't hurt to ask... I am about to purchase a new development laptop computer. Before I do, I thought I might ask the C# development community if...
20
by: Dr. Colombes | last post by:
For a personal Web site with modest throughput and interactivity demans, I'm interested in your recommendation(s) for good (cheap, reliable, Linux friendly, very little, if any, sponsor...
18
by: bjorn.augestad | last post by:
We're planning to migrate our db to new and more disk drives, faster RAID levels and more dedicated disk usage(e.g. placing the translog on dedicated disks). The db server runs on Win2003. Right...
1
by: Billy Biro | last post by:
Hi. I'm looking for some recommendations for Visual Basic 2005 books. Specifically, I'm NOT looking for books that detail the elements of the language, nor explain OOP, but rather present...
3
by: Paul | last post by:
Looking for recommendations on a programming language for a web application. I am soliciting recommendations on a programming language for a web application described below. Actually, it is not...
3
by: Stinky Pete | last post by:
Morning all, I've found over the years that this newsgroup is an absolute fountain of knowledge and I have been able to use heaps of stuff in the databases I've written. Personal knowledge and...
1
by: Cramer | last post by:
I would appreciate your recommendations for report writers for .NET Windows Forms applications. I could google this topic to get a list - but that's not what I'm after. I would like...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.