A Python module to detect and format system localization information.
Project description
localemembers
Module Documentation
Welcome to the documentation for the localemembers
module. This Python module is designed to detect and format system localization information using the locale
module. It also provides an elegant and sleek graphical interface to display this information to the user.
Table of Contents
Installation
Automatic Installation via PyPI
You can install the localemembers
module using pip:
pip install localemembers
Manual Installation via GitHub
For a local installation, you can clone the GitHub repository and install the module in development mode:
-
Clone the repository:
git clone https://github.com/yourusername/localemembers.git
-
Navigate to the project directory:
cd localemembers
-
Install the module in development mode:
pip install -e .
Usage
Here is an example of how to use the localemembers
module to obtain and display system localization information:
Running the Main Function
The main function prints the system's locale information to the console.
import localemembers
# To run the main function
localemembers.main()
Running the Graphical Interface
The graphical interface displays the system's locale information in a user-friendly window.
import localemembers
# To run the graphical interface
localemembers.gui_main()
Features
The localemembers
module provides the following features:
- Detection and formatting of localization information:
locale
: System locale.encoding
: Locale encoding.language
: Locale language.country
: Locale country.language_code
: Language code.country_code
: Country code.language_country_code
: Formatted language code.currency_symbol
: Currency symbol.decimal_point
: Decimal point.thousands_separator
: Thousands separator.date_format
: Date format.time_format
: Time format.radix_char
: Radix character.thousands_sep
: Thousands separator.yes_expr
: Regular expression for "yes".no_expr
: Regular expression for "no".currency_str
: Currency string.era
: Era.era_d_t_fmt
: Era-based date/time format.era_d_fmt
: Era-based date format.era_t_fmt
: Era-based time format.alt_digits
: Alternative digits.
Detailed Description of Features
- System Locale: The locale setting of the system, which includes language and country information.
- Locale Encoding: The character encoding used by the locale.
- Locale Language: The language part of the locale.
- Locale Country: The country part of the locale.
- Language Code: A short code representing the language (e.g., 'en' for English).
- Country Code: A short code representing the country (e.g., 'US' for the United States).
- Formatted Language Code: A combination of the language and country codes (e.g., 'en_US').
- Currency Symbol: The symbol used for currency in the locale (e.g., '$' for USD).
- Decimal Point: The character used as a decimal point in the locale.
- Thousands Separator: The character used to separate thousands in numbers.
- Date Format: The format used for dates in the locale.
- Time Format: The format used for times in the locale.
- Radix Character: The character used as a radix point (decimal point).
- Regular Expressions for Yes/No: Regular expressions used to recognize positive and negative responses.
- Currency String: A string representing the currency, including its position relative to the value.
- Era Information: Information about eras used in the locale (if applicable).
- Era-Based Date/Time Formats: Formats for dates and times based on eras.
- Alternative Digits: Symbols used to represent digits in the locale.
Graphical Interface
The localemembers
module includes an elegant and sleek graphical interface, created with PyQt5, to display localization information to the user. The graphical interface is maximized at startup and the components are dynamic.
Example of the Graphical Interface
import localemembers
# To run the graphical interface
localemembers.gui_main()
Graphical Interface Features
- Maximized Window: The window is maximized at startup for better visibility.
- Dynamic Components: The components in the interface are dynamic and update based on the system's locale information.
Description of Files
localemembers/__init__.py
: Initializes thelocalemembers
module.localemembers/locale_members.py
: Contains the main functionality for detecting and formatting localization information.localemembers/gui.py
: Contains the code for the graphical interface.tests/__init__.py
: Initializes the test module.tests/test_locale_members.py
: Contains unit tests for thelocalemembers
module..gitignore
: Specifies files and directories to be ignored by Git.LICENSE
: Contains the license information for the project.localemembers.tr
: Translation file (if applicable).main.py
: Main script to run the module.README.md
: Contains the documentation for the project.requirements.txt
: Lists the dependencies required for the project.setup.py
: Contains the setup configuration for the project.
Contributing
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository on GitHub.
- Create a new branch for your feature or bugfix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your forked repository.
- Open a pull request on the main repository.
Please ensure that your code adheres to the project's coding standards and passes all tests.
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
File details
Details for the file localemembers-1.1.1.tar.gz
.
File metadata
- Download URL: localemembers-1.1.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b497073b33c9ad876c94f01b0b5afe772f17bacb875583e59739f52815813663 |
|
MD5 | 13049b240bc56427f5f390d9573edcf1 |
|
BLAKE2b-256 | 56915eb3ebf4273ab7305b1f94bb564e37f9bcc0fdb6cba204dd431fd4775c19 |
File details
Details for the file localemembers-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: localemembers-1.1.1-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74c5ce4d9f9b92f8980f6c1c84465bf662d3841b4a8a7405675031cb04372089 |
|
MD5 | d130b85bdaa72565f4a97272615020d1 |
|
BLAKE2b-256 | a8fe4f9634a5c34ef7302c8a149d03050c77699e84daad732349e56964cb163e |