semvec/pypi-packages huggingface dataset:
teleduck 0.1.1
Serve DuckDB over PostgreSQL protocol using riffq
Requires Python: >=3.8

Teleduck
========

Teleduck exposes a DuckDB database over the PostgreSQL protocol using `riffq`.
Simply run:

```
teleduck mydata.db
```

and connect with any PostgreSQL client.

## Command line options

Teleduck serves the PostgreSQL protocol over TLS by default. The command
line interface accepts the following options:

```
teleduck [OPTIONS] DB_FILE
```

* `--host` – host interface to listen on (default: `127.0.0.1`)
* `--port` – port number (default: `5433`)
* `--sql-script` – path to a SQL script file to execute before the server starts.
  Can be given multiple times to run several scripts in order.
* `--sql` – SQL statement executed before the server starts. Can be specified
  multiple times. Use this to attach other DuckDB databases or run any
  initialisation queries before Teleduck begins accepting connections.
* `--use-tls/--no-use-tls` – enable or disable TLS (default: enabled)
* `--tls-cert-file` – path to a TLS certificate file. If not provided the built
  in certificate is used.
* `--tls-key-file` – path to the TLS private key file. If not provided the built
  in key is used.

### Generating certificates

You can generate a self‑signed certificate using `openssl`:

```bash
openssl req -x509 -newkey rsa:2048 -nodes -keyout server.key \
  -out server.crt -days 365 -subj "/CN=localhost"
```

Use `--tls-cert-file server.crt --tls-key-file server.key` to provide the files
to Teleduck.

## Authentication

Teleduck accepts any username and password by default.  Set the following
environment variables to require a particular user or password:

* `TELEDUCK_USERNAME` – expected username.
* `TELEDUCK_PASSWORD` – expected password.
* `TELEDUCK_PASSWORD_SHA1` – SHA1 hash of the expected password.

Example of setting credentials:

```bash
export TELEDUCK_USERNAME=myuser
export TELEDUCK_PASSWORD=mypassword
# alternatively use a SHA1 hash
export TELEDUCK_PASSWORD_SHA1=$(echo -n mypassword | sha1sum | awk '{print $1}')
```

If none of these variables are defined Teleduck allows any credentials.
pypewriter-cli 0.0.1
Typewriter effect for your terminal
Requires Python: >=3.8

# pypewriter

[![PyPI - Version](https://img.shields.io/pypi/v/pypewriter.svg)](https://pypi.org/project/pypewriter)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pypewriter.svg)](https://pypi.org/project/pypewriter)

---

## Table of Contents

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## Installation

```console
pip install pypewriter
```

## Usage

```py
from pypewriter_cli.Pypewriter import * 
```

Two basic functions are provided, `pypewrite()` and `get_random_color()`:

```py
pypewrite(string: str, speed: float, pause: float, color: str, new_line: bool) -> None
get_random_color() -> str
```

There's also a built-in dictionary of ASCII color codes for further customization:

```py
colors = {
    'end_color': '\033[0m', 
    # If you're coloring a substring, always place this where you want the color to end
    # E.g. {red}Hello{end_color} World!

    'red': '\x1b[1;31m',
    'green': '\x1b[1;32m',
    'yellow': '\x1b[1;33m',
    'blue': '\x1b[1;34m',
    'magenta': '\x1b[1;35m',
    'cyan': '\x1b[1;36m',

    'red_bg': '\x1b[1;37;41m',
    'green_bg': '\x1b[1;37;42m',
    'yellow_bg': '\x1b[1;37;43m',
    'blue_bg': '\x1b[1;37;44m',
    'magenta_bg': '\x1b[1;37;45m',
    'cyan_bg': '\x1b[1;37;46m'        
}
```

## License

`pypewriter` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
jax-solar 0.1.1
Top of atmosphere incident solar radiation, in JAX
Requires Python: >=3.11

# JAX Solar: Top of atmosphere incident solar radiation, in JAX

Authors: Peter Norgaard and Stephan Hoyer

JAX Solar is a JAX implementation of top of atmosphere incident solar
radiation (TISR), for use in weather and climate models. It was originally
written for [NeuralGCM](https://github.com/neuralgcm/neuralgcm).

This code uses simple formulas inspired by pysolar, but unlike pysolar it
does not include atmospheric scattering effects. Of particular note, the
constants used to compute solar irradiance are different.

## Typical usage

```python
import jax_solar
import jax_datetime as jdt

# near sunset in San Francisco
time = jdt.to_datetime('2024-12-28T00:30')
lat = 37.7749
lon = -122.4194
relative_flux = jax_solar.normalized_radiation_flux(time, lon, lat)
print(relative_flux)  # 0.07284241
```

## How accurate is it?

JAX Solar is accurate to within about 0.5% of TISR values in ERA5:

```python
import xarray
import jax_solar
import jax_datetime as jdt

time = '20231230T22'

ds = xarray.open_zarr(
    'gs://gcp-public-data-arco-era5/ar/full_37-1h-0p25deg-chunk-1.zarr-v3',
    chunks=None,
    storage_options=dict(token='anon'),
)
tisr_era5 = ds.toa_incident_solar_radiation.sel(time=time).compute()

# TISR in ERA5 is integrated over the previous hour, whereas JAX Solar
# provides instantaneous values.
lats, lons = xarray.broadcast(tisr_era5.latitude, tisr_era5.longitude)
dt = 5*60  # in seconds
times = jdt.to_datetime(time) - jnp.arange(0, 60*60//dt + 1) * jdt.Timedelta(seconds=dt)
flux = jnp.trapezoid(
    jax.vmap(lambda t: jax_solar.radiation_flux(t, lons.data, lats.data))(times),
    axis=0,
    dx=dt,
)
tisr_jax_solar = tisr_era5.copy(data=flux)

# first plot: reference TISR from ERA5
tisr_era5.plot(size=3, aspect=2)

# second plot: relative error
relative_error = (tisr_jax_solar - tisr_era5) / tisr_era5.max()
relative_error.rename('Relative error').plot(size=3, aspect=2)
```

![](https://github.com/neuralgcm/jax-solar/raw/main/docs/_static/tisr_reference.png)

![](https://github.com/neuralgcm/jax-solar/raw/main/docs/_static/tisr_error.png)

If 0.5% accuracy is not good enough for you, you could consider using the
[solar radiation code](https://github.com/google-deepmind/graphcast/blob/6819a0f19796ca9c34a079855339b37134b8d930/graphcast/solar_radiation.py)
from GraphCast, which nearly exactly matches ERA5.