file object as container class

Discussion in 'Python' started by Matthew Wilson, Oct 14, 2003.

  1. I have a bunch of classes that track data for time series. The classes are
    really just glorified dicts where the key is a date object, and the value is the
    value as of that date.

    I want a way to store a bunch of these tseries objects into a file object. I
    want to be able to open the file object, iterate through all timeseries, then
    create some new tseries, and add them to the file object. I also want to be
    able to delete tseries from the file object.

    Can anyone give me any pointers on how to write a file object like this?
     
    Matthew Wilson, Oct 14, 2003
    #1
    1. Advertising

  2. "Matthew Wilson" <>

    > I have a bunch of classes that track data for time series. The classes

    are
    > really just glorified dicts where the key is a date object, and the value

    is the
    > value as of that date.
    >
    > I want a way to store a bunch of these tseries objects into a file object.

    I
    > want to be able to open the file object, iterate through all timeseries,

    then
    > create some new tseries, and add them to the file object. I also want to

    be
    > able to delete tseries from the file object.
    >
    > Can anyone give me any pointers on how to write a file object like this?


    It depends on the size of it. If you have, say, less than 30 MB (c)pickle
    will do fine and you have absolute control about everything. The new cpicke
    is very fast, however the disadvantage is, that you completely read and
    rewrite the file.

    If your files are larger than, say, 300 MB, you should in fact use some
    database concept. There is a twighlight zone between 30 and 300 MB ;-)

    Kindly
    MichaelP
    >
     
    Michael Peuser, Oct 15, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vivi Orunitia
    Replies:
    11
    Views:
    4,481
    Martijn Lievaart
    Feb 4, 2004
  2. Maitre Bart
    Replies:
    2
    Views:
    526
    Maitre Bart
    Feb 11, 2004
  3. Steven T. Hatton
    Replies:
    4
    Views:
    3,905
    Rob Williscroft
    Dec 5, 2004
  4. Replies:
    4
    Views:
    805
    Daniel T.
    Feb 16, 2006
  5. wolverine
    Replies:
    2
    Views:
    454
    Marcus Kwok
    Jul 24, 2006
Loading...

Share This Page