Skip to main content

Python library which gives you a (clé) and (rip) of a given (ccp) CCP number account, additional features may be added to the library in the future

Project description

🇩🇿 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 amount.

  • 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

algeria-0.2.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

algeria-0.2.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file algeria-0.2.0.tar.gz.

File metadata

  • Download URL: algeria-0.2.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for algeria-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8eccc3107524ee93cb66ed01a241a135d80c5cf5698858d2002e37366e5c2b6f
MD5 0613f945c0dd218a1e863a5148189f49
BLAKE2b-256 2d74459f6b2dea854ce83fd144e6f1036918744e8001bb95b47e7f7c7330a957

See more details on using hashes here.

File details

Details for the file algeria-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: algeria-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for algeria-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 430dab2f119cfbc2e9fed4d1ddaf2a81a34835eebe4f0bd66638bc29f8f29c93
MD5 68abd06c398eea833f3d1631cb1da68c
BLAKE2b-256 9491a5b255a87de3363404cef852611f7cfa9698d1c824d33b0327d6f8057a26

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page