Skip to main content

No project description provided

Project description

iyg_tools

iyg_tools is a Python package for validating and generating Turkish Citizen Numbers (TCKN). The TCKN is a unique identification number used in Turkey, consisting of 11 digits. This package provides two main features:

  • Validate TCKN: Check if a given TCKN is valid based on the Turkish government algorithm.
  • Generate TCKN: Produce a random but valid TCKN.

Installation

You can install iyg_tools from PyPI using pip:

pip install iyg_tools

Usage

Once installed, you can use iyg_tools to validate and generate TCKNs.

Validate TCKN

To validate a TCKN, use the verify function. It takes a TCKN as input and returns a dictionary indicating whether the TCKN is valid.

Example:

from tckn_app import verify

result = verify('12345678901')
print(result)

Output:

{'status': True, 'message': "'12345678901' verified!"}

If the TCKN is invalid, the dictionary will contain an error message:

{'status': False, 'error': "'12345678901' not verified!"}

Generate TCKN

To generate a valid TCKN, use the generate function. It returns a valid TCKN as an integer.

Example:

from tckn_app import generate

tckn = generate()
print(tckn)

Output:

12345678901

Functions

verify(tckn)

Validates the provided TCKN.

Parameters:

  • tckn (str or int): The TCKN to validate.

Returns:

  • dict: A dictionary with the validation status and message. If valid, status is True with a success message. If invalid, status is False with an error message.

generate()

Generates a valid TCKN.

Returns:

  • int: A valid TCKN.

Example

Here's a complete example demonstrating both functionalities:

from tckn_app import verify, generate

# Generate a valid TCKN
valid_tckn = generate()
print(f"Generated TCKN: {valid_tckn}")

# Validate the generated TCKN
validation_result = verify(valid_tckn)
print(validation_result)

License

This package is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! If you find a bug or have suggestions for improvements, please submit a pull request or open an issue.

Author

This package is maintained by Your Name.

Project Links

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

iyg_tools-1.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

iyg_tools-1.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file iyg_tools-1.0.1.tar.gz.

File metadata

  • Download URL: iyg_tools-1.0.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.1

File hashes

Hashes for iyg_tools-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f85008268b5227b882adc4e61f5156e1071732271a7505ca65f0c60eff8d16cf
MD5 8d4e86159cbefa32431f17695855a2a1
BLAKE2b-256 026ea377c7fd3f7cae718812b0586e82526e50de21e4e8d53608936660af0912

See more details on using hashes here.

File details

Details for the file iyg_tools-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: iyg_tools-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.1

File hashes

Hashes for iyg_tools-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c94a752c542536372d40b23dacc25d3daf757a7a1d3635e8abe3bd15428162ef
MD5 51f28e942b6ea9025e2cbb0030c8dd4a
BLAKE2b-256 3cad5b9fb4900a6e1055f00475bd756c3eda6833448b68d1b0100181d4edf738

See more details on using hashes here.

Supported by

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