Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:36:24+00:00 2026-06-12T22:36:24+00:00

I want to store dateutil.rrule objects to a database and recreate them after reading

  • 0

I want to store dateutil.rrule objects to a database and recreate them after reading from the database.

Given the following issue, I think I need to use a workaround.
Python dateutils print recurrence rule according to iCalendar format (see RFC 5545)

I am thinking of storing the output of myrrule.dict to the database as a string and then recreate the rrule object when required.

This is how the dict looks like:

{'_cache_complete': False, '_byhour': (0,), '_wkst': 0,
'_timeset': (datetime.time(0, 10),), '_bysecond': (0,),
'_bymonthday': (), '_byweekno': None, '_bysetpos': None,
'_cache': None, '_bymonth': None, '_bynweekday': ((4, 3),),
'_tzinfo': None, '_byyearday': None, '_byweekday': None,
'_byminute': (10,), '_len': 10, '_until': None,
'_bynmonthday': (), '_dtstart': datetime.datetime(2012, 10, 13, 0, 10),
'_count': 10, '_freq': 1, '_interval': 1, '_byeaster': None}

Is it a good idea? Any other suggestions?

How do I recover the python object from the dictionary?
Is python setattr() on my best bet or is there something easier?

Should I consider using something like this instead?
https://stackoverflow.com/a/1305663/161628

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:36:25+00:00Added an answer on June 12, 2026 at 10:36 pm

    What you need is python’s pickle module. The pickle module is a simple serialization module which can convert any python object into a string. The string can later be de-serialized back to the original object.

    import pickle
    serial_str = pickle.dumps(your_rrule_object)
    db.store(serial_str)
    ...
    serial_str = db.retrieve()
    new_rrule_object = pickle.loads(serial_str)
    

    Check the documentation for the pickle module for more details.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 15k entries and i want store them in local database. Further in
I want to store a large result set from database in memory. Every record
I want to store a very long string in database using php. The size
I want store data from an html page to a text file using javascript
We want to store some meta-information about the commit in an external database. During
I want to store this information in a database: Company | |-- Dept 1--,
I want to store the details of college courses in a (MySql) database but
I want to store java objects as part of the Solr document. They don't
I want to store a large number of sound files in a database, but
I want to store the value returned from a webservice to a hidden field

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.