Skip to content

A python module to generate fancy markdown calendar

License

Notifications You must be signed in to change notification settings

deep5050/CalendarFusion

Repository files navigation

Calendar Fusion

A Python module to generate fancy markdown table-based calendar


Explore the docs »
Report Bug · Request Feature

Table of Contents

About The Project

Display a Calendar as you like. Add links, styles, emojis, etc.

Installation

pip3 install CalendarFusion

Documentation

See the Docs here ⬅️

Example usages

initialize

from CalendarFusion import CalendarFusion
cf = CalendarFusion.CalendarFusion()
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
cf = CalendarFusion(year=2023,
                    month=2,
                    fill_calendar=True,
                    weekno=True,
                    start_from_sunday=False,
                    lang="ja"
                    )
print(cf.table())
5 30 31 1 2 3 4 5
6 6 7 8 9 10 11 12
7 13 14 15 16 17 18 19
8 20 21 22 23 24 25 26
9 27 28 1 2 3 4 5

link()

Add a link to the dates.

entity = {}
entity[date(2023,8,12)] = "https://google.com"
entity[date(2023,8,2)] = "https://bing.com"
entity[date(2023,8,25)] = "https://google.com"
entity[date(2023,8,10)] = "https://google.com"
cf.link(urls=entity)
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

style()

Add formatting styles to the dates.

selected_dates = [date(2023,8,23),
                  date(2023,8,1),
                  date(2023,8,27),
                  date(2023,7,31),
                  date(2023,8,20),
                  date(2023,8,7)
                  ]
                  
print(cf.style(style="quote",selected=selected_dates))
Mon Tue Wed Thu Fri Sat Sun
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

selective()

Selective formatting

selected_dates = [date(2023,8,23),
                  date(2023,8,1),
                  date(2023,8,27),
                  date(2023,7,31),
                  date(2023,8,20),
                  date(2023,8,7)
                  ]
print(cf.selective(selected=selected_dates,not_selected_date_text="."))
Sun Mon Tue Wed Thu Fri Sat
. 31 1 . . . .
. 7 . . . . .
. . . . . . .
20 . . 23 . . .
27 . . . . . .
print(cf.selective(selected=selected_dates,
             not_selected_date_text=":red_circle:",
             selected_date_text=":green_circle:"
             ))
Sun Mon Tue Wed Thu Fri Sat
🔴 🟢 🟢 🔴 🔴 🔴 🔴
🔴 🟢 🔴 🔴 🔴 🔴 🔴
🔴 🔴 🔴 🔴 🔴 🔴 🔴
🟢 🔴 🔴 🟢 🔴 🔴 🔴
🟢 🔴 🔴 🔴 🔴 🔴 🔴

Version History

v1.0.0 Initial release

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch
  3. Commit your Changes
  4. Push to the Branch
  5. Open a Pull Request

Support

All Kinds Of Supports Are Welcome 🙌! The Most Basic Way To Show Your Support Is To Star 🌟 The Project, Or To Raise Issues 💬 You Can Also Support This Project By becoming a sponsor on GitHub 👏 Or By Making A Paypal Donation :)

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Dipankar Pal - dipankarpal5050@gmail.com

Related Works

Radioactive : A CLI-based internet radio player

NaughtyLust : Awesome Nautilus Scripts For Linux.

qikQR : Minimal QR Code Generator App Made With Electron.

cppcheck-action : Check Security Flaws In Your C/C++ Codes Right From GitHub Action Workflows.

autopy-lot : GitHub Action Setup To Convert Jupyter Notebooks To Python Scripts And Markdowns.

unicorn

Happy Coding

Visitors