A small library specialising in convenient localisation
Project description
Vesna
Description
A lightweight library specialized in convenient localization (i18n).
Installation
Via uv (recommended):
uv pip install vesna— Minimaluv pip install vesna[all]— Full
Via pip:
python -m pip install vesna— Minimalpython -m pip install vesna[all]— Full
Quick Start
import vesna
async def main():
await vesna.i18n.load_file(
vesna.providers.ProviderJSON(), "uk", "tests/localisation/{locale_code}.json"
)
l = vesna.Locale("uk")
print(l["vesna"])
print(l("hello", l.get("world")))
Features
- Support for multiple localization formats
- Convenient syntax with
[]and()support Babelintegration
Usage
Providers
FluentProvider: Fluent format (requiresfluent.runtime).GettextProvider: GNU Gettext format (requiresBabel).ProviderJSON: JSON format (usespydantic_core, requirespydantic).ProviderJSON5: JSON5 format (requiresjson5orpyjson5).ProviderHJSON: HJSON format (requireshjson).ProviderTOML: TOML format (requiresrtoml).ProviderYAML: YAML format (requiresruamel.yaml).
Creating a custom Vesna instance
import vesna
v = vesna.Vesna()
# Set as the global default object
v.default_object = v
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vesna-1.0.2.tar.gz.
File metadata
- Download URL: vesna-1.0.2.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c01b9bc2bfc76a0f8fcac6efdd53ad330b32222d29e69ee0dbb0acac4262e047
|
|
| MD5 |
57daf0374b094ee0a342fe750d188dac
|
|
| BLAKE2b-256 |
831c1ae47de7dc371774a8a94975aedfc4b668562881581d73f84a847247bda4
|
Provenance
The following attestation bundles were made for vesna-1.0.2.tar.gz:
Publisher:
ci.yml on BRamil0/vesna
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vesna-1.0.2.tar.gz -
Subject digest:
c01b9bc2bfc76a0f8fcac6efdd53ad330b32222d29e69ee0dbb0acac4262e047 - Sigstore transparency entry: 1139744178
- Sigstore integration time:
-
Permalink:
BRamil0/vesna@63bdd1aa0f24013c001e7a82fad81b896b4c9fb9 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/BRamil0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@63bdd1aa0f24013c001e7a82fad81b896b4c9fb9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file vesna-1.0.2-py3-none-any.whl.
File metadata
- Download URL: vesna-1.0.2-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3e63e9cbd7f741d282efe9619cadc8cda7712c24fece588b0a95d0f48f734ca
|
|
| MD5 |
db461216b0b6f2ab139a8a5f5a386920
|
|
| BLAKE2b-256 |
bddac49256754a343158542fce294fcfab96953709bda19f786e0116a97a0664
|
Provenance
The following attestation bundles were made for vesna-1.0.2-py3-none-any.whl:
Publisher:
ci.yml on BRamil0/vesna
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vesna-1.0.2-py3-none-any.whl -
Subject digest:
f3e63e9cbd7f741d282efe9619cadc8cda7712c24fece588b0a95d0f48f734ca - Sigstore transparency entry: 1139744234
- Sigstore integration time:
-
Permalink:
BRamil0/vesna@63bdd1aa0f24013c001e7a82fad81b896b4c9fb9 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/BRamil0
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@63bdd1aa0f24013c001e7a82fad81b896b4c9fb9 -
Trigger Event:
push
-
Statement type: