Skip to main content

Detect language and country from text

Project description

lang2country

A Python package to detect language and country from text.


Project Installation

Install dependencies using Poetry

    poetry install

Running Tests:

This project uses the standard unittest framework. You can run all tests using Poetry

    poetry run python -m unittest discover tests

PKG Installation

Install using pip:

    pip install lang2country

PKG Building and Uploading

1️⃣ Update version on pyproject.toml

    [project]
    name = "lang2country"
    version = "1.0.0"

2️⃣ Building

    poetry build

3️⃣ Publishing on Pypi

    poetry config pypi-token.pypi pypi-YOUR_TOKEN_HERE
    poetry publish

PKG Usage

1️⃣ Detect Language

    from lang2country import detect_language
    
    lang = detect_language("Hello my name is lang2country")
    print(lang)
    # Output: en

2️⃣ Detect Country

    from lang2country import detect_country
    
    country = detect_country("Hello my name is lang2country")
    print(country)
    # Output: United States

Dependency

This package uses:

python >=3.8
langdetect >=1.0.9

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

lang2country-1.0.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

lang2country-1.0.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file lang2country-1.0.1.tar.gz.

File metadata

  • Download URL: lang2country-1.0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.12 Windows/11

File hashes

Hashes for lang2country-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9979f0fa14b33ec57453e422e090ac50648a938e250e5335f97bf24ce2004548
MD5 3a19a182d5787f3298cbd8ddb19f5d5f
BLAKE2b-256 0d1240582fc06621cbabde8eedaae6961455be0b8aff682d25e73396ed461304

See more details on using hashes here.

File details

Details for the file lang2country-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: lang2country-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.13.12 Windows/11

File hashes

Hashes for lang2country-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42cef4977a6e0d21a38cf7f01b6bd863b96d925d8b78363525102faa2a7b5969
MD5 e1fa510b9c9336920159b51ab16017a1
BLAKE2b-256 0d81c55a3cc08350962ccfc28fbbe94a2608cdba2ca7f640576e4b2cdd2ceda6

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