semvec/pypi-packages huggingface dataset:
yatl 20230507.3
Yet Another Teplate Language (it has been around since 2007)
Requires Python: >=3.7

# Yet Another Template Language

This is the web2py template language described [here](http://web2py.com/books/default/chapter/29/05/the-views) made available as stand alone package so it can be used anywhere.

Basically it is pure Python within "{{" ... "}}" delimiters and blocks are terminated with "pass" if termination is not obvious. There is no indentation constraints.

For example:

```
from yatl import render, SPAN

example = """
<div> 
{{ for k in range(num): }}
<span>{{=SPAN(k, _class='number')}} is {{if k % 2 == 0:}}even{{else:}}odd{{pass}}</span>
{{ pass }}
</div>
"""

print(render(example, context=dict(num=10, SPAN=SPAN), delimiters="{{ }}"))
```

In the example SPAN is an optional helper.
Output is escaped by default unless marked up with the XML helper as in {{=XML('1 < 2')}}.
Note that the helpers included here are similar but not identical to the web2py ones.
They are 99% compatible but the implementation is different.

Any Python expressions is allowed in templates, including function and class defintions:

```
example = """
{{ def link(x): }}<a href="{{=x}}">{{=x}}</a>{{ pass }}
<ul>
  {{ for k in range(num): }}
  <li>
     {{= link('http://example.com/%s' % k) }}
  </li>
  {{ pass }}
</ul>
"""

print(render(example, context=dict(num=10), delimiters="{{ }}"))
```

## Caching

If you implement a caching reader as the one below, you mak yatl even faster:

```
CACHE = {}
def reader(filename):
    if filename in CACHE:
        return CACHE[filename]
    with open(filename) as fp;
        CACHE[filename] = content = fp.read()
    return content
      
output = yatl.render(reader(filename), path=path, reader=reader)
```
zhengyang-env-4 0.0.2
A OpenAI Gym Env for foo

Trying to create my own enviornment and upload to github + pypi.  
In this version of environment, I am trying to change the reward function a little bit 
I am stil keeping the original reward function, but I am adding a new penalty funciton 
if the agent is below the 0.2 height, then it will give a penalty of negative 1. We will see what will happen.
PyDAL 20230507.1
pyDAL is a Database Abstraction Layer. It generates queries for SQlite, PotsgreSQL, MySQL, and other backends. It was originally part of the web2py frameworks but it is not an independent project. Example: db.define_table("thing",Field("name")) and db.thing.insert(name="Pizza")
Requires Python: >=3.7

# pyDAL

pyDAL is a pure Python Database Abstraction Layer.

It dynamically generates the SQL/noSQL in realtime using the specified dialect for the database backend, so that you do not have to write SQL code or learn different SQL dialects (the term SQL is used generically), and your code will be portable among different types of databases.

pyDAL comes from the original web2py's DAL, with the aim of being compatible with any Python program. pyDAL doesn't require web2py and can be used in any Python context.

[![pip version](https://img.shields.io/pypi/v/pydal.svg?style=flat-square)](https://pypi.python.org/pypi/pydal)
[![Build Status](https://img.shields.io/travis/web2py/pydal/master.svg?style=flat-square&label=Travis-CI)](https://travis-ci.com/web2py/pydal)
[![Coverage Status](https://img.shields.io/codecov/c/github/web2py/pydal.svg?style=flat-square)](https://codecov.io/github/web2py/pydal)
[![API Docs Status](https://readthedocs.org/projects/pydal/badge/?version=latest&style=flat-square)](http://pydal.rtfd.org/)

## Installation

You can install pyDAL using `pip`:

```bash
pip install pyDAL
```

## Usage and Documentation

Here is a quick example:

```pycon
>>> from pydal import DAL, Field
>>> db = DAL('sqlite://storage.db')
>>> db.define_table('thing', Field('name'))
>>> db.thing.insert(name='Chair')
>>> query = db.thing.name.startswith('C')
>>> rows = db(query).select()
>>> print rows[0].name
Chair
>>> db.commit()
```

The complete documentation is available on http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer

## What's in the box?

A little *taste* of pyDAL features:

* Transactions
* Aggregates
* Inner Joins
* Outer Joins
* Nested Selects

## Which databases are supported?

pyDAL supports the following databases:

* SQLite
* MySQL
* PostgreSQL
* MSSQL
* FireBird
* Oracle
* DB2
* Ingres
* Sybase
* Informix
* Teradata
* Cubrid
* SAPDB
* IMAP
* MongoDB

## License

pyDAL is released under the BSD-3c License.  For further details, please check the `LICENSE` file.
cttd 0.0.2a0
C test-driven development framework implemented in Python
Requires Python: >=3.8,<4.0

# cttd

## tl:dr

C test-driven development framework implemented in Python.

## Info

The testing framework is Python's native unittest, with a few extra asserts ans stuff provided by John. The tester looks for a .c and .h pair with the same name as the .py test file. It builds them into a Python extension using Crelm (which in turn uses cffi) and runs the Python tests as if it were testing Python code. C callbacks are mocked in Python (demo to follow..), meaning that there is exactly zero C code involved in the testing.

## Example

There is a demo of a TTD'd `add3` function in \_\_main\_\_.py, \_\_main\_\_.c and \_\_main\_\_.h in the root of the repo, run with `python3 .`. The silly filenames are to suit the Python auto-run mechanism.

The files are reproduced here (possibly out of date) with original filenames:

__add3.py__

```
from cttd import Tester

class Add3Tests(Tester):

    def test_sut_compiles(self):
        with self.assertDoesNotRaise():
            self.sut

    def test_takes_three_f(self):
        with self.assertDoesNotRaise():
            self.sut.add3(0, 0, 0)

    def test_return_zero_for_zeros(self):
        expected = 0

        actual = self.sut.add3(0, 0, 0)

        self.assertEqual(expected, actual)

    def test_returns_sum(self):
        expected = 14

        actual = self.sut.add3(1, 4, 9)

        self.assertEqual(expected, actual)

Tester.go()
```

__add3.h__
```
#pragma once

int add3(int a, int b, int c);
```

__add3.c__
```
#include "__main__.h"

int add3(int a, int b, int c)
{
    return a + b + c;
}
```

To use this in real life install the package with `pip install cttd` (in a virtualenv if you prefer), and run `python add3.py` after each add test or add code iteration.

Test output is exactly what unittest said (with distutils deprecation warning removed):

```
...........
----------------------------------------------------------------------
Ran 11 tests in 2.104s

OK

```
async-rotating-proxy 0.0.6
Run an API on your local machine that reroutes traffic through rotating proxies. Useful for pyppeteer proxy rotation.
Requires Python: >3.10
Keywords: fastapi,proxy,pyppeteer,rotating proxy,scraping

# async-rotating-proxy
Run an API on your local machine that reroutes traffic through rotating proxies.

- Excellent for scaling your web scraping
- Designed for page-by-page dynamic proxy switching with pyppeteer

## Installation
`pip install async_rotating_proxy`

## Usage
```py
from async_rotating_proxy import ProxyAPI
import pyppeteer

proxies = [
  ip:port,
  ip:port,
  ip:port
]

with ProxyAPI(proxies) as api:
  url = api.format_url("http://checkip.dyndns.org")

  browser = await pyppeteer.launch()
  page = await browser.newPage()
  await page.goto(url)
```


## Purpose
The article referenced below sums it up pretty well:
"The chrome browser does not support fain-grained proxy configuration out of the box. Therefore, the following use cases are not possible when using puppeteer in combination with Google Chrome:

    Using different proxies for different tabs/windows
    Switching proxies without restarting the browser

This is a bit annoying, because restarting the entire browser is an expensive operation in terms of computational resources. The chrome restart takes up to two seconds (depending on the system). We ideally want to switch proxies whenever the need arises without restarting the entire chrome process. This is a common requirement when scraping websites in scale."

## Reference
https://incolumitas.com/2020/12/20/dynamically-changing-puppeteer-proxies/
gopro-video-sync 0.0.3
A tool to determine the offset between videos from two jointly mounted GoPros based on a combination of audio, accelerometer, and gyroscope data.

# GoPro Video Sync

A tool to determine the offset between videos from two jointly mounted GoPros based on a combination of audio, accelerometer, and gyroscope data.

## Installation

Install `gopro-video-sync` from PyPI:

```bash
pip install gopro-video-sync
```

Or from the source on GitHub:

```bash
pip install "gopro-video-sync @ git+https://github.com/evoth/gopro-video-sync"
```

The package will be installed with the module name `gopro_video_sync`.

## Usage example

Print the required adjustment to sync videos from two jointly mounted GoPros:

```python
from gopro_video_sync import gopro_offset

video_1 = "GOPR1569.MP4"
video_2 = "GOPR0105.MP4"

offset, source_1, source_2 = gopro_offset(video_1, video_2)

if offset is None:
    print("Could not determine offset between the given videos.")
else:
    offset = round(offset, 3)
    if offset > 0:
        print(f"Trim the first {offset} seconds of {video_1} to sync the videos.")
    elif offset < 0:
        print(f"Trim the first {-1 * offset} seconds of {video_2} to sync the videos.")
    else:
        print("Videos are already synced.")
```

## How it works

Since I had wanted to sync videos from two GoPros that were mounted together, I realized that the gyroscope and accelerometer information from each should be identical. GoPros store sensor data inside MP4 files in a format called [GPMF](https://github.com/gopro/gpmf-parser), developed by GoPro for this very purpose. So, this program extracts the GPMF data from each video file and uses [cross-correlation](https://en.wikipedia.org/wiki/Cross-correlation) to attempt to line up the videos.

If the individual offsets obtained from the gyroscope and accelerometer data do not agree, then the audio data is used in an attempt to verify one of the sensor offsets. If this does not work, then the offset can not be determined.
zhengyang-env-3 0.0.2
A OpenAI Gym Env for foo

Trying to create my own enviornment and upload to github + pypi.  
In this version of environment, I am trying to change the reward function a little bit 
I am stil keeping the original reward function, but I am adding a new penalty funciton 
if the agent is below the 0.2 height, then it will give a penalty of negative 1. We will see what will happen.
YATL 20230507.1
Yet Another Teplate Language (it has been around since 2007)
Requires Python: >=3.7

# Yet Another Template Language

This is the web2py template language described [here](http://web2py.com/books/default/chapter/29/05/the-views) made available as stand alone package so it can be used anywhere.

Basically it is pure Python within "{{" ... "}}" delimiters and blocks are terminated with "pass" if termination is not obvious. There is no indentation constraints.

For example:

```
from yatl import render, SPAN

example = """
<div> 
{{ for k in range(num): }}
<span>{{=SPAN(k, _class='number')}} is {{if k % 2 == 0:}}even{{else:}}odd{{pass}}</span>
{{ pass }}
</div>
"""

print(render(example, context=dict(num=10, SPAN=SPAN), delimiters="{{ }}"))
```

In the example SPAN is an optional helper.
Output is escaped by default unless marked up with the XML helper as in {{=XML('1 < 2')}}.
Note that the helpers included here are similar but not identical to the web2py ones.
They are 99% compatible but the implementation is different.

Any Python expressions is allowed in templates, including function and class defintions:

```
example = """
{{ def link(x): }}<a href="{{=x}}">{{=x}}</a>{{ pass }}
<ul>
  {{ for k in range(num): }}
  <li>
     {{= link('http://example.com/%s' % k) }}
  </li>
  {{ pass }}
</ul>
"""

print(render(example, context=dict(num=10), delimiters="{{ }}"))
```

## Caching

If you implement a caching reader as the one below, you mak yatl even faster:

```
CACHE = {}
def reader(filename):
    if filename in CACHE:
        return CACHE[filename]
    with open(filename) as fp;
        CACHE[filename] = content = fp.read()
    return content
      
output = yatl.render(reader(filename), path=path, reader=reader)
```