Skip to main content

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

  1. Installation
  2. Usage
  3. Features
  4. Graphical Interface
  5. Project Structure
  6. Contributing
  7. License

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:

  1. Clone the repository:

    git clone https://github.com/yourusername/localemembers.git
    
  2. Navigate to the project directory:

    cd localemembers
    
  3. 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.
  • User-Friendly Layout: The layout is designed to be user-friendly and easy to navigate.

Project Structure

The localemembers project has the following structure:

localemembers/
├── localemembers/
│   ├── __init__.py
│   ├── locale_members.py
│   ├── gui.py
├── tests/
│   ├── __init__.py
│   └── test_locale_members.py
├── .gitignore
├── LICENSE
├── localemembers.tr
├── main.py
├── README.md
├── requirements.txt
└── setup.py

Description of Files

  • localemembers/__init__.py: Initializes the localemembers 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 the localemembers 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:

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bugfix.
  3. Make your changes and commit them with descriptive messages.
  4. Push your changes to your forked repository.
  5. 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


Download files

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

Source Distribution

localemembers-1.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

localemembers-1.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file localemembers-1.1.0.tar.gz.

File metadata

  • Download URL: localemembers-1.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for localemembers-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0516f3d1aa50593bfa8aedf54ecc7d891b89215ee2185997d293bcd2be590c9a
MD5 6ffdc2c94216871de9084c55aea5dd61
BLAKE2b-256 49ddcaa412136fdd44d72b260360f41b95ddec4ae4f596746d9ae5b7161d8767

See more details on using hashes here.

File details

Details for the file localemembers-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for localemembers-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b47a4d0822f68960547bc251d317988be6a2c3c774baeb185e222c827ee5573
MD5 cd349bdc389ae3b08be5d9bad8617f16
BLAKE2b-256 52bb2fded79ebcf3b4658ea9da75298a63b5564a9bd47e076893f4aa11118bee

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page