🧩 PyLocres
PyLocres is a Python library for reading, writing, and editing .locres and .locmeta files used in Unreal Engine's localization system.
Supports all known versions of Locres, including the latest.
📦 Installation
Install from PyPI:
pip install pylocres
Or install directly from the repository:
git clone https://github.com/stas96111/pylocres.git
cd pylocres
pip install -r requirements.txt
pip install .
🛠️ Command Line Tool
# Show info about a .locres file
pylocres info --path example.locres
# Convert .locres to .csv
pylocres to-csv --path example.locres --out output.csv
# Convert .csv to .locres
pylocres from-csv --path output.csv --out result.locres
# Convert .locres to .po
pylocres to-po --path example.locres --out output.po
# Convert .po to .locres
pylocres from-po --path output.po --out result.locres
📘 Usage: Locres
from pylocres import LocresFile, Namespace, Entry, LocresVersion, entry_hash
# Create Locres file instance
locres = LocresFile()
# Read a .locres file
locres.read("path/to/file.locres")
# Iterate over all namespaces
for namespace in locres:
print("Namespace:", namespace.name or "<default>")
# Iterate over all entries in the namespace
for entry in namespace:
print("Key:", entry.key) # cf433749-2e... (uuid4 or custom key)
print("Translation:", entry.translation) # Hello world!
print("Source Hash:", entry.hash) # 828975897
# Set a new translation
entry.translation = "Привіт світ!"
# Optionally, recalculate source hash
entry.hash = entry_hash("Hello world!")
# Create a new entry and add it to a namespace
new_entry = Entry("my_key", "My translation", entry_hash("My source"))
namespace.add(new_entry)
# Add a new namespace
new_namespace = Namespace("UI")
locres.add(new_namespace)
# Set file format version (default: CityHash)
locres.version = LocresVersion.CityHash
# Save the modified locres file
locres.write("path/to/output.locres")
# Done
Locmeta Usage
from pylocres import LocmetaFile, LocmetaVersion
# Create Locmeta file instance
locmeta = LocmetaFile()
# Read a .locmeta file
locmeta.read("path/to/file.locmeta")
# View metadata
print("Version:", locmeta.version)
print("Native culture:", locmeta.native_culture) # en
print("Native locres path:", locmeta.native_locres) # en/Game.locres
print("Compiled cultures:", locmeta.compiled_cultures) # ["en", "de", "fr", ...]
# Modify metadata
locmeta.native_culture = "uk"
# Save changes
locmeta.write("path/to/output.locmeta")
# Done
License
MIT License © 2025 stas96111
Metadata
Release files for pylocres 0.2
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 | Actions |
|---|---|---|---|---|
| pylocres-0.2.tar.gz | 14.6 kB | Without provenance | Details for pylocres-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pylocres-0.2-py3-none-any.whl | Python 3 | none | any | Details for pylocres-0.2-py3-none-any.whl |
Total release size: 27.6 kB
Release files / pylocres-0.2.tar.gz
| Download URL | pylocres-0.2.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fc9872e95f8ec6e1ef4d362702ef0c1ccf6df23ea15da1d0287371c33b4afb3
|
|
BLAKE2b-256 checksum How to use checksums |
778d2c0ac0d660fcfb530d4f6da983d411850098cd896844855416eb34a2222d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Release files / pylocres-0.2-py3-none-any.whl
| Download URL | pylocres-0.2-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f217d317c162a0e4f13135f88682e61aaed0cfd26b7e6d02212aef7338f473bc
|
|
BLAKE2b-256 checksum How to use checksums |
80a8eccbcf8a8741e5b36edd20795fdaf2879cfc90e8137f7eca4a178cb2798d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Security for pylocres 0.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.