A Python module to generate fancy markdown table-based calendar
Explore the docs »
Report Bug
·
Request Feature
- About the Project
- Installation
- Usage
- Version History
- Contributing
- Support
- License
- Contact
- Related Works
Display a Calendar as you like. Add links, styles, emojis, etc.
pip3 install CalendarFusion
See the Docs here ⬅️
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 |
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 |
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 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 |
|---|---|---|---|---|---|---|
| 🔴 | 🟢 | 🟢 | 🔴 | 🔴 | 🔴 | 🔴 |
| 🔴 | 🟢 | 🔴 | 🔴 | 🔴 | 🔴 | 🔴 |
| 🔴 | 🔴 | 🔴 | 🔴 | 🔴 | 🔴 | 🔴 |
| 🟢 | 🔴 | 🔴 | 🟢 | 🔴 | 🔴 | 🔴 |
| 🟢 | 🔴 | 🔴 | 🔴 | 🔴 | 🔴 | 🔴 |
v1.0.0 Initial release
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch
- Commit your Changes
- Push to the Branch
- Open a Pull Request
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 :)
Distributed under the MIT License. See LICENSE for more information.
Dipankar Pal - [email protected]
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.

