Skip to main content

LangStr

langstr (or, Language String) is a library created for the express purpose of getting resources from a existing language file and being used as strings. It's really lightweight, requiring absolutely no other libraries, and having little to a single class that handles most logic. Inspired by BombSquad's Lstrs.
In terms of usage, you'd first want to set the path of where your language files are:

import langstr
langstr.set_path('path\to\your\languages_folder')

Then, it's as simple as creating a LangStr object.

langstr.LangStr(resource='myCoolResource')
# or, if you prefer:
langstr.LangStr(r='myCoolResource')

LangStr's also support subs, which allow you to replace certain values of the resource (eg. ${NAME}) to another string.

langstr.LangStr(resource='myCoolResourceWithValues', subs=[ ('${NAME}', 'John') ])
# Assuming myCoolResourceWithValues is 'Welcome, ${NAME}', full text will be 'Welcome, John'

Then, whenever you want an actually usable string, just evaluate (or stringify) the LangStr object.

mylangstr = langstr.LangStr(resource='myCoolResource')
print(mylangstr.evaluate())
# or;
print(str(mylangstr))
# both will output something like 'Hello!', 
# or whatever your resource says

Metadata

Release files for langstr 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langstr 0.1.1
File Size Uploaded Provenance Actions
langstr-0.1.1.tar.gz 4.1 kB Without provenance Details for langstr-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langstr 0.1.1
File Interpreter ABI Platform Actions
langstr-0.1.1-py3-none-any.whl Python 3 none any Details for langstr-0.1.1-py3-none-any.whl

Total release size: 8.5 kB

Release files / langstr-0.1.1.tar.gz

Download URL langstr-0.1.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e0a7214b9fba21a6b32b889074c4cf546020cbc710ceee51f335394ea05ab248
BLAKE2b-256 checksum
How to use checksums
93e15e3e611a5e4f9a71a01881e857e332fa431088e0ad9aa2cd7c5971cd3ed1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / langstr-0.1.1-py3-none-any.whl

Download URL langstr-0.1.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8ae68009f861fe8664ea75a1aea312c7c10590819c48cd9f387dc3121e66239
BLAKE2b-256 checksum
How to use checksums
1c4013b1cc4548a71f0b9a93c45b1c78efa8ebd5ea526f49c3ee1a63b583b6fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for langstr 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page