semvec/pypi-packages huggingface dataset:
py2plpy 0.4.0
Convert python function to PostgreSQL Pl/Python functions
License: MIT
Requires Python: >=3.10

# py2plpy

pl2ply is a simple python package that makes it easy to write PostgreSQL PL/Python functions as native python code with full tooling support. 

It consists of the following components:
- a `transform` function that reads a python file and returns PL/Python code for all functions at the root of the file
- a `sql_properties` decorator that adds SQL-specific information to a python function
- predefined type aliases `SmallInt`, `BigInt`, `Real`, `Double`, `Out`, `In`, `InOut`, `SetOf` and `Record`
- a dummy `plpy` object that implements the API of the corresponding Pl/Python object
- the `py2plpy`command line tool

## Usage

```python
# fruit.py

from py2plpy import sql_properties, Out, SetOf, Record, plpy

@sql_properties(strict=True)
def find_fruit(string:str, fruit_no:Out[int], fruit:Out[str]) -> SetOf[Record]:
    import re
    
    plpy.info('Searching for fruit...')
    for i, m in enumerate(re.findall(r'apple|pear|banana', string)):
        yield i, m
```

```
py2plpy fruit.py fruit.sql
```

```sql
-- fruit.sql

CREATE OR REPLACE FUNCTION find_fruit (
    string TEXT,
    OUT fruit_no INTEGER,
    OUT fruit TEXT)
    RETURNS SETOF RECORD
    STRICT
    LANGUAGE PLPYTHON3U
    AS $BODY$
    
        import re
        
        plpy.info('Searching for fruit...')
        for i, m in enumerate(re.findall(r'apple|pear|banana', string)):
            yield i, m
    $BODY$;
```

## Custom Types

Any unknown type is represented by its `__name__` attribute in SQL. To use custom argument or return types, simply create a type of the appropriate name in Python. For full tooling support, it is usually most convienent to define it as an alias to type that will represent it in Python (typically `str`, `dict` for composite types):

```python
# from Python 3.12
type custom_type = str

# Python 3.11 and below
from typing_extensions import TypeAliasType
custom_type = TypeAliasType('custom_type', str)
```

## Missing Features

- Support for schema-qualified type names
- Predefined type aliases for PostgreSQL types with no native Python equivalent (e.g. `point`)
cockpit-api 0.3.1
Cockpit CMS API Python Wrapper
License: MIT

# Cockpit CMS API

