Skip to main content

An Agnostic, Zero-Boilerplate Locale Resource Discovery & Lifecycle Engine

Project description

rokeeru

多言語ロケールリソース自動検出・パース・キャッシュ管理エンジン (Python) / Multi-language Locale Resource Discovery, Parsing, and Caching Engine for Python

License: MIT Python

日本語 | English


日本語

概要

rokeeru は、Python アプリケーション(FastAPI, Flask, Django 等)において、ディレクトリ内の多言語ロケールファイル(JSON, YAML, TOML)を自動検出・ロード・キャッシュし、未翻訳キーのフォールバック補填を提供するライブラリです。 Rust コアエンジンを PyO3 ネイティブバインディングを介して呼び出すことで、高速かつ安全なデータリソース管理を実現します。

インストール

pip install rokeeru

使い方

from rokeeru import RokeeruLoader

# ディレクトリパスとデフォルト言語(フォールバック用)を指定して初期化
loader = RokeeruLoader("./locales", "en")

# ロケールファイルを読み込み
loader.load()

# 利用可能なロケールコード一覧を取得
print(loader.languages())  # ['en', 'ja', 'fr']

# 指定ロケールの翻訳データ(Python 辞書型)を取得
ja_data = loader.get("ja")
print(ja_data)

LICENSE

このプロジェクトのライセンスは MIT ライセンスです。詳しくは LICENSE.MIT をお読みください。また、サードパーティライセンスは NOTICE.md に表記してあります。


English

Overview

rokeeru is a library for Python applications (FastAPI, Flask, Django, etc.) that automatically discovers, loads, caches, and provides key-level fallback for multi-language locale files (JSON, YAML, TOML) in a directory. Powered by a Rust core engine via PyO3 native bindings, it delivers high-performance, thread-safe resource management.

Installation

pip install rokeeru

Usage

from rokeeru import RokeeruLoader

# Initialize with locales directory path and default fallback language
loader = RokeeruLoader("./locales", "en")

# Load locale files
loader.load()

# Get list of available locale codes
print(loader.languages())  # ['en', 'ja', 'fr']

# Retrieve parsed locale data for a specific language
ja_data = loader.get("ja")
print(ja_data)

LICENSE

This project is licensed under the MIT License. See LICENSE.MIT for details. Third-party licenses are documented in NOTICE.md.

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

rokeeru-0.1.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

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

rokeeru-0.1.1-cp37-abi3-win_amd64.whl (477.6 kB view details)

Uploaded CPython 3.7+Windows x86-64

File details

Details for the file rokeeru-0.1.1.tar.gz.

File metadata

  • Download URL: rokeeru-0.1.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for rokeeru-0.1.1.tar.gz
Algorithm Hash digest
SHA256 06ffb1211962630f3dae96f8feababcbe17ecfcb8dd8042f7247147bb55f2c05
MD5 abd74946d0588d425bb601ece4e4a872
BLAKE2b-256 764771b1ee9f24cd636c8e16946b3fb3e558d68001500da374ce028e1d84a7c1

See more details on using hashes here.

File details

Details for the file rokeeru-0.1.1-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: rokeeru-0.1.1-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 477.6 kB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for rokeeru-0.1.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d6ed21161661b30b966e24800bd9db4ece7198a6ec0f69c5098b1d2360c3eec8
MD5 054abd554e5456bba9c8e42197980f83
BLAKE2b-256 d5c603ee2d3e9942758aa2a1cadca486afbd7f8e50e1ad5317dfe5f8d80f6861

See more details on using hashes here.

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