Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
.. image:: https://travis-ci.com/anka-sirota/localflavor.svg?branch=master :target: https://travis-ci.com/anka-sirota/localflavor
This package is a derivative of django-localflavor <https://github.com/django/django-localflavor>
_ and a work in progress.
This package does not depend on Django, and currently only contains postal codes validators, lists of country states and provinces and calling (dial in) codes.
Installation ^^^^^^^^^^^^
.. code-block:: bash
pip install localflavor
Example usage ^^^^^^^^^^^^^
Postal code validation """"""""""""""""""""""
.. code-block:: python
from localflavor.generic.validators import validate_country_postcode validate_country_postcode('1000AA', 'NL') '1000 AA' validate_country_postcode('0888', 'US') Traceback (most recent call last): File "", line 1, in File "../localflavor/generic/validators.py", line 453, in validate_country_postcode return validator.clean(value) File "../localflavor/base.py", line 71, in clean value = super(RegexValidator, self).clean(value) File "../localflavor/base.py", line 48, in clean raise ValidationError(self.error_messages['invalid']) localflavor.exceptions.ValidationError: Enter a valid ZIP code in the format XXXXX or XXXXX-XXXX.
Calling codes """""""""""""
.. code-block:: python
from localflavor.generic.countries.calling_codes import CALLING_CODES CALLING_CODES.get('US') '+1' CALLING_CODES.get('RU') '+7' CALLING_CODES.get('NL') '+31'
FAQs
Country-specific validation helpers, ported from Django Localflavor
We found that localflavor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.