Skip to main content

Neutralts template engine for the Web, python package

Project description

Python package for Neutral TS

Neutral is a templating engine for the web written in Rust, designed to work with any programming language (language-agnostic) via IPC/Package and natively as library/crate in Rust.

Install Package

pip install neutraltemplate

Usage

See: examples

from neutraltemplate import NeutralTemplate

schema = """
{
    "config": {
        "cache_prefix": "neutral-cache",
        "cache_dir": "",
        "cache_on_post": false,
        "cache_on_get": true,
        "cache_on_cookies": true,
        "cache_disable": false,
        "disable_js": false,
        "filter_all": false
    },
    "inherit": {
        "locale": {
            "current": "en",
            "trans": {
                "en": {
                    "Hello nts": "Hello",
                    "ref:greeting-nts": "Hello"
                },
                "es": {
                    "Hello nts": "Hola",
                    "ref:greeting-nts": "Hola"
                },
                "el": {
                    "Hello nts": "Γεια σας",
                    "ref:greeting-nts": "Γεια σας"
                }
            }
        }
    },
    "data": {
        "CONTEXT": {
            "ROUTE": "",
            "HOST": "",
            "GET": {},
            "POST": {},
            "HEADERS": {},
            "FILES": {},
            "COOKIES": {},
            "SESSION": {},
            "ENV": {}
        },
        "hello": "Hello",
        "arr": {
            "hello": "Hello"
        }
    }
}
"""

template = NeutralTemplate("file.ntpl", schema)
contents = template.render()

# e.g.: 200
status_code = template.get_status_code()

# e.g.: OK
status_text = template.get_status_text()

# empty if no error
status_param = template.get_status_param()

# act accordingly at this point according to your framework

Links

Neutral TS template engine Python Package.

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

neutraltemplate-1.3.2.tar.gz (17.6 kB view details)

Uploaded Source

Built Distributions

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

neutraltemplate-1.3.2-cp313-cp313-win_amd64.whl (952.9 kB view details)

Uploaded CPython 3.13Windows x86-64

neutraltemplate-1.3.2-cp313-cp313-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

neutraltemplate-1.3.2-cp313-cp313-manylinux_2_28_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

neutraltemplate-1.3.2-cp312-cp312-win_amd64.whl (952.7 kB view details)

Uploaded CPython 3.12Windows x86-64

neutraltemplate-1.3.2-cp312-cp312-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

neutraltemplate-1.3.2-cp312-cp312-manylinux_2_28_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

neutraltemplate-1.3.2-cp311-cp311-win_amd64.whl (951.7 kB view details)

Uploaded CPython 3.11Windows x86-64

neutraltemplate-1.3.2-cp311-cp311-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

neutraltemplate-1.3.2-cp311-cp311-manylinux_2_28_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

neutraltemplate-1.3.2-cp310-cp310-win_amd64.whl (951.9 kB view details)

Uploaded CPython 3.10Windows x86-64

neutraltemplate-1.3.2-cp310-cp310-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

neutraltemplate-1.3.2-cp310-cp310-manylinux_2_28_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

File details

Details for the file neutraltemplate-1.3.2.tar.gz.

File metadata

  • Download URL: neutraltemplate-1.3.2.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.10.0

File hashes

Hashes for neutraltemplate-1.3.2.tar.gz
Algorithm Hash digest
SHA256 454bd9b5623bfcaa055b9393ee0015a4f056c8174ca8f1964082c7c7b8e4141d
MD5 982978d5d35512324c3adafbd74712d8
BLAKE2b-256 48498e70dea791d6ab4c1631a8541268fa9a6f0635bbf84b65498a7c57599898

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 482036b5516ad9cc28526352ff3325710fbd5b7fb1cb315da7cd3ce32819b1f4
MD5 e4f0de4e7791c1826e04aed53629ef48
BLAKE2b-256 29bdc5c4edb61f4a8ecdd374825c6297b72fd290afa9c202616eb188a7a540fc

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f5a0d19d1ab6341d9f72f50b96cefeaea84b8c533e43336cb4462f50848c33d3
MD5 2e866b84decc4a1820d04c112c41a64c
BLAKE2b-256 1b96d889c7ea1d78aadc719d7a5eb5bd1c150a5c370f1a7d10e04032ef52b111

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 427b58b32873d86fee1bb02ffff5021d3cb9314e88a3b1bb02865e4ff6452818
MD5 8ab8e0310d189fe5bd4b98a7cc0436ac
BLAKE2b-256 a8f6631a112d52a69c9bbc68fcee06e99d87a4ebf56addd54f583e7040fa5b24

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 72c530944fcf4c288dec49f2fd0e6e740cde196a7bdc2799663a6c6e5e82281f
MD5 b9054a4ac0b798141e94a03051cbc985
BLAKE2b-256 9b1df05062fc247a27410ecba25dd9a937371bd77ea3d8052a905f1ccc0d69f4

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2958b35743624f5e8a25bb4295d52a24df4559484943a83029e5141873ca6404
MD5 c8ca322d67798097a53e30b516da7614
BLAKE2b-256 fa1088375b402d252e4edd4d90b6bce0988cc7acca98755dcfb6fc89c82f82f4

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2777e602394fb947d663932a0e3129cc3d4121cc312231b2111672e66c530285
MD5 8eb21f82c8bc6d1277e05d630e4bc036
BLAKE2b-256 36c27c83ce372330178e22101968491a5f84f0814c3f54c008fddebcdd7597e6

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 db29cede28f2870560a0d56dc359e109160e289cba04158f61ba39c8f6bb39c8
MD5 0e74f63cd3704cc7ecb95498f07856d5
BLAKE2b-256 4444a9575000d24550fc36225345844a67dde66df969a33cdbb4975e2159f09a

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4cdfe49f2f9e87ddf2425cef306f6dbd204aa839ff811940c8d64abe0e52768c
MD5 48da02786e46725143773e0ae2743566
BLAKE2b-256 eea33f89bf9395445eafd944bbb1341efb965a51a5db9a1077f1b8a88121bbe0

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8a634e843622b79490aa83c0c3543d7d56372a3d52f9d42831303137ed67b767
MD5 8ffbfbb2a4b0ac4ac19106e87fc4cf60
BLAKE2b-256 e5fb1a6f1d5937ce3e268a0d6e592022ed3ab3ef8725879d4b14fcc5beeca760

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bf8777a02f2cba61f05f37f6dfc6844245fa0030dd87e3104816ef882c7e9e2c
MD5 0212bf020de408a61fde6bb00d8650c9
BLAKE2b-256 0e1d7b365c1a4492ba03c3bc188ad6ace6f06fc0691bdf5bd3c681035388bd58

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 246b7996e026efc467e6fff764ae78a92cd54dc9291a0a64c42ecb67a648da8c
MD5 5eeda3376dd690d3218c076b3f8c02a3
BLAKE2b-256 9cd62106104d447c31b04a3c1b2718b5e96c51ed92aa5c89978ca95aaafbb9e2

See more details on using hashes here.

File details

Details for the file neutraltemplate-1.3.2-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for neutraltemplate-1.3.2-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d42fe5c6a265353a6de505b5950b437056386db50dd0cd8ca2993bf1012962b4
MD5 a4f24564887284315e2436445325bd17
BLAKE2b-256 78eec808484a9cda2daac1fa5dc1952b215ae47e287c48615c396f0374901877

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