Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for rrule #118

Open
avivgood opened this issue Dec 29, 2023 · 0 comments
Open

Support for rrule #118

avivgood opened this issue Dec 29, 2023 · 0 comments

Comments

@avivgood
Copy link

Hi, so I had a use case where I needed to represent an event that reoccurred every X time for the duration of Y time, and I wanted to represent this event in my FastAPI + Pydantic stack. [https://stackoverflow.com/questions/77705081/time-intervals-in-python](This is the full use case). I concluded that implementing this on my own would require a lot of validation and parsing. I found out there is already a standard for it : RFC 5545 - ICalender, which as far as I know, the rrule part of it is implemented in [https://dateutil.readthedocs.io/en/stable/rrule.html](dateuttil package) However, while it is supported in many JS calendars, I couldn't find support for it, especially for rrule, as a "first citizen" Pydantic type. I will admit I am not very knowledgeable about how Pydantic is implemented, however, an rrule can't generate a pydantic-core schema (i.e the error:
pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <module 'dateutil.rrule' from '<...>/dateutil/rrule.py'>. Set arbitrary_types_allowed=Truein the model_config to ignore this error or implementget_pydantic_core_schema on your type to fully support it.
And therefore I can't use it in my swagger and API.
I know the dateutil package it third-party, and most of the types supported by Pydantic are not, however, since this is the calendering standard, I do think Pydantic support would be helpful here.

Original issue: pydantic/pydantic#8451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant