semvec/pypi-packages huggingface dataset:
ohsome-filter-to-sql 0.7.0
Translate ohsome API filter to SQL WHERE clause ready to be used with ohsomeDB
Requires Python: <3.14,>=3.11

# ohsome filter to SQL

[![Build Status](https://jenkins.heigit.org/buildStatus/icon?job=ohsome-filter/main)](https://jenkins.heigit.org/job/ohsome-filter/job/main/)
[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=ohsome-filter-to-sql&metric=alert_status)](https://sonarcloud.io/dashboard?id=ohsome-filter-to-sql)
[![PyPI - Version](https://img.shields.io/pypi/v/ohsome-filter-to-sql)](https://pypi.org/project/ohsome-filter-to-sql/)
[![LICENSE](https://img.shields.io/github/license/GIScience/ohsome-filter-to-sql)](COPYING)
[![status: active](https://github.com/GIScience/badges/raw/master/status/active.svg)](https://github.com/GIScience/badges#active)

## Try it out

```sh
# USAGE:
#   after running ohsome-filter-to-sql type in ohsome filter and hit enter
$ uvx ohsome-filter-to-sql
natural = tree and leaftype = broadleaf
('tags @> $1 AND tags @> $2', ('{"natural": "tree"}', '{"leaftype": "broadleaf"}'))
```

## Installation

```sh
uv add ohsome-filter-to-sql
```

## Usage

### Python Library

```python
from ohsome_filter_to_sql.main import ohsome_filter_to_sql

query, query_args = ohsome_filter_to_sql("natural = tree")
```

### Command Line Interface (CLI)

```sh
uv run ohsome-filter-to-sql
```

## Development Setup

```sh
uv run pre-commit install
uv run pytest
```

To develop new features you will need a local instance of the [ohsomeDB](https://gitlab.heigit.org/giscience/big-data/ohsome/ohsomedb/ohsomedb/-/tree/main/local_setup).


### How to play around with the grammar?

Execute `antlr4-parse`, type in an ohsome filter and press ctlr+d.

```sh
antlr4-parse OFL.g4 root -tree
buildings=yes
(root:1 (expression:8 (tagMatch:1 (string:1 buildings) = (string:1 yes))) <EOF>)
```

[ANTLR Lab](http://lab.antlr.org/) can also be used to try out the grammar.


### How to generating parser code?

When the grammar file has change generate new Python code with `antlr4` and move genrated files to `ohsome_filter_to_sql/`.

```sh
uv run antlr4 -Dlanguage=Python3 OFL.g4 && mv *.py ohsome_filter_to_sql/
```


### Release

This project uses [SemVer](https://semver.org/).

To make a new release run `./scripts/release.sh <version number>`.


## Resources

- [ohsome filter documentation](https://docs.ohsome.org/ohsome-api/v1/filter.html) and [oshdb-filter](https://github.com/GIScience/oshdb/tree/main/oshdb-filter)
- [ANTLR with Python - Introduction](https://yetanotherprogrammingblog.medium.com/antlr-with-python-974c756bdb1b)
- [ANTLR Listeners](https://github.com/antlr/antlr4/blob/master/doc/listeners.md)
- [ohsomeDB schema](https://gitlab.heigit.org/giscience/big-data/ohsome/ohsomedb/ohsomedb/-/blob/main/create-schema.sql)
mango-auth 0.0.8
Mango Auth is a small python module to authenticate using interactive pam authentication against an iRODS installation, opening web browser links as needed.
Requires Python: >=3.8

# Mango Auth

Mango Auth is a small python module to authenticate using interactive pam authentication against an iRODS installation, opening web browser links as needed.

## Usage

```shell
$ pip install mango_auth
$ mango_auth <irods_user_name> <irods_zone_name> <irods_host>
2025-10-06 16:24:44,513 - irods.auth.pam_interactive - INFO - Server prompt: Please authenticate at https://mango-auth.icts.kuleuven.be/oauth/device/auth?user_code=XXXXXXXXXX
Opening browser for authentication: https://mango-auth.icts.kuleuven.be/oauth/device/auth?user_code=XXXXXXXXXX
2025-10-06 16:25:04,745 - irods.auth.pam_interactive - INFO - Server prompt: You are authenticated using a device code.
```

or in python:

```python
from mango_auth import iinit
iinit('user_name', 'zone_name', 'host')
```

## Development

```shell
$ python -m venv venv
$ . venv/bin/activate
$ pip install -r requirements.txt 
$ pip install --editable src
```
trianglechain 0.10.0
Code for plotting multidimensional marginal distributions
Requires Python: >=3.9
Keywords: cosmology

trianglechain
=============

[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/trianglechain.svg)](https://pypi.python.org/pypi/trianglechain/)
[![PyPI version](https://badge.fury.io/py/trianglechain.svg)](https://badge.fury.io/py/trianglechain)
[![Latest Release](https://cosmo-gitlab.phys.ethz.ch/cosmo_public/trianglechain/-/badges/release.svg)](https://cosmo-gitlab.phys.ethz.ch/cosmo_public/trianglechain/-/releases)
[![pipeline](https://cosmo-gitlab.phys.ethz.ch/cosmo_public/trianglechain/badges/main/pipeline.svg)](https://cosmo-gitlab.phys.ethz.ch/cosmo_public/trianglechain)
[![coverage](https://cosmo-gitlab.phys.ethz.ch/cosmo_public/trianglechain/badges/main/coverage.svg)](https://cosmo-gitlab.phys.ethz.ch/cosmo_public/trianglechain)

[![image](http://img.shields.io/badge/arXiv-2203.09616-B31B1B.svg?logo=arxiv&style=flat)](https://arxiv.org/abs/2203.09616)
[![image](http://img.shields.io/badge/arXiv-2207.01627-B31B1B.svg?logo=arxiv&style=flat)](https://arxiv.org/abs/2207.01627)
[![Docs](https://badgen.net/badge/icon/Documentation?icon=https://cdn.jsdelivr.net/npm/simple-icons@v13/icons/gitbook.svg&label)](https://cosmo-docs.phys.ethz.ch/trianglechain/)
[![Source Code](https://badgen.net/badge/icon/Source%20Code?icon=gitlab&label)](https://cosmo-gitlab.phys.ethz.ch/cosmo_public/trianglechain)

Code for plotting multidimensional marginal distributions. If you use it, please cite [arXiv-2203.09616](https://arxiv.org/abs/2203.09616) and [arXiv-2207.01627](https://arxiv.org/abs/2207.01627).

[Source](https://cosmo-gitlab.phys.ethz.ch/cosmo_public/trianglechain)

[Documentation](http://cosmo-docs.phys.ethz.ch/trianglechain)


Basic Usage
-----------

To plot a standard triangle plot, you use

``` python
from trianglechain import TriangleChain
import numpy as np

# generate samples
samples = np.random.multivariate_normal(
    mean=np.zeros(3),
    cov=np.diag(np.ones(3)),
    size=(10000)
)

tri = TriangleChain()
tri.contour_cl(samples);
```
The input data can be rec arrays, numpy array, pandas dataframes or dictionaries.
For more example plots, see the [documentation](http://cosmo-docs.phys.ethz.ch/trianglechain)

Credits
-------

This package was created by Tomasz Kacprzak and further developed and extended by Silvan Fischbacher.
The package is maintained by Silvan Fischbacher: silvanf@phys.ethz.ch.

Contributions
-------------
Contributions are welcome, and they are greatly appreciated! Every
little bit helps, and credit will always be given.