![PyPI - Version](https://img.shields.io/pypi/v/cockpit-api)
![PyPI - Downloads](https://img.shields.io/pypi/dd/cockpit-api)
![GitHub Repo stars](https://img.shields.io/github/stars/Knuckles-Team/cockpit-api)
![GitHub forks](https://img.shields.io/github/forks/Knuckles-Team/cockpit-api)
![GitHub contributors](https://img.shields.io/github/contributors/Knuckles-Team/cockpit-api)
![PyPI - License](https://img.shields.io/pypi/l/cockpit-api)
![GitHub](https://img.shields.io/github/license/Knuckles-Team/cockpit-api)

![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/Knuckles-Team/cockpit-api)
![GitHub pull requests](https://img.shields.io/github/issues-pr/Knuckles-Team/cockpit-api)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/Knuckles-Team/cockpit-api)
![GitHub issues](https://img.shields.io/github/issues/Knuckles-Team/cockpit-api)

![GitHub top language](https://img.shields.io/github/languages/top/Knuckles-Team/cockpit-api)
![GitHub language count](https://img.shields.io/github/languages/count/Knuckles-Team/cockpit-api)
![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/cockpit-api)
![GitHub repo file count (file type)](https://img.shields.io/github/directory-file-count/Knuckles-Team/cockpit-api)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/cockpit-api)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/cockpit-api)

*Version: 0.3.1*

Cockpit CMS API Python Wrapper

Includes standard Cockpit API Calls

### API Calls:
- Get Content
- Add/Update Content
- Get Asset
- Get Image Asset

This repository is actively maintained and will continue adding more API calls

Contribution Opportunities:
- Support new API calls

<details>
  <summary><b>Usage:</b></summary>

```python
#!/usr/bin/python
# coding: utf-8
import cockpit_api

token = "<TOKEN>"
api_url = "<COCKPIT API URL>"
client = cockpit_api.Api(url=api_url, token=token)

content = client.get_content(model="<COLLECTION/SINGLETON>")
print(content)
```

</details>

<details>
  <summary><b>Installation Instructions:</b></summary>

```bash
python -m pip install cockpit-api
```

</details>

<details>
  <summary><b>Repository Owners:</b></summary>


<img width="100%" height="180em" src="https://github-readme-stats.vercel.app/api?username=Knucklessg1&show_icons=true&hide_border=true&&count_private=true&include_all_commits=true" />

![GitHub followers](https://img.shields.io/github/followers/Knucklessg1)
![GitHub User's stars](https://img.shields.io/github/stars/Knucklessg1)
</details>
barchart-api 0.12.4
Unofficial API for https://www.barchart.com/
License: MIT

# Barchart API

![PyPI - Version](https://img.shields.io/pypi/v/barchart-api)
![PyPI - Downloads](https://img.shields.io/pypi/dd/barchart-api)
![GitHub Repo stars](https://img.shields.io/github/stars/Knuckles-Team/barchart-api)
![GitHub forks](https://img.shields.io/github/forks/Knuckles-Team/barchart-api)
![GitHub contributors](https://img.shields.io/github/contributors/Knuckles-Team/barchart-api)
![PyPI - License](https://img.shields.io/pypi/l/barchart-api)
![GitHub](https://img.shields.io/github/license/Knuckles-Team/barchart-api)

![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/Knuckles-Team/barchart-api)
![GitHub pull requests](https://img.shields.io/github/issues-pr/Knuckles-Team/barchart-api)
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/Knuckles-Team/barchart-api)
![GitHub issues](https://img.shields.io/github/issues/Knuckles-Team/barchart-api)

![GitHub top language](https://img.shields.io/github/languages/top/Knuckles-Team/barchart-api)
![GitHub language count](https://img.shields.io/github/languages/count/Knuckles-Team/barchart-api)
![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/barchart-api)
![GitHub repo file count (file type)](https://img.shields.io/github/directory-file-count/Knuckles-Team/barchart-api)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/barchart-api)
![PyPI - Implementation](https://img.shields.io/pypi/implementation/barchart-api)

*Version: 0.12.4*

API for [Barchart](https://www.barchart.com/)

#### API Calls:
- Top Stocks to Own
- Top ETFs to Own

This repository is actively maintained - Contributions are welcome!

Contribution Opportunities:
- Support more endpoints!


<details>
  <summary><b>Usage:</b></summary>

```python
#!/usr/bin/python
# coding: utf-8
import barchart_api

barchart_client = barchart_api.Api(url="https://www.barchart.com/")
top_stocks_responses = barchart_client.get_top_stocks_top_own(max_pages=1)
top_stocks = []
for top_stocks_response in top_stocks_responses:
    try:
        top_stocks.append(top_stocks_response.json())
    except Exception as e:
        print(f"Top Stocks ERROR: {top_stocks_response}")
print(f"Top Stocks: {top_stocks}")
```
</details>

<details>
  <summary><b>Installation Instructions:</b></summary>

Install Python Package

```bash
python -m pip install barchart-api
```
</details>

<details>
  <summary><b>Repository Owners:</b></summary>


<img width="100%" height="180em" src="https://github-readme-stats.vercel.app/api?username=Knucklessg1&show_icons=true&hide_border=true&&count_private=true&include_all_commits=true" />

![GitHub followers](https://img.shields.io/github/followers/Knucklessg1)
![GitHub User's stars](https://img.shields.io/github/stars/Knucklessg1)
</details>