Skip to main content

python tool for jbit.ir apis

Project description

API Documentation

This project interfaces with the Jibit API and provides several functions for interacting with the platform. Below are the details for each function, including inputs, outputs, and purpose.

Example usage of token generation and fetching card-to-IBAN info:

service = JibitService(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")

# Generate tokens
tokens = await service.generate_token()

# Fetch IBAN information for a card
card_info, new_tokens = await service.card_to_iban(card_number="1234567890", tokens=tokens)

# Print IBAN info
print(card_info)

Methods

1. Generate Token

  • generate_token()
    • Purpose: Fetches access and refresh tokens from the Jibit API.
    • Inputs: None.
    • Outputs: Returns an instance of JibitTokens containing access_token and refresh_token.

2. Refresh Token

  • refresh_token(tokens: JibitTokens)
    • Purpose: Refreshes the tokens when the current ones have expired or are invalid.
    • Inputs:
      • tokens: An instance of JibitTokens containing the current access_token and refresh_token.
    • Outputs: A new instance of JibitTokens with refreshed access and refresh tokens.

3. Card to IBAN

  • card_to_iban(card_number: str, tokens: Optional[JibitTokens])
    • Purpose: Converts a card number to an IBAN using the Jibit API.
    • Inputs:
      • card_number: The card number to be converted to IBAN.
      • tokens: The current JibitTokens for authentication (optional).
    • Outputs:
      • A tuple containing:
        • A JibitCard instance with the IBAN info.
        • new_tokens: New tokens if they were refreshed.

4. Match IBAN to National Code

  • match_iban_to_national(tokens: Optional[JibitTokens], iban: str, national: str, birth_date: str)
    • Purpose: Matches the IBAN to the national code and birth date.
    • Inputs:
      • iban: The IBAN to be matched.
      • national: The national code.
      • birth_date: The birth date in the format yyyy-MM-dd.
      • tokens: The current JibitTokens for authentication (optional).
    • Outputs:
      • A tuple containing:
        • matched: A boolean indicating whether the IBAN matches the national code and birth date.
        • new_tokens: New tokens if they were refreshed.

5. Postal Code to Address

  • postal_to_address(tokens: Optional[JibitTokens], postal_code: str)
    • Purpose: Converts a postal code to detailed address information.
    • Inputs:
      • postal_code: The postal code to be converted to address information.
      • tokens: The current JibitTokens for authentication (optional).
    • Outputs:
      • A tuple containing:
        • An AddressInfo instance with the parsed address.
        • new_tokens: New tokens if they were refreshed.

6. Identity Similarity Check

  • identity_similarity(tokens: Optional[JibitTokens], national_code: str, birth_date: str, first_name: str, last_name: str, full_name: str, father_name: str)
    • Purpose: Compares personal information for similarity between the provided data and Jibit’s records.
    • Inputs:
      • national_code: The national code.
      • birth_date: The birth date in the format yyyy-MM-dd.
      • first_name: The first name.
      • last_name: The last name.
      • full_name: The full name.
      • father_name: The father’s name.
      • tokens: The current JibitTokens for authentication (optional).
    • Outputs:
      • A tuple containing:
        • An IdentitySimilarity instance with similarity percentages for each field.
        • new_tokens: New tokens if they were refreshed.

7. Foreigner Identity Info

  • identity_foreigners(tokens: Optional[JibitTokens], fida: str)
    • Purpose: Retrieves identity information for a foreigner based on their FIDA number.
    • Inputs:
      • fida: The foreigner identity number.
      • tokens: The current JibitTokens for authentication (optional).
    • Outputs:
      • A tuple containing:
        • A ForeignerIdentityInfo instance with detailed information about the foreigner.
        • new_tokens: New tokens if they were refreshed.

8. Corporation Identity Info

  • identity_corporation(tokens: Optional[JibitTokens], code: str)
    • Purpose: Retrieves identity information for a corporation based on its code.
    • Inputs:
      • code: The corporation identity code.
      • tokens: The current JibitTokens for authentication (optional).
    • Outputs:
      • A tuple containing:
        • A CorporationIdentityInfo instance with detailed information about the corporation.
        • new_tokens: New tokens if they were refreshed.

9. Military Service Qualification

  • military_qualification_info(tokens: Optional[JibitTokens], national_code: str)
    • Purpose: Retrieves military service qualification information for an individual based on their national code.
    • Inputs:
      • national_code: The national code.
      • tokens: The current JibitTokens for authentication (optional).
    • Outputs:
      • A tuple containing:
        • A militaryServiceQualificationInfo instance with the military qualification status.
        • new_tokens: New tokens if they were refreshed.

10. Account Balances

  • account_balances(tokens: Optional[JibitTokens])
    • Purpose: Retrieves the balances of accounts associated with the authenticated user.
    • Inputs:
      • tokens: The current JibitTokens for authentication (optional).
    • Outputs:
      • A tuple containing:
        • A list of Balance instances representing account balances.
        • new_tokens: New tokens if they were refreshed.

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

jibit-1.2.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jibit-1.2.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file jibit-1.2.1.tar.gz.

File metadata

  • Download URL: jibit-1.2.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for jibit-1.2.1.tar.gz
Algorithm Hash digest
SHA256 0ed59fefb12c3780745c3e1d85b198a06294f0033b7a5f3d745a27afea15bda7
MD5 fa5c305f55ed3da5aa53e41cef315b62
BLAKE2b-256 face8784601769c7b8959e022784e4a7c3bffd7e4e69bc7b32c6d579943f3af8

See more details on using hashes here.

File details

Details for the file jibit-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: jibit-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for jibit-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 28611202a9f894e2273982cefd8899b7b409369adf44178b9b93c8c638a25ae0
MD5 59f0a180a178f259e351cfe7b0b5f2c6
BLAKE2b-256 c1b493696808493c9c1ab000974811a6c208ae10bf83a00c327ee51ab115b355

See more details on using hashes here.

Supported by

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