GithubHelp home page GithubHelp logo

jake314jake / algeria Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mouh2020/algeria

0.0 0.0 0.0 25 KB

Python library which gives you a (clé) and (rip) of a given (ccp) ccp number account.(forked repository)

Python 100.00%

algeria's Introduction

🇩🇿 Algeria 🇩🇿

Algeria is a Python library that allows you to calculate the (clé) and RIP (Relevé d'Identité Postal) of a given CCP (Compte de Chèque Postal) number account. It provides a simple and convenient way to obtain the clé and rip values for CCP accounts. Please note that additional features may be added to the library in the future. You can check features section for any updates.

Contributions are welcome! If you would like to contribute to the development of the Algeria library, feel free to submit pull requests or open issues on the GitHub repository.

💡 Features

  • Clé (Compte de Chèque Postal) calculation.
  • RIP (Relevé d'Identité Postal) calculation.
  • RIP's Clé calculation.
  • Deposit fees calculation
  • Checkout fees calculation

📌 Instalation

You can install the "algeria" library using pip:

pip install algeria

If you want to use the development version:

pip install git+https://github.com/mouh2020/algeria.git

📚 Usage

CCP class :

The CCP class provides methods to calculate the (clé) and (RIP) for a given CCP account number.

  • Initialization

To create an instance of the CCP class, pass the CCP account number as a string to the constructor:

from algeria.ccp import CCP

ccp_account = CCP("1234567890")
  • Calculating the clé

To calculate the clé of the CCP account, use the get_cle method:

cle = ccp_account.get_cle()

print("Clé CCP:", cle)
  • Calculating the rip

To calculate the rip of the CCP account, including the first 8 digits "00799999", use the get_rip method:

rip = ccp_account.get_rip()

print("RIP:", rip)
  • Calculating the cle of the rip

To calculate only the clé of the rip, use the get_rip_cle method:

rip_cle = ccp_account.get_rip_cle()

print("RIP Clé:", rip_cle)

Transaction class :

The Transaction class provides methods to calculate the fees of a deposit or checkout ammount.

  • Initialization

To create an instance of the Transaction class, pass the amount as a float to the constructor:

from algeria.ccp import Transaction

transaction = Transaction(2000000)
  • Calculating the fees of a deposit transaction

To calculate the fees of a deposit transaction, use the get_deposit_fees method:

transaction_fees = transaction.get_deposit_fees()

print("Deposit fees:", transaction_fees)
  • Calculating the fees of a checkout transaction

To calculate the fees of a checkout transaction, use the get_checkout_fees method:

checkout_fees = transaction.get_checkout_fees()

print("Checkout fees:", checkout_fees)

Example

Here's an example demonstrating the usage of the "algeria" library :

from algeria.ccp import CCP,Transaction

ccp_account = CCP("1234567890")

cle = ccp_account.get_cle()
print("Clé CCP:", cle) // 45

rip = ccp_account.get_rip()
print("RIP:", rip) // 0079999912345678906

rip_cle = ccp_account.get_rip_cle()
print("RIP Clé:", rip_cle) // 06



transaction = Transaction(2000000)

deposit_fees = transaction.get_deposit_fees()
print("Deposit fees:", deposit_fees)   // 4818

checkout_fees = transaction.get_checkout_fees()
print("Checkout fees:", checkout_fees) // 9018

💡 Note

The algorithms extracted from the web app provided here after testing them.

🚀 About Me

A self-taught Python programmer who enjoys developing simple scripts, bots, and automation tools.

algeria's People

Contributors

mouh2020 avatar amuza2 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.