Skip to main content

Validation of strings regarding French formats

Project description

Fr-format

The standard library fr-format provides a collection of validators to check data against typical French formats.

It has been initially developed for sharing validation functions between these two projects:

Available formats

Check out this documentantion that lists all available formats.

Installation

The package is published on PyPI. Install with :

pip install frformat

Usage

User story

As a fr-format user, specifically a developer or data scientist, you may need to validate a value according to a given French format. This feature enables you to easily verify whether your data is valid or not.
Additionally, this project allows you to retrieve the entire set of valid values when applicable. For example, this can be useful in a frontend to display the complete set (e.g. in a dropdown menu).

Here's an example of how to use fr-format:

from frformat import Departement, Options, Millesime

print(Departement.description())

_options = Options(
    ignore_case=True,
    ignore_accents=True,
    ignore_extra_whitespace=True
)
Departement(Millesime.LATEST, _options).is_valid("haute-vienne")
# True
Departement(Millesime.M2023, _options).is_valid("Canyon Cosmo")
# False

For more details, consult the Options data class.

For better performance on big amounts of data, use in conjunction with numpy.

Contributing

Found a bug, want to propose a feature or a new format? See the contribution guidelines on how to proceed!

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

frformat-0.4.2.dev17-py3-none-any.whl (804.3 kB view details)

Uploaded Python 3

File details

Details for the file frformat-0.4.2.dev17-py3-none-any.whl.

File metadata

  • Download URL: frformat-0.4.2.dev17-py3-none-any.whl
  • Upload date:
  • Size: 804.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for frformat-0.4.2.dev17-py3-none-any.whl
Algorithm Hash digest
SHA256 57dfec9fabc29df1f2190c0d50158e422054ee4f698e855bce1b9b68a09c8c21
MD5 3052cd979948462b9e9eaab5fff14de8
BLAKE2b-256 e69e3695892670d5f3f4d4dc9b54ad0662a889bcb52d683200fb046941effccb

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