Package: marksman
marksmanCLI Tool to manage marks of students efficiently.FeaturesCRUD( create / read / update / delete )Email( email results to students )Visualize( visualize the data )Utils( fill dummy data / import from csv / export csv )Getting StartedYou must have Python 3.9 installed on your system.Install easily viapip, Python's official Package Manager.pipinstallmarksmanNote: Linux and Mac users might have to usepip3to invoke pipPleaseread thisif you are new to command-line-interfaces.Tip: You can use the aliasmminstead of typing the longmarksman. Its already set for you when you install.CRUDCRUD stands for Create,Read,Update,Delete. These are the fundamental operations we can perform on a database.marksmansupports all these operations, through its CLI.You can CRUD the students, exams and marks entries usingmarksman.To use the CRUD action, first read its usage.Suppose you want to CRUD students, here is an example.If you have noticed the above gif carefully, you can observe that when you run thecrudaction withstudentsas the option, you are first asked the roll number of the student. If a student with that roll exists, you are shown its details. You also have further options to see more data or update or delete the student.If the student, with the roll number you entered does not exist, then you will be given the choice to create the student.If you don't enter any roll number, thenmarksmanwill display all students in the database and exit.In the same fashion you can alsocrudexams and marks entries. Seemore examplesof crud in action.EmailYou can runmarksman email --helpto see how to use the email action. To configure settings for your emailing, readConfiguration.Now you have seen, how to use theemailaction, below is an example usage.The result is this:You can also use a custom template for the email message. If no template is found the default will be used.For using a custom template, create a file calledmarksman_email_template.mdand put in the directory from which you are runningmarksman.You can insert variables in your template like this::var::.Here is a sample template.Hi ::name::, you have scored ::marks:: in ::exam::.

Highest marks is ::highest::
Average marks is ::average::
Your rank is ::rank::

Please find the attached graph of your performance analysis.

Best Regards,
::inst::The list of supported variables are as follows:List of variables passed to the template:namerollemailexammarksrankhighestaverageinst ( name of institute )As this template is in a markdown file, you can use any valid markdown formatting.VisualizeData visualization is essential in taking important decisions. We can have a lot of data, but if we cannot make meaningful conclusions from it, then it is useless.Inmarksmanyou have the data of marks of all students.marksmanallows you to easily visualize the performance of the entire batch or of an individual student using simple graphs.You can learn to use thevisualizeaction by using the--helpflag.Let us see an example, where the teacher can visualize the results of an exam for the entire batch.You can also visualize the result of one particular student in that exam. Just use the--rflag to supply the roll number of the student tomarksman. See the example below for clarity.Utilsmarksmanprovides certain additional utilities to make your life easy. If you want to experiment withmarksman, without actually putting any data your self, thenmarksmancan help you by filling some dummy data. You can also import or export your data from or to CSV file formats.To learn about theutilsaction, use the--helpflag.As you can see thatutilscan accept either of the three arguments:dummy: fill the database with fake students, exams and marks for testing purposes.import: insert data into the database from CSV files ( of specific format )export: write existing data to CSV filesLets see some examples, for full clarity.Filling dummy data is a piece of cake. Just runmarksman utils dummyNow when it comes to importing data from CSV files, it must be in a specific format.Here is a brief description of the convention that is supported bymarksman:DataFilenameCSV HeadersStudentsstudents.csvroll,name,emailExamsexams.csvuid,nameMarksmarks.csvstudent,exam,marksAll three files must be kept in the same folder. For the CSV file for marks,studentcolumn should contain the roll, andexamthe uid.It is not compulsory to have all the three files for theimport. Marksman will take whatever data you give it.See the following example for understanding better.You can use theexportoption to write the data in the database toCSVfiles.
The exported files will have the same format as shown above.ConfigurationYou can configure marksman by using certain environment variables.marksmanloads the environment variables from the system's environment and from two special files:the.envfile in~/.marksman( global settings formarksman)the.envfile in the current directory from which you are runningmarksman( local settings formarksman)The local settings will override the global settings.Note:~means the user directory. It is different for Unix and Windows.
Windows 10:~expands to<root>\Users\<username>For Linux:~expands to/home/<username>The~symbol can be used directly in the terminal, let your OS expand it for you.List of environment variables supported:VariableDescriptionDefaultmarksman_dbthe path to store the.dbfile~/.marksman/database.dbmarksman_senderemail address to be used to send emailsmarksman_authpassword to login to sender's email accountmarksman_smtp_hosturl of SMTP host serversmtp.gmail.commarksman_smtp_portSMTP port for sending emails587marksman_instname of institute which is sending emailsYou can write these settings in the.envfile like this:marksman_sender=meet.aahnik@gmail.com
marksman_auth=dummypassIf you do not provide a value, the default value will be used.If a value is required,marksmanwill prompt you to to enter it during program execution.marksmanwill also ask you if you want to save it. If you say yes,marksmanwill save that setting in the global scope (~/.marksman/.envfile). In this way,marksmancan exempt you from manually editing the configs. You can always manually edit them when you want.API ReferenceAsmarksmanis written purely in python, it can easily be imported and extended by other Python programs.Read the fullAPI Referencewhich is published from the docstrings.