Scribus Forums

Scribus => Scripts and Plugins => Topic started by: rafferty on November 01, 2019, 04:22:45 PM

Title: Monthly Calendar script
Post by: rafferty on November 01, 2019, 04:22:45 PM
Hello,

During the past weeks I reworked the CalendarWizard script for my own purposes and I want to share it. The resulting script generates a classic monthly calendar with many layout options. A manual which explains the menu items of the script is included in the zip download.

One of the options is to import a text file with the holidays for your country. You are free to post your local holidays files in this thread.


Please enjoy.

note: Unfortunately this script only works with Windows 10 and Scribus 1.5.5. I could not integrate the various codepages for the languages on an easy way in Linux. I am sorry for that.


[attachment deleted by admin]
Title: Re: Monthly Calendar script
Post by: rafferty on November 02, 2019, 04:13:43 PM
Monthly Calendar options:

1) You can choose between many (European) languages (default is English). You may add, change or delete entries in the localization list in the script. Please respect the python syntax.

2) You can choose a font from the list of fonts available on your system (default is set to Lato Bold, which is provided with my version of Scribus). Please check if all special characters for your language are available in the chosen font!

3) Calendar year and week starting day are to be given. Saturdays and Sundays will be printed in grey.

4) Option to show week numbers with (or without) a week numbers heading in your local language. Week numbers will be printed in grey.

5) Option to import holidays from a 'holiday.txt' file for your country. Holidays will be printed in red.

6) Select one or more months or the whole year.

7) You have the possibility to determine where on the page the calender month will be drawn with the offsets from top and / or left margin. Option to draw an empty image frame within the top and / or left 'offset' area and to get an 'inner' margin between this frame and the calendar grid.

[attachment deleted by admin]
Title: Re: Monthly Calendar script
Post by: rafferty on December 03, 2019, 08:12:49 PM
Version 2 of the Monthly Calendar script.

Changes:
- now works also in Linux.
- added option to draw moon phase symbols.
- added option draw mini calendars for previous and next months in the calendar month heading.

[attachment deleted by admin]
Title: Re: Monthly Calendar script
Post by: RodneyLee on December 04, 2019, 03:55:32 PM
very cool, thanks
Title: Re: Monthly Calendar script
Post by: mnawij on December 04, 2019, 06:34:47 PM
Thank you, this will be useful!

mnawij
Title: Re: Monthly Calendar script
Post by: AarGeeBee on December 10, 2019, 10:58:34 AM
Great Job Rafferty. Very usefull.

