GithubHelp home page GithubHelp logo

calendrier's Introduction

Calendrier

This is my submission for the final project of CS50x ๐Ÿ’ป.

!! Not continuing work on this project (for now) !!

Calendrier ๐Ÿ—“๏ธ is a command-line calendar application that helps you remember events. You can view, create, delete and edit events on specific days. Additionally, you can also customise your experience (a little bit).

Command-line calendar view


Journey and Decisions

As a beginner, the python apps that I have developed hitherto have been done in a single file. However this is a very bad practice for several reasons: functions cannot be reused in other projects, the file will be very messy and hard to read, etc. So I decided to use a much more known project structure where there is a file for the constants (constants.py), the helper functions (helpers.py) and running the app itself (main.py).

I used the python module argparse, so my app can easily be used in the terminal. This also automatically created a help page which will most definitely be useful for new users. I used this approach instead of just having the user run the app and get prompted for inputs because it is much faster and provides a better user experience.

Regarding the events themselves, I made it so you can either view all the events in a month on the calendar or you can view the events on a specific day. Also, if month shown in the calendar includes today or the events being displayed are today's, then there will be a visual indicator to remind the user that it is today. You can create an event on any day with any name. If you were to make a mistake during this process, you can either delete or edit the event. Deleting it is self-explanatory. If you were to edit it, you can either change the date or name of the event. All the events are stored in events.csv, with each row (except the first which are the fieldnames/headers) containing an event's date and name.

I found that is would be ideal to allow the user to customise their experience. So I made options to allow the user to change whether Sunday should be the first day of the week (as it is in some parts of th world), whether they want the shortened weekday names to be displayed (so it is easier to read) and how the table used for the calendar and other lists looked (made possible by the different table formats provided by the python tabulate module). All the preferences are stored in settings.ini, with all the options under the PREFERENCES section.

All the inputs and options to run the program also have validation processes, so no invalid input is processed. If any of the required data files were to removed or tampered with, the app will automatically remake the file.

Finally, I ran pylint on all the code to try make sure there are as less bad practices as possible. I was able to find several bad practices which I fixed, but I didn't fix all of them.

I used pipreqs to create requirements.txt.


Installation

You must have python 3 installed to run this application.

Firstly, clone the repository (alternatively you can download and extract the repo)

git clone https://github.com/aritra-codes/calendrier.git

Then, change directories into the newly cloned repository.

cd calendrier

Then, using pip, install the application dependencies:

pip install -r requirements.txt

Usage

You can run the application by:

python main.py [-h] [-v] [-e] [-c] [-d] [-ed] [-p] [-cp] [year] [month] [day]

To change the table format, visit the tabulate github page, choose one of the table formats and change the table_format preference to that value using the -cp flag.

For further help running the application:

python project.py --help

File Structure Description

.
โ”œโ”€ constants.py -> constants
โ”œโ”€ helpers.py -> helper functions
โ”œโ”€ main.py -> run app
โ”œโ”€ events.csv -> events
โ”œโ”€ requirements.txt -> dependencies
โ”œโ”€ settings.ini -> settings (preferences)
โ”œโ”€ README.md -> instructions
โ””โ”€ images -> images (primarily for README)
   โ”œโ”€ calendar.png
   โ””โ”€ demoThumbnail.jpg

calendrier's People

Contributors

aritra-codes avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.