semvec/pypi-packages huggingface dataset:
templaty 1.3.4
Generate programming code from template files
Requires Python: >=3.5, <4
Keywords: template code-generator c++ c php java python

Templaty
========

[![Documentation Status](https://readthedocs.org/projects/templaty/badge/?version=latest)](https://templaty.readthedocs.io/en/latest/?badge=latest)

**Templaty** is a code generator written in Python that focuses on generating
correct and readable programming code. It features fine-grained control over
whitespacing and indentation and a rich meta-language that allows full control
over the end result.

�� There now is [a syntax plugin for Vim][2]!

The template syntax was inspired by [Jinja2][1] and should be very easy to pick
up.

```
def annoying_prompt():
    {% for i in range(0, 5) %}
      prompt("Hey, how you're doing?")
    {% endfor %}
```

Generates the following code:

```python
def annoying_prompt():
    prompt("Hey, how you're doing?")
    prompt("Hey, how you're doing?")
    prompt("Hey, how you're doing?")
    prompt("Hey, how you're doing?")
    prompt("Hey, how you're doing?")
```

What about generating an [identity matrix][3] in C that imposes no runtime cost?

```
static const int IDENTITY_MATRIX[][] = [
  {% join i in range(0, 10) with ',' %}
    [{% join j in range(0, 10) with ',' %}{% if j == i %}1{% else %}0{% endjoin %}]
  {% endjoin %}
];
```

It should look something like this:

```c
static const int IDENTITY_MATRIX[][] = [
  [1,0,0,0,0,0,0,0,0,0],
  [0,1,0,0,0,0,0,0,0,0],
  [0,0,1,0,0,0,0,0,0,0],
  [0,0,0,1,0,0,0,0,0,0],
  [0,0,0,0,1,0,0,0,0,0],
  [0,0,0,0,0,1,0,0,0,0],
  [0,0,0,0,0,0,1,0,0,0],
  [0,0,0,0,0,0,0,1,0,0],
  [0,0,0,0,0,0,0,0,1,0],
  [0,0,0,0,0,0,0,0,0,1]
];
```

This is just the tip of the iceberg of what Templaty can do!

## Usage

Templaty is available on PyPi. You can issue the following command to install it:

```
pip3 install -U --user templaty
```

This should make the main command `templaty` available in your terminal.

## FAQ

### Will this library support Python 2?

No. Python 2 has reached its end-of-life and the organisation recommends
everyone to upgrade to Python 3. Porting to Python 2 requires extra work
for no good reason.

### Is it safe to use this library in my web server?

No, absolutely not! Templaty is a tool meant to be run by developers, not
end-users. As such, it has little (if any) security checks. You should never
run untrusted input using Templaty, only code you wrote yourself or from a
developer you trust.

### What extension should I use for my template files?

It is recommended to use the `.tply` extension so that syntax plugins like 
[vim-templaty][2] automatically set up the right syntax highlighting for you.

If your template contains code in another programming language, simply prefix
the default file extension to `.tply`, e.g. `mytemplate.cc.tply`.

## License

Templaty is licensed under the Apache 2.0 license, in the hope it will help developers
write better programs.

[1]: https://jinja.palletsprojects.com/
[2]: https://github.com/samvv/vim-templaty
[3]: https://en.wikipedia.org/wiki/Identity_matrix
tc-sam-cli 0.0.12
Tc sam cli
Requires Python: >=3.7

**DO NOT USE, THIS IS PRE-ALPHA, HAS NO TESTS**

# tc-sam-cli

A very simplified tool wrapped around aws-sam-cli to deploy aws lambda.

Works together with [tclambda](https://pypi.org/project/tclambda/)

## Configuration

```toml
[Default]
StackName = "tc-sam-playground"
S3CodeBucket = "tc-sam-bucket"

[[ExtraPolicies]]
Effect = "Allow"
Action = ["dynamodb:*"]
Resource = "arn:aws:dynamodb:eu-west-1:1234:table/myTable"

[Functions.MyLambda]
CodeUri = "mylambda/"
Handler = "app.handler"
Runtime = "python3.7"
MemorySize = 256
Timeout = 60
ReservedConcurrentExecutions = 1
BatchSize = 10

[Functions.MyLambda.Environment]
MY_KEY = "my value"

[Functions.TcLambda.Events.Ping]
Schedule = "rate(1 minute)"
Function = "ping"

# More info about API Event Source: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
[Functions.TcLambda.Api.Webhook]
Path = "/hello"
Method = "post"


[Functions.Numpy]
CodeUri = "numpy/"
Handler = "app.handler"
Runtime = "python3.7"
MemorySize = 256
Timeout = 60
Tracing = true
```

### Generate AWS SAM template

After every change in `tc-sam.toml` the template must be regenerated.

```sh
$ tc-sam generate_template > template.yml
```

It's recommended to have `template.yml` under source control.

Every Lambda has given access to each other's SQS Queue, and all Lambdas share the same S3 bucket for results. 

### Deploy

Deploy is very straightforward, it builds the sam package and deploys the cloudformation stack.

```sh
$ tc-sam deploy
```

### Environmental export

```sh
$ tc-sam env_export
TC_NUMPY_QUEUE="https://sqs.eu-west-1.amazonaws.com/123/tc-sam-playground-NumpySqs-ABC"
TC_NUMPY_BUCKET="tc-sam-playground-resultbucket-123456"
TC_MYLAMBDA_QUEUE="https://sqs.eu-west-1.amazonaws.com/123/tc-sam-playground-TcLambdaSqs-ABC"
TC_MYLAMBDA_BUCKET="tc-sam-playground-resultbucket-123456"
```

These settings can be copied to other projects that will use the aws lambdas.

### Ping all lambdas

The tclambda handler comes with a `ping` command to test if both permissions to SQS and S3 are allowed.

```sh
$ tc-sam ping
Ping NUMPY
Ping MYLAMBDA
Pong NUMPY
Pong MYLAMBDA
```