Skip to content

Properly decode every value type (polymorphy, beginner) #876

Open

Description

@niccokunzmann

At the moment, each value type is different.
We have a method Component.decoded() which puts an incomplete if/else dispatch into place to get the decoded value.

It would be easier if all value types had a property such as ical_value which would result in the object used.

Examples

This would e.g. be

  • .td for timedelta
  • .dt for date
  • str(self) for vText

Places to edit

Classes to add ical_value to:

Other places to touch when the list above is done:

  • Component.decoded() uses ical_value and nothing else (Polymorphy)
  • remove TODO in Component.decoded()
  • Document how Component.decoded() works, so that new value types are easy to implement.

Checklist for all ical_value

For each of the added functions:

  • add a type hint
  • add a doc string
  • add a test for all possible code paths inside of ical_value
    • create the object
    • if needed add parameters
    • return the value
  • check the docstring turns up in the documentation and looks nice

Note: Corrected: it should be ical_value for consistency with to_ical and from_ical.

Activity

  1. TejasR002 commented on Oct 16, 2025

    @TejasR002

    hey ! i would like to contribute to it. so can you assign this to me

  2. niccokunzmann commented on Oct 16, 2025

    @niccokunzmann
    MemberAuthor
  3. TejasR002 commented on Oct 19, 2025

    @TejasR002

    hello ! , i was going through the failed test cases and try to see which are failing then i found that the test_798_freebusy , was failing after digging in , i feel that during parsing it's not able to parse or assign an attribute called FBTYPE , because after parsing there is no attribute in the object named FBTYPE , meanwhile in the tests cases there are test cases for accessing the FBTYPE attribute for checking , so far i have understood this, so could you please check whether i'm right or wrong ,also i have tried over old and new decoded function which takes not effect at all.

  4. niccokunzmann commented on Oct 20, 2025

    @niccokunzmann
    MemberAuthor

    @TejasR002, I commented. It is enough to focus on adding some new properties. This issue is quite big but most parts are alright for first-timers. Others require deep digging in and evaluation of possible mistakes that were made in the past years: these contributions are not straight forward.

    Thank you for your tolerance! Let me know if I can help you anywhere else and if my suggestion actually works. I hope it does 😃

  5. ijsbol commented on Feb 11, 2026

    @ijsbol
    Contributor

    Heya, myself and a couple of friends would love to give this issue a shot! We'll create a PR for it in a week or so.

  6. niccokunzmann commented on Feb 11, 2026

    @niccokunzmann
    MemberAuthor

    @ijsbol Welcome! This is a huge issue, so please take a small part, open a PR and let's chat, so that it can be merged quicker.

  7. ijsbol commented on Feb 11, 2026

    @ijsbol
    Contributor

    Thank you! Will definitely do that!

  8. ijsbol commented on Feb 12, 2026

    @ijsbol
    Contributor

    Heya @niccokunzmann, I've gone ahead and implemented the ical_value method for vBoolean, just want to check that I understand the way to implement it and that this is the kind of commit you are looking for?
    ijsbol@e7e7674

    If so i'll go ahead and work on a few more and create a PR!

  9. niccokunzmann commented on Feb 13, 2026

    @niccokunzmann
    MemberAuthor

    @ijsbol Yes, that is what I am looking for. Thanks. Feel free to open a PR with the change!
    Also, if you create several PRs for each change, that is easier to merge, review and adjust.
    Oh. Please add a docstring.

  10. added 2 commits that reference this issue on Mar 11, 2026
  11. 6 remaining items

  12. added this to the 8.0.0 milestone on Oct 14, 2026
  13. HannaEpelboim commented on Oct 16, 2026

    @HannaEpelboim
    Contributor

    Hi! I'd like to contribute to this issue. I implemented ical_value for vDate in #1965. Feedback is very welcome!

  14. Mrbozz commented on Oct 21, 2026

    @Mrbozz

    I tried to contribute with the implementation of ical_value property for vDatetime. Any feedbacks are welcome

  15. added a commit that references this issue on Oct 27, 2026
  16. wmortenson199 commented on Nov 12, 2026

    @wmortenson199

    I will be taking vTime and add its ical_value property. ’ll open a small PR with the property, a docstring, a test, and a news entry. I’m working on this as part of a group for an open source project at my univeristy

  17. jakkoyang commented on Nov 13, 2026

    @jakkoyang

    i would like to take vSkip (ical_value bug) and vMonth for fun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions