معرفی شرکت ها


cpr-generator-0.2.2


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

An unofficial tool for generating and verifying Danish CPR-numbers.
ویژگی مقدار
سیستم عامل -
نام فایل cpr-generator-0.2.2
نام cpr-generator
نسخه کتابخانه 0.2.2
نگهدارنده []
ایمیل نگهدارنده []
نویسنده -
ایمیل نویسنده HackTheOxidation <tomas.hagenau@protonmail.ch>
آدرس صفحه اصلی -
آدرس اینترنتی https://pypi.org/project/cpr-generator/
مجوز Copyright (c) 2023 HackTheOxidation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# `cpr-generator` - An Unofficial library and tool for generating and verifying Danish CPR-numbers. This project contains a library and some CLI-tools for generating, manipulating and verifying Danish CPR-numbers, called "personnummer" or "CPR-nummer" in Danish, as defined by the Danish authority ["Det Centrale Personregister"](https://cpr.dk/cpr-systemet/opbygning-af-cpr-nummeret). ## Disclaimer This is a community project that is NOT indorsed by the Danish authorities and should not be used as a reference. ## Getting Started This is available on PyPI via. `pip` which includes both the library and the CLI-tools. Simply install with the command: ```sh pip install -U cpr-generator ``` ### Using the Library The library contains a few different modules. Most important are the `cpr_verifier` and the `generator` modules. The `cpr_verifier` contains three functions: - `is_leap_year`: takes a year (`int`) checks whether the year is a leap year. - `is_cpr_number`: takes a potential CPR-number (`str`) and checks that it fulfills the format: `DDMMYY(-)NNNN`. - `satisfies_mod11` takes a potential CPR-number (`str`), checks that it fulfills both the format: `DDMMYY(-)NNNN` and the Modulus-11 control condition. ### Using the CLI-tools #### `cpr-gen` This is a simple CLI tool that can generate random CPR-numbers, with or without hyphens. Example usage: ```sh cpr-gen -n 1000 -m False --hyphen True ``` The above generates a thousand CPR-numbers with hyphens, not satisfying the Modulus-11 control condition. #### `cpr-server` This CLI-tools starts a HTTP server (using `flask`) on port 5000 that can generate random CPR-numbers on demand. Simply run: ```sh cpr-server ``` And the server should be available at `localhost:5000`. The server has the following available URL endpoints: - `/`: Returns a random CPR-number (no hyphen) - `/no-mod11/`: Returns a random CPR-number (no hyphen), not satisfying Modulus-11. - `/hyphen/`: Returns a random CPR-number (with hyphen) - `/no-mod11/hyphen/`: Returns a random CPR-number (with hyphen), not satisfying Modulus-11. - `/<int:number>/`: Returns `number` random CPR-numbers (no hyphen) - `/no-mod11/<int:number>/`: Returns `number` random CPR-numbers (no hyphens), not satisfying Modulus-11. - `/hyphen/<int:number>/`: Returns `number` random CPR-numbers (with hyphens) - `/no-mod11/hyphen/<int:number>/`: Returns `number` random CPR-numbers (with hyphens), not satisfying Modulus-11. #### `cpr-verify` This CLI-tool can be used to check the input fulfills the format of a CPR-number, with or without hyphen, and whether or not the input satisfies the Modulus-11 control condition. Example usage: ```sh cpr-verify 111111-1118 # --> True ``` The above verifies that the input `111111-1118` fulfills the CPR-number format.


نیازمندی

مقدار نام
- flask
- markupsafe


زبان مورد نیاز

مقدار نام
>=3.10 Python


نحوه نصب


نصب پکیج whl cpr-generator-0.2.2:

    pip install cpr-generator-0.2.2.whl


نصب پکیج tar.gz cpr-generator-0.2.2:

    pip install cpr-generator-0.2.2.tar.gz