Compare commits

..

No commits in common. "d4313f421aecd01ecd547ff7bb0cdd0eac4e1cdf" and "6173c83da586e389612c4812b8adcc8ac806aaec" have entirely different histories.

3 changed files with 7 additions and 18 deletions

View file

@ -5,6 +5,5 @@ edition = "2021"
[dependencies] [dependencies]
pdf-extract = "0.9.0" pdf-extract = "0.9.0"
colored = "3.0.0"
clap = "4.5.36" clap = "4.5.36"
csv = "1.3.1" csv = "1.3.1"

View file

@ -2,7 +2,6 @@
mod action; mod action;
mod args; mod args;
mod parser; mod parser;
mod printer;
mod reader; mod reader;
mod writer; mod writer;
@ -19,29 +18,31 @@ fn main() -> Result<()> {
let args = Arguments::new(); let args = Arguments::new();
// Display Status // Display Status
printer::print_generic("📃", "Extracting Text"); println!("Reading PDF and extracting Text Content...");
// Creating a File Reader & Reading // Creating a File Reader & Reading
let reader = Reader::new(&args.file_input.clone())?; let reader = Reader::new(&args.file_input.clone())?;
let text = reader.extract(); let text = reader.extract();
// Display Status // Display Status
printer::print_generic("📑", "Parsing Text"); println!("Successfully extracted Text Content!");
println!("Parsing the PDF...");
// Creating a Parser to read the Text Content // Creating a Parser to read the Text Content
let mut parser = Parser::new(text); let mut parser = Parser::new(text);
parser.start(); parser.start();
// Display Status // Display Status
printer::print_generic("📝", "Writing CSV"); println!("Successfully parsed the PDF!");
println!("Saving to a CSV File...");
// Creating a Writer and saving the file // Creating a Writer and saving the file
let writer = Writer::new(&parser.transactions, args.file_output.clone()); let writer = Writer::new(&parser.transactions, args.file_output.clone());
writer.save()?; writer.save()?;
// Display Status // Display Status
printer::print_generic("🏁", "Successful Converting Job"); println!("Sucessfully Saved to {}", args.file_output);
printer::print_generic("😎", "Thank you for using Statement Converter!"); println!("Thank you for using Statement Converter!");
// It's ok! // It's ok!
Ok(()) Ok(())

View file

@ -1,11 +0,0 @@
// Libraries
use colored::{self, Colorize, CustomColor};
// Functions
pub fn print_generic(emoji: &str, message: &str) {
println!(
"[{:^3}] {}",
emoji,
message.custom_color(CustomColor::new(200, 200, 200))
);
}