Skip to main content

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 — Minimal
  • uv pip install vesna[all] — Full

Via pip:

  • python -m pip install vesna — Minimal
  • python -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
  • Babel integration

Usage

Providers

  • FluentProvider: Fluent format (requires fluent.runtime).
  • GettextProvider: GNU Gettext format (requires Babel).
  • ProviderJSON: JSON format (uses pydantic_core, requires pydantic).
  • ProviderJSON5: JSON5 format (requires json5 or pyjson5).
  • ProviderHJSON: HJSON format (requires hjson).
  • ProviderTOML: TOML format (requires rtoml).
  • ProviderYAML: YAML format (requires ruamel.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


Download files

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

Source Distribution

vesna-1.0.1.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

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

vesna-1.0.1-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file vesna-1.0.1.tar.gz.

File metadata

  • Download URL: vesna-1.0.1.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vesna-1.0.1.tar.gz
Algorithm Hash digest
SHA256 8f9181313bdbb56247af7679d7225f10a50f8ff24084065fc2c97acc662e585f
MD5 15cacdf8a13410216c2cdd224ee7de33
BLAKE2b-256 c0d5e76b2ca039baa2b02685fb97b9e4b2208de3d52b8672be04a090e323c703

See more details on using hashes here.

Provenance

The following attestation bundles were made for vesna-1.0.1.tar.gz:

Publisher: ci.yml on BRamil0/vesna

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vesna-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: vesna-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for vesna-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 140c75c9d626e3be2ab6e93efd00cd0596247dc308ce1fef5e68e8c43bf9e23f
MD5 04ba0c34a7d27325f96e42acc3396961
BLAKE2b-256 d61c55be6129cdf110e064120aa94c86e341bf4f1f76e0de5fc35ae56c1f37b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for vesna-1.0.1-py3-none-any.whl:

Publisher: ci.yml on BRamil0/vesna

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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