1.1.21 • Published 5 months ago

finance-manager_lvn v1.1.21

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
5 months ago

Finance Manager

English will follow.

Gestionnaire de Finances

Gestionnaire de Finances est une bibliothèque JavaScript (Node.js) pour gérer ses finances personnelles. Elle permet de créer et gérer des comptes, des catégories et des transactions, et fournit des fonctionnalités pour exporter des données vers des fichiers JSON et calculer les soldes et les dépenses.

Installation

Pour installer le package, exécutez la commande suivante :

npm install finance-manager_lvn

Utilisation

Voici quelques exemples d'utilisation de la bibliothèque Gestionnaire de Finances :

Importation de la Bibliothèque

import { Compte, Categorie, Transaction, createCompte, createTransaction, createCategorie, exportComptesToJson, exportTransactionsToJson, exportCategoriesToJson, soldeCompteByDate, spendingByCategorie } from 'finance-manager_lvn';

Création de Comptes à partir d'un Fichier CSV

const comptes = await createCompte('path/to/comptes.csv');
console.log(comptes);

Création de Transactions à partir d'un Fichier CSV

const transactions = await createTransaction('path/to/transactions.csv');
console.log(transactions);

Création de Catégories à partir d'un Fichier CSV

const categories = await createCategorie('path/to/categories.csv');
console.log(categories);

Exportation des Données vers des Fichiers JSON

exportComptesToJson(comptes, 'comptes.json');
exportTransactionsToJson(transactions, 'transactions.json');
exportCategoriesToJson(categories, 'categories.json');

Calcul du Solde d'un Compte par Date

const balance = soldeCompteByDate(transactions, comptes[0], '2025-12-31');
console.log(`Solde : ${balance}`);

Calcul des Dépenses par Catégorie sur une Période

const spending = spendingByCategorie(transactions, 'food', '2025-01-01', '2025-12-31');
console.log(`Dépenses totales pour la nourriture : ${spending}`);

Points Importants

  • La bibliothèque utilise le package csv-parser pour lire les fichiers CSV.
  • Assurez-vous que les fichiers CSV sont correctement formatés avec les en-têtes appropriés.
  • La fonction soldeCompteByDate calcule le solde d'un compte jusqu'à une date spécifique en fonction des transactions.
  • La fonction spendingByCategorie calcule les dépenses totales pour une catégorie spécifique sur une période donnée.
  • Si un fichier d'entrée est manquant ou mal formaté, la bibliothèque génère une erreur. Assurez-vous que vos fichiers CSV contiennent les en-têtes corrects.

Licence

Ce projet n'est pas open-source et ne doit pas être distribué sans permission.


Finance Manager

Finance Manager is a JavaScript (Node.js) library for managing personal finances. It allows you to create and manage accounts, categories, and transactions, and provides functionalities to export data to JSON files and calculate balances and spending.

Installation

To install the package, run the following command:

npm install finance-manager_lvn

Usage

Here are some examples of how to use the Finance Manager library:

Importing the Library

import { Compte, Categorie, Transaction, createCompte, createTransaction, createCategorie, exportComptesToJson, exportTransactionsToJson, exportCategoriesToJson, soldeCompteByDate, spendingByCategorie } from 'finance-manager_lvn';

Creating Accounts from a CSV File

const comptes = await createCompte('path/to/comptes.csv');
console.log(comptes);

Creating Transactions from a CSV File

const transactions = await createTransaction('path/to/transactions.csv');
console.log(transactions);

Creating Categories from a CSV File

const categories = await createCategorie('path/to/categories.csv');
console.log(categories);

Exporting Data to JSON Files

exportComptesToJson(comptes, 'comptes.json');
exportTransactionsToJson(transactions, 'transactions.json');
exportCategoriesToJson(categories, 'categories.json');

Calculating Account Balance by Date

const balance = soldeCompteByDate(transactions, comptes[0], '2025-12-31');
console.log(`Balance: ${balance}`);

Calculating Spending by Category within a Date Range

const spending = spendingByCategorie(transactions, 'food', '2025-01-01', '2025-12-31');
console.log(`Total spending on food: ${spending}`);

Important Points

  • The library uses the csv-parser package to read CSV files.
  • Ensure that the CSV files are properly formatted with the correct headers.
  • The soldeCompteByDate function calculates the balance of an account up to a specific date based on transactions.
  • The spendingByCategorie function calculates the total spending for a specific category within a date range.
  • If an input file is missing or incorrectly formatted, the library throws an error. Ensure your CSV files contain the correct headers.

License

This project is not open-source and should not be distributed without permission.

1.0.19

5 months ago

1.0.17

5 months ago

1.0.16

5 months ago

1.0.9

5 months ago

1.0.22

5 months ago

1.0.21

5 months ago

1.0.20

5 months ago

1.0.23

5 months ago

1.0.11

5 months ago

1.0.10

5 months ago

1.1.21

5 months ago

1.0.15

5 months ago

1.0.14

5 months ago

1.0.13

5 months ago

1.0.12

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago