fluent-compiler


Namefluent-compiler JSON
Version 1.1 PyPI version JSON
download
home_pagehttps://github.com/django-ftl/fluent-compiler
SummaryBlazing fast implementation of Fluent localization language.
upload_time2024-04-02 18:53:09
maintainerNone
docs_urlNone
authorLuke Plant
requires_python>=3.7
licenseAPL 2
keywords fluent localization l10n compiler projectfluent ftl
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            fluent-compiler
===============

.. image:: https://badge.fury.io/py/fluent-compiler.svg
    :target: https://badge.fury.io/py/fluent-compiler

.. image:: https://readthedocs.org/projects/fluent-compiler/badge/?version=latest&style=flat
    :target: https://fluent-compiler.readthedocs.io

.. image:: https://github.com/django-ftl/fluent-compiler/workflows/Python%20package/badge.svg
    :target: https://github.com/django-ftl/fluent-compiler/actions?query=workflow%3A%22Python+package%22

This is a Python implementation of `Project Fluent <https://www.projectfluent.org/>`_, a localization
framework designed to unleash the entire expressive power of natural
language translations.

It provides a different implementation from the official
`fluent.runtime <https://github.com/projectfluent/python-fluent>`_
implementation, distinguished mainly by:

- strategy: we compile FTL files to Python bytecode via AST and use ``exec`` (similar
  to the strategy used by projects like Mako, Jinja2 and Genshi).
- speed: as a result of the above, plus static analysis, we get blazing
  fast performance, even more so when combined with PyPy which can
  further optimize.
- compile-time checking and error reporting.
- 'escapers' feature for handling things like HTML escaping/embedding correctly.


Installation
------------

To install::

    pip install fluent_compiler

Usage
-----

See the `docs folder
<https://github.com/django-ftl/fluent-compiler/tree/master/docs/>`_ or `read
them on readthedocs.org <https://fluent-compiler.readthedocs.io/en/latest/>`_.

If you are using Django, see `django-ftl <https://github.com/django-ftl/django-ftl>`_ which
wraps the functionality here in Django-specific ways.

See `history <https://fluent-compiler.readthedocs.io/en/latest/history.html>`_ for a CHANGELOG.


Status
------

fluent-compiler is a complete and very mature implementation of all the Fluent
spec up to version 1.0 (the latest at the time of writing).

In terms of API of this package, we are not planning backwards incompatible
changes to the publicly documented interfaces, and will provide deprecation
warnings for any changes.

The nature of the library is such that we expect most users will want to create
their own wrappers anyway, which you are encouraged to do, in order to be able
to absorb any backwards incompatible changes easily.

See the `issues list <https://github.com/django-ftl/fluent-compiler/issues>`_
for planned features, and `CONTRIBUTING.rst <CONTRIBUTING.rst>`_ for information
about how to contribute, and the `architecture docs <ARCHITECTURE.rst>`_.

Contributing
------------

Check out the `contributing docs <CONTRIBUTING.rst>`_ and `the architecture
notes <ARCHITECTURE.rst>`_ for information that will help you before you start
hacking.


Background
----------

