urban-json-random
Plugin urban-json : données aléatoires dans
les templates, via les 25 fonctions getrandom_* du moteur .NET d'origine (port de
Services.randoms.cs). Utile pour produire des jeux de test réalistes.
Installation
pip install urban-json-random # tire urban-json, Faker et rstr
Rien d'autre à faire : urban-json découvre le plugin automatiquement via les entry
points (urban_json.functions).
Utilisation
from urban_json import JsltTemplate
tpl = JsltTemplate.parse("""{
"id": getrandom_integer(1, false, 1000, false),
"client": getrandom_fullname(),
"email": getrandom_email(),
"iban": getrandom_iban("FR"),
"ref": getrandom_string(0, 0, "^[A-Z]{3}-\\\\d{4}$")
}""")
tpl.transform({})
# -> {'id': 417, 'client': 'Jane Doe', 'email': '…', 'iban': 'FR76…', 'ref': 'QZT-0381'}
Fonctions
| Famille | Fonctions |
|---|---|
| Nombres | getrandom_integer, getrandom_long, getrandom_short, getrandom_byte, getrandom_double, getrandom_float — (minimum, exclusiveMinimum, maximum, exclusiveMaximum) |
| Texte | getrandom_string(min_length, max_length, pattern), getrandom_lipsum(paragraphs), getrandom_password(token, length), getrandom_naughtystrings() |
| Personnes | getrandom_firstname, getrandom_lastname, getrandom_fullname, getrandom_email |
| Lieux | getrandom_city, getrandom_country |
| Réseau | getrandom_ipv4, getrandom_ipv6, getrandom_macaddress(minimum, maximum) |
| Banque | getrandom_iban(pays, include_iban, include_bban) |
| Temps | getrandom_datatime() (nom d'origine conservé), getrandom_timespan() |
| Divers | getrandom_boolean(), getrandom_binary(min_length, max_length), getrandom_in_list(items) |
Écarts volontaires avec le .NET
exclusiveMinimum/exclusiveMaximumexcluent la borne (sens JSON Schema) ; le .NET élargissait au contraire l'intervalle.- Sans bornes : étendue du type (
integer0 à 2³¹−1,doubledans [0, 1)…) ; le .NET générait souvent toujours 0. - Intervalle impossible : erreur
JsltErrorexplicite. getrandom_booleanetgetrandom_in_listfont un vrai tirage (le .NET prenait la parité des millisecondes) ; liste vide →null.getrandom_passwordutilise un générateur cryptographique (secrets).- Dates et durées en texte : ISO 8601 et
hh:mm:ss.fff.
Metadata
Release files for urban-json-random 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| urban_json_random-0.1.0.tar.gz | 12.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| urban_json_random-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.0 kB
Release files / urban_json_random-0.1.0.tar.gz
| Download URL | urban_json_random-0.1.0.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
987b83d391121e7de7e856b9dff4f47467529cda704ab6f4f37998acd617fbce
|
|
BLAKE2b-256 checksum How to use checksums |
57506e7b438bdf73e75ae3ea9a820c73ee0f3e05fc20b8aa381a8c06dcd2b97c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / urban_json_random-0.1.0-py3-none-any.whl
| Download URL | urban_json_random-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9cc13415e70cf52e927d03408c77996b934bc37c63928532e6bcdb5865065619
|
|
BLAKE2b-256 checksum How to use checksums |
5d40b568f04ad960cce68de41cce240cacea38ca0e5e305190f48cae940c4ba0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for urban-json-random 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for urban_json_random-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.