icw package

Submodules

icw.config module

Config classes for icw.

class icw.config.DefaultConfig[source]

Bases: object

Contains the default config class for icw.

ALLOWED_EXTENSIONS = {'csv'}
DEBUG = False
GOOGLE_ANALYTICS_DOMAIN = 'GOOGLE_ANALYTICS_DOMAIN'
GOOGLE_ANALYTICS_ID = 'GOOGLE_ANALYTICS_ID'
SECRET_KEY = 'SUPER_SECRET_KEY'

icw.converter module

Converts csv files to ics files.

exception icw.converter.BaseICWError[source]

Bases: Exception

Base class for icw errors.

exception icw.converter.ContentError[source]

Bases: BaseICWError

Error in the body of the input data.

exception icw.converter.DatetimeFormatError[source]

Bases: BaseICWError

Error in input datetime format.

exception icw.converter.HeadersError[source]

Bases: Exception

Error with headers.

icw.converter.check_dates_and_times(start_date: str | None, start_time: str | None, end_date: str | None, end_time: str | None, all_day: bool | None, rownum: int | None) None[source]

Check the dates and times to make sure everything is kosher.

icw.converter.check_headers(headers: list[str]) list[str][source]

Ensure sure that all headers are exactly correct.

This ensures the headers will be recognized as the necessary keys.

icw.converter.clean_spaces(csv_dict: Iterable[dict[str, str]]) Iterable[dict[str, str | None]][source]

Clean trailing spaces from the dictionary values.

Trailing spaces can break my datetime patterns.

icw.converter.convert(upfile: IO) bytes[source]

Convert the file.

icw.converter.unicode_csv_reader(upfile: FileStorage, **kwargs: Any) Iterable[list[str]][source]

Workaround to decode data prior to passing to CSV module.

icw.forms module

Forms for icw.

class icw.forms.UploadForm(*args, **kwargs)[source]

Bases: FlaskForm

Form that accepts the CSV input file.

csv_file = <UnboundField(FileField, ('',), {'validators': [<flask_wtf.file.FileRequired object>, <flask_wtf.file.FileAllowed object>]})>
submit = <UnboundField(SubmitField, (), {'label': 'Convert'})>
validators = [<flask_wtf.file.FileRequired object>, <flask_wtf.file.FileAllowed object>]

icw.views module

Flask views for icw.

icw.views.download() Response[source]

Provide route for downloading converted file.

icw.views.error_404(_: Any) Response[source]

Return a custom 404 error.

icw.views.error_500(e) Response[source]

Return a custom 500 error.

icw.views.index() Response[source]

Provide default route.

icw.views.success() Response[source]

Provide route for successful conversion.

Module contents

icw :: Flask-based Webapp to convert a csv file into an icalendar file.