Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

lingua-py

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lingua-py

Python bindings for the Lingua(LanguageDetect) Rust library

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
1

lingua

Static Badge build status PyPI - Version license


Lingua-py

Lingua-py is an Python wrapper for the Rust lingua crate with PyO3/Maturin.

Summary

Lingua is a NIF-based bridge for the lingua Rust language detection library.

Usage

In imitation of Upstream, introduce basic usage. Alternatively please see tests section.

10.1 Basic usage

    languages: list[Language] = [Language.English, Language.Japanese]
    detector: LanguageDetector = LanguageDetectorBuilder.from_languages(
        languages
    ).build()

    expected: Language = Language.Japanese
    actual: Language = detector.detect_language_of("ใ“ใ‚Œใฏไฝ•่ชžใงใ™ใ‹๏ผŸ")

    assert actual == expected
pytest command
rye sync --no-lock
rye run python -m pytest -s -vv python/tests/small_usage/test_basic.py::test_basic

License

Apache License v2, and lingua-rs is also Apache License v2.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc