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!
Metadata
Release files for frformat 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| frformat-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Release files / frformat-0.5.0-py3-none-any.whl
| Download URL | frformat-0.5.0-py3-none-any.whl |
|---|---|
| Size | 804.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7f8763598b702ad62e33d4587f669a9f8cd92dd86cf24efa8524fd8d92b88f0
|
|
BLAKE2b-256 checksum How to use checksums |
416e297b9511d5b84beb4daeef8e4eb45c0b362cdde5d5000da16a959eed3f76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|