This code was originally developed as part of ``fluent.runtime``, as an
alternative implementation of ``FluentBundle``, but never got merged to the
master branch. It has now been pulled out as a separate package. This is why
the repo's history contains `fluent.syntax` and early versions of `fluent.runtime`,
but the parts that are left in this repo all derive from the original version
of `fluent.runtime` contributed by @spookylukey from `a540993a085e36a9679e12f1ee7317ddc1ece5ad <https://github.com/django-ftl/fluent-compiler/commit/a540993a085e36a9679e12f1ee7317ddc1ece5ad>`_ onwards and the new compiler implementation in `d1481d61e0bc1a28a228a4b6d5258350d436e765 <https://github.com/django-ftl/fluent-compiler/commit/d1481d61e0bc1a28a228a4b6d5258350d436e765>`_ (which is squashed version of work done over a much longer period). Thats why
we also `corrected <https://github.com/django-ftl/fluent-compiler/commit/33c1b5b586858132d3ab7af749c2bde1bb5205b5>`_
the copyright notice from Mozilla to Luke Plant.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/django-ftl/fluent-compiler",
    "name": "fluent-compiler",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "fluent, localization, l10n, compiler, projectfluent, ftl",
    "author": "Luke Plant",
    "author_email": "L.Plant.98@cantab.net",
    "download_url": "https://files.pythonhosted.org/packages/df/32/b51e4b5708412ccd3bec1060216c711a5a36da3814346b1799652a9051af/fluent_compiler-1.1.tar.gz",
    "platform": null,
    "description": "fluent-compiler\n===============\n\n.. image:: https://badge.fury.io/py/fluent-compiler.svg\n    :target: https://badge.fury.io/py/fluent-compiler\n\n.. image:: https://readthedocs.org/projects/fluent-compiler/badge/?version=latest&style=flat\n    :target: https://fluent-compiler.readthedocs.io\n\n.. image:: https://github.com/django-ftl/fluent-compiler/workflows/Python%20package/badge.svg\n    :target: https://github.com/django-ftl/fluent-compiler/actions?query=workflow%3A%22Python+package%22\n\nThis is a Python implementation of `Project Fluent <https://www.projectfluent.org/>`_, a localization\nframework designed to unleash the entire expressive power of natural\nlanguage translations.\n\nIt provides a different implementation from the official\n`fluent.runtime <https://github.com/projectfluent/python-fluent>`_\nimplementation, distinguished mainly by:\n\n- strategy: we compile FTL files to Python bytecode via AST and use ``exec`` (similar\n  to the strategy used by projects like Mako, Jinja2 and Genshi).\n- speed: as a result of the above, plus static analysis, we get blazing\n  fast performance, even more so when combined with PyPy which can\n  further optimize.\n- compile-time checking and error reporting.\n- 'escapers' feature for handling things like HTML escaping/embedding correctly.\n\n\nInstallation\n------------\n\nTo install::\n\n    pip install fluent_compiler\n\nUsage\n-----\n\nSee the `docs folder\n<https://github.com/django-ftl/fluent-compiler/tree/master/docs/>`_ or `read\nthem on readthedocs.org <https://fluent-compiler.readthedocs.io/en/latest/>`_.\n\nIf you are using Django, see `django-ftl <https://github.com/django-ftl/django-ftl>`_ which\nwraps the functionality here in Django-specific ways.\n\nSee `history <https://fluent-compiler.readthedocs.io/en/latest/history.html>`_ for a CHANGELOG.\n\n\nStatus\n------\n\nfluent-compiler is a complete and very mature implementation of all the Fluent\nspec up to version 1.0 (the latest at the time of writing).\n\nIn terms of API of this package, we are not planning backwards incompatible\nchanges to the publicly documented interfaces, and will provide deprecation\nwarnings for any changes.\n\nThe nature of the library is such that we expect most users will want to create\ntheir own wrappers anyway, which you are encouraged to do, in order to be able\nto absorb any backwards incompatible changes easily.\n\nSee the `issues list <https://github.com/django-ftl/fluent-compiler/issues>`_\nfor planned features, and `CONTRIBUTING.rst <CONTRIBUTING.rst>`_ for information\nabout how to contribute, and the `architecture docs <ARCHITECTURE.rst>`_.\n\nContributing\n------------\n\nCheck out the `contributing docs <CONTRIBUTING.rst>`_ and `the architecture\nnotes <ARCHITECTURE.rst>`_ for information that will help you before you start\nhacking.\n\n\nBackground\n----------\n\nThis code was originally developed as part of ``fluent.runtime``, as an\nalternative implementation of ``FluentBundle``, but never got merged to the\nmaster branch. It has now been pulled out as a separate package. This is why\nthe repo's history contains `fluent.syntax` and early versions of `fluent.runtime`,\nbut the parts that are left in this repo all derive from the original version\nof `fluent.runtime` contributed by @spookylukey from `a540993a085e36a9679e12f1ee7317ddc1ece5ad <https://github.com/django-ftl/fluent-compiler/commit/a540993a085e36a9679e12f1ee7317ddc1ece5ad>`_ onwards and the new compiler implementation in `d1481d61e0bc1a28a228a4b6d5258350d436e765 <https://github.com/django-ftl/fluent-compiler/commit/d1481d61e0bc1a28a228a4b6d5258350d436e765>`_ (which is squashed version of work done over a much longer period). Thats why\nwe also `corrected <https://github.com/django-ftl/fluent-compiler/commit/33c1b5b586858132d3ab7af749c2bde1bb5205b5>`_\nthe copyright notice from Mozilla to Luke Plant.\n\n\n",
    "bugtrack_url": null,
    "license": "APL 2",
    "summary": "Blazing fast implementation of Fluent localization language.",
    "version": "1.1",
    "project_urls": {
        "Changelog": "https://fluent-compiler.readthedocs.io/en/latest/history.html",
        "Documentation": "https://fluent-compiler.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/django-ftl/fluent-compiler",
        "Repository": "https://github.com/django-ftl/fluent-compiler",
        "Tracker": "https://github.com/django-ftl/fluent-compiler/issues"
    },
    "split_keywords": [
        "fluent",
        " localization",
        " l10n",
        " compiler",
        " projectfluent",
        " ftl"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef5cf6fcde75c59a54209ee3a109d84506e82f55e24e77a3df0e2d5755b8a4b9",
                "md5": "7f7041f4de0b48ae497acb615329854d",
                "sha256": "67486e9e12394c9c38c89705171ee965ca8163684ebaeff019d0fa23945e9827"
            },
            "downloads": -1,
            "filename": "fluent_compiler-1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7f7041f4de0b48ae497acb615329854d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 37272,
            "upload_time": "2024-04-02T18:53:07",
            "upload_time_iso_8601": "2024-04-02T18:53:07.795108Z",
            "url": "https://files.pythonhosted.org/packages/ef/5c/f6fcde75c59a54209ee3a109d84506e82f55e24e77a3df0e2d5755b8a4b9/fluent_compiler-1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "df32b51e4b5708412ccd3bec1060216c711a5a36da3814346b1799652a9051af",
                "md5": "a7e932ac6dffb427f3f37f64f1ccd15c",
                "sha256": "7ab34182b7ef616233457bc7d17eca830aa8faa4685eed7e4498968d63cdf14e"
            },
            "downloads": -1,
            "filename": "fluent_compiler-1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a7e932ac6dffb427f3f37f64f1ccd15c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 83700,
            "upload_time": "2024-04-02T18:53:09",
            "upload_time_iso_8601": "2024-04-02T18:53:09.879729Z",
            "url": "https://files.pythonhosted.org/packages/df/32/b51e4b5708412ccd3bec1060216c711a5a36da3814346b1799652a9051af/fluent_compiler-1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-02 18:53:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "django-ftl",
    "github_project": "fluent-compiler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "fluent-compiler"
}
        
Elapsed time: 0.23891s