Best Regards
Title: Re: Monthly Calendar script
Post by: rafferty on December 11, 2019, 09:21:20 AM
On rgb-labs.com (a website that promotes tutorials for Blender, Inkscape and Gimp) there was a series on introducing Scribus (in German).
Yesterday they wrote an article about the Monthly Calendar Script and how to use it (https://www.rgb-labs.com/scribus-017-raffertys-monthly-calendar-script/).
For their readers, I added the German official holidays file (DE_holidays.txt) in the download here.

Rafferty

[attachment deleted by admin]
Title: Re: Monthly Calendar script
Post by: AarGeeBee on December 11, 2019, 02:09:15 PM
Thank you for the kind enrichment. Great work.
Title: Re: Monthly Calendar script
Post by: RobertsDaughter on December 12, 2019, 04:37:56 PM
Thanks a lot for sharing. Will be very useful to me.
Title: Re: Monthly Calendar script
Post by: RobertsDaughter on December 13, 2019, 10:54:47 AM
I use a dark theme in Linux Mint. As you can see from my screenshots it's almost impossible to do the settings because dialogue font is light grey (?) on white. Is there a chance to change that to something more readable?

[attachment deleted by admin]
Title: Re: Monthly Calendar script
Post by: rafferty on December 14, 2019, 11:06:04 AM
to RobertsDaughter:

The problem of the colors has nothing to do with the script itself, but with the open file dialog of Python programming language.
You can try to change some colors (temporary) in the dark theme. I do not see another solution.

Best regards,
Rafferty
Title: Re: Monthly Calendar script
Post by: rafferty on December 18, 2019, 11:51:25 AM
New version 3 of the Monthly Calendar Script.

Now you can display small texts of holidays or special days (like birthdays) below the date figures. You can hide the 'holidays' layer if you do not want to show them. Possibility of changing fonts, etc. by editing the Styles of the different elements in the calendar afterwards. Export to PDF for printing.

Please note that the format of the 'holidays.txt'-file has changed completely! See the examples and read the pdf-file with instructions in the download for more info.

Happy holidays to all!
Rafferty

[attachment deleted by admin]
Title: Re: Monthly Calendar script
Post by: rafferty on December 22, 2019, 12:07:32 PM
Here an example of a modern calendar made with the Monthly Calendar Script.

Instructions:
1) Run the script (version 3) with the options as displayed in the menu.
2) Select the 'US_holidays.txt' and the 'moonphases.txt' files when asked.
3) Fill in the New document - dialog as displayed (it is half of a letter page).
4) Menu: Windows -> Layers: uncheck 'Make layer visible' and 'Print layer' for the layer 'Grid'.
5) Make layer 'Calendar' active and select the cells with the weekday names. Then apply menu Windows -> Properties and open the Colors tab. Set Fill mode to Green and Shade to 25%.
6) Menu: Edit -> Styles -> char_style_DayNames -> Edit. Then Properties -> Family -> Ink Free -> Done.
7) Change layer to Images. Select the empty image frame and get the image of your choice and arrange it with menu: Windows -> Properties -> Image.
8) Menu: File -> Export -> Save as pdf.

[attachment deleted by admin]
Title: Re: Monthly Calendar script
Post by: Pablo J on January 09, 2020, 12:16:33 PM
Hello and congratulation for the script,

I have a suggestion to improve the script. It would be great if all the configuration parameters (fonts, language, size fonts, background colors, ...) were saved in an external configuration file. In this way, if I want to repeat my 2019 calendar but for the year 2020 I just have to load my custom configuration file and only modify the year.

It's only a suggestion, anyway It's a great script. Congratulations.
Title: Re: Monthly Calendar script
Post by: rafferty on October 26, 2020, 03:29:40 PM
Version 4 of the Monthly Calendar Script.

Changes:
- Addition of custom colors and styles for texts, fills and lines for several parts of the calendar: simply edit the color or style for month name, day names, week numbers, holidays, etc. and it will be applied to all calendar months.
- Holidays.txt file changed in order to include automatic calculation of holidays for the nth workday of month for every year.
- Moonphases.txt updated to 2020-2025.
- Instructions file included with worked out example to demonstrate the use of custom colors and styles.

[attachment deleted by admin]
Title: Re: Monthly Calendar script
Post by: rafferty on October 26, 2020, 03:32:30 PM
Version 4 of the Monthly Calendar Script to use with Python 3 (for Scribus version 1.5.6svn)

[attachment deleted by admin]
Title: Re: Monthly Calendar script
Post by: a.l.e on October 27, 2020, 10:21:54 AM
hi

i've not been using a calendar for ages, and i'm only slightly interested in this script.
but i see that it's something many people love, so i'll try to give some feedback.

- in my eyes the UI is getting too complex
- i think that the most simple setting should be done through a simpler UI and use a settings file for the more advanced one.
- i would separate the code that creates the calendar from the one that shows the UI (two different scripts; one using the other one)
- i would use the current document instead of creating a new one.
- it's a bit too slow... there must be ways for improving the speed : - )
- i would setup a repository for its development (or add it to https://github.com/aoloe/scribus-script-repository/ )

if you want to follow up on one or more of the topics above just wave your hand...

ciao
a.l.e
Title: Re: Monthly Calendar script
Post by: rafferty on October 25, 2021, 10:49:27 AM
Now on GitHub: https://github.com/RaffertyR/Monthly-calendar-script-for-Scribus (https://github.com/RaffertyR/Monthly-calendar-script-for-Scribus)