The PEAK Developers' Center   EccoChemistry UserPreferences
 
HelpContents Search Diffs Info Edit Subscribe XML Print View
The following 330 words could not be found in the dictionary of 50 words (including 50 LocalSpellingWords) and are highlighted below:
Accessing   Alchemy   All   An   Another   B59   Book   Can   Center   Checkmark   Chemistry   Children   Class   Close   Columns   Contemplate   Contents   Date   Dates   Decimal   Default   Dev   Developer   Due   Ecco   Effort   Failure   Fast   Features   Field   File   Folder   Folders   Get   Guide   High   Hours   Internals   It   Item   Items   K27   Location   Low   Medium   Net   New   None   Note   Numeric   Oops   Overhaul   Parent   Phone   Please   Polymorphic   Popup   Priority   Pro   Q22   Questions   Recurring   See   Serial   Set   Setting   Some   Table   Task   Tests   Text   The   This   True   Undocumented   Upload   With   You   adhere   after   against   also   an   and   append   appropriate   are   as   ascending   assign   attribute   attributes   batch   be   before   bug   by   calling   can   cause   chemistry   child   children   class   close   com   comments   complete   configuring   connection   consult   container   containers   contents   conversions   corresponding   corruption   create   creation   currently   data   date   datetime   dde   decimal   defaults   defined   defining   delay   deleting   desc   details   determine   developer   dict   dictionary   directed   dt   due   during   eby   ec   ecco   effort   else   errors   etc   exactly   example   exporters   few   field   fields   file   files   filter   filtering   folder   folders   for   from   function   future   generic   get   global   guide   have   hierarchy   hrs   id   ids   import   important   importers   improved   in   information   instance   instances   intended   interaction   interface   is   it   item   itemclass   items   iterable   its   kw   lets   level   like   limitations   list   listinfo   loaded   long   lookups   mailing   mailman   makes   manipulation   many   mapping   methods   mix   module   more   moved   must   name   names   navel   no   nor   not   note   object   objects   of   on   one   only   open   operations   ops   or   other   others   over   own   package   parent   passed   peak   performed   possibly   prepend   prepends   previous   primarily   print   priority   produce   program   put   queries   query   ranges   read   removes   renameable   replacing   reports   repr   required   requirement   retrieved   runtime   sarna   script   scripts   separate   sequence   serial   session   set   setdefault   setitem   setting   should   silent   singleton   so   sort   sorting   startswith   stays   still   subclasses   subtype   such   supported   synchronization   t1   t2   t3   t4   t5   task   telecommunity   text   than   that   the   their   them   this   tid   time   to   toc   top   type   untested   until   up   update   upgrading   use   used   uses   using   validity   value   values   version   via   vs   whatzit   when   which   while   wish   with   without   you   your  

Clear message


Accessing Ecco With EccoChemistry

The EccoChemistry module lets you interface with the Ecco Pro PIM using an SQLAlchemy-like object mapping. It's primarily intended for batch interaction scripts, such as synchronization, importers, exporters, etc. An example:

>>> from ecco_chemistry import Ecco
>>> session = Ecco.NewFile()  # the Ecco global is a EccoDDE API object

>>> import ecco_chemistry as ec, datetime as dt, decimal as d

>>> class Task(ec.Item):
...     due      = ec.DateFolder('Due Dates')
...     effort   = ec.NumericFolder('Effort Hours', create=True)
...     priority = ec.PopupFolder('Priority', create=True)
...     serial   = ec.TextFolder('Task Serial #', create=True)

>>> t1 = Task("Overhaul the whatzit", serial="42A",
...           due=dt.date(2008,11,1), effort=8, priority="High"
... )

>>> t2 = Task("Upload this module to PyPI", effort=d.Decimal("0.5"),
...           due=dt.datetime(2008,11,7, 20,30,40), priority="Medium",
...           serial="B59"
... )

>>> t3 = Task("Contemplate navel",
...           due=dt.date(2010,12,31), effort=d.Decimal("0.25"),
...           priority="Low", serial="K27",
... )

>>> for t in (Task.due<dt.date(2009,1,1,)):  # query by folder
...     print "%s: %s" % (t.text, t.due)
Overhaul the whatzit: 2008-11-01
Upload this module to PyPI: 2008-11-07 20:30:00

>>> for t in +Task.effort:  # ascending sort by folder (desc. uses "-")
...     print "%s: %s hrs" % (t.text, t.effort)
Contemplate navel: 0.25 hrs
Upload this module to PyPI: 0.5 hrs
Overhaul the whatzit: 8 hrs

>>> Task.serial['B59'].text     # dictionary interface
'Upload this module to PyPI'

>>> 'B59' in Task.serial
True

>>> print Task.serial.get('Q22')    # no such Task
None

>>> t4 = Task.serial.setdefault('Q22', "Another task", priority="Low")
>>> t4.serial
'Q22'

>>> t4.parent = t3  # Set parent item
>>> t4.parent.text
'Contemplate navel'

>>> [t.text for t in t3.children]   # Setting parent prepends to children
['Another task']

>>> t3.children.prepend(t1)     # Children have prepend/append methods
>>> t3.children.append(t2)
>>> [t.text for t in t3.children]
['Overhaul the whatzit', 'Another task', 'Upload this module to PyPI']

>>> t4.children = t3.children   # Can assign to an iterable of items
>>> [t.text for t in t3.children]   # item can't be its own child, so stays
['Another task']
>>> [t.text for t in t4.children]   # ...and the others get moved
['Overhaul the whatzit', 'Upload this module to PyPI']

>>> t4.parent = None    # setting parent to None makes it a top-level item
>>> list(t3.children)   # and removes it from the previous parent
[]    

#>>> for t in Task.startswith("O"): print t.text
Overhaul the whatzit
Oops

#>>> for t in Task.with_text("e"): print t.text
#>>> for t in Task.without_text("e"): print t.text

Please note a few important limitations:

Some operations not supported by EccoChemistry can still be performed via the Ecco singleton, which is an ecco_dde.EccoDDE instance. (See the EccoDDE developer's guide for more information on its API.) "Item" and "Folder" objects have id attributes that can be passed to the EccoDDE API, and you can also create items and folders using ids retrieved from the EccoDDE API:

>>> ec.CheckmarkFolder(ec.CheckmarkFolder('PhoneBook').id).name
'PhoneBook'

>>> for tid in Ecco.GetFolderItems(ec.DateFolder('Due Dates').id):
...     print Task(tid).text
Overhaul the whatzit
Upload this module to PyPI
Contemplate navel

>>> t5 = Task(t4)
>>> t5.text
'Another task'

>>> t4.text = "Oops"
>>> t5.text
'Oops'

Please consult the complete EccoChemistry developer's guide for more details. Questions, comments, and bug reports for this package should be directed to the PEAK mailing list.

Developer's Guide

Undocumented/untested Features:

Folder parent/child info:

>>> f = ec.Folder('New Columns')

>>> f.children
[TextFolder('Net Location'),
 DateFolder('Recurring Note Dates'),
 NumericFolder('Effort Hours'),
 PopupFolder('Priority'),
 TextFolder('Task Serial #')]

>>> f.parent
CheckmarkFolder('Ecco Folders')

Internals and Tests

XXX Folders should be renameable or else .name should be read-only

XXX:

>>> Ecco.CloseFile(session)
>>> Ecco.close()

PythonPowered
EditText of this page (last modified 2010-03-22 18:17:32)
FindPage by browsing, title search , text search or an index
Or try one of these actions: AttachFile, DeletePage, LikePages, LocalSiteMap, SpellCheck