semvec/pypi-packages huggingface dataset:
plot-finder 0.3.0
Query Polish ULDK (GUGiK) API to find land parcels by TERYT ID or coordinates
Requires Python: >=3.10
Keywords: uldk, gugik, parcel, plot, geodesy, poland, teryt

# plot-finder

![Python](https://img.shields.io/badge/Python-3.10+-3776AB?logo=python&logoColor=white)
![License](https://img.shields.io/badge/License-MIT-green)
![Pydantic](https://img.shields.io/badge/Pydantic-v2-E92063?logo=pydantic&logoColor=white)
![OpenStreetMap](https://img.shields.io/badge/OpenStreetMap-7EBC6F?logo=openstreetmap&logoColor=white)
![OSRM](https://img.shields.io/badge/OSRM-Routing-blue)
![OpenWeather](https://img.shields.io/badge/OpenWeather-API-orange?logo=openweathermap&logoColor=white)
![Open-Meteo](https://img.shields.io/badge/Open--Meteo-Climate-1a73e8)

> Python library to find Polish land parcels and analyze their surroundings.

Query the [ULDK (GUGiK)](https://uldk.gugik.gov.pl/) API to get parcel data by TERYT ID or coordinates, then analyze nearby infrastructure using OpenStreetMap.

![Plot with geometry, radius and nearby places](assets/showcase.png)

## Installation

```bash
pip install plot-finder           # base
pip install plot-finder[viz]      # + interactive maps & PNG export
pip install plot-finder[ai]       # + AI-powered analysis (OpenAI)
```

**Requirements:** Python 3.10+ | `pydantic` `httpx` `shapely` `pyproj`

## Quick Start

```python
from plot_finder import Plot, PlotAnalyzer, PlotReporter

# Find a parcel
plot = Plot(plot_id="141201_1.0001.6509")
print(plot.voivodeship)  # mazowieckie
print(plot.centroid)     # (x, y)

# Analyze surroundings
analyzer = PlotAnalyzer(plot, radius=3000)

for place in analyzer.education():
    print(f"{place.name} — {place.distance_m}m, walk {place.walk_min}min")

# Full report
report = PlotReporter(analyzer).report()
report.model_dump_json()

# Visualization (pip install plot-finder[viz])
from plot_finder.visualizer import PlotVisualizer
viz = PlotVisualizer(report)
viz.save("map.html")  # interactive map
viz.save("map.png")   # static image
```

## Documentation

Full documentation: [ernestilchenko.github.io/plot-finder](https://ernestilchenko.github.io/plot-finder/)

## License

MIT — use it however you want.
u 2.1
Statically typed units
Requires Python: >=3.10

# u

Statically typed units.

## Quickstart

Type safe assignments:

```python
duration: u.Duration = u.seconds(5)  # Ok
distance: u.Distance = u.amperes(5)  # Type checking error
```

Type safe math:

```python
print(u.seconds(120) + u.minutes(3))  # Ok
print(u.seconds(120) + u.amperes(3))  # Type checking error
```

Type safe derived units:

```python
SPEED = u.DIV[u.DISTANCE, u.DURATION]
Speed = u.Quantity[SPEED]

speed: Speed = u.km(5) / u.hours(1)  # Ok
speed: Speed = (u.km / u.hours)(5)  # Also ok

ELECTRIC_CHARGE = u.MUL[u.DURATION, u.ELECTRIC_CURRENT]
ElectricCharge = u.Quantity[ELECTRIC_CHARGE]

charge: ElectricCharge = u.sec(3) * u.amperes(2)  # Ok
charge: ElectricCharge = u.amperes(2) * u.sec(3)  # Also ok
```

Reusable prefixes:

```python
print(u.megabytes(5) == u.mega(u.bytes)(5))  # True
```

Define your own quantities and units:

```python
class TASTINESS(u.QUANTITY):
    pass

Tastiness = u.Quantity[TASTINESS]

mmm = u.Unit(Tastiness, symbol='mmm', multiplier=1)
yum = u.Unit(Tastiness, 'yum', 10)

taste: Tastiness = yum(42)
```

Convert to string:

```python
thousand_meters = u.meters(1000)
print(thousand_meters)             # Automatically selects a suitable unit: "1 km"
print(f'{thousand_meters:m}')      # Uses the specified unit: "1000 m"
print(f'{thousand_meters:cm:m}')   # Selects a unit from the given range: "1000 m"
print(f'{thousand_meters:.1f m}')  # Formats the number: "1000.0 m"
```

## Caveats

Since type checkers don't understand math, calculations involving different types of quantities
sometimes cause type checkers to complain even though they're correct. For example:

```python
area: u.Area = (u.m2 * u.kelvins / u.kelvins)(1)  # Type checking error
```

## Documentation

There is no online documentation, but everything has docstrings and type annotations. Your IDE
should be able to show you all the relevant information.
flake8-sqlalchemy2 0.2.0
flake8 plugin for SQLAlchemy 2.0
Requires Python: >=3.10
Keywords: flake8, linting, python, sqlalchemy, sqlalchemy2

# flake8-sqlalchemy2

`flake8` plugin to enforce modern, typed SQLAlchemy 2.0.


## Installation

Use `uvx` for a one-time check of your code base:
```bash
uvx --with flake8-sqlalchemy2 flake8 --select SA2
```

Install via `pip` for using as "permanent" `flake8` plugin:
```bash
pip install flake8-sqlalchemy2
```

## Rules

### missing-mapped-type-annotation (SA201)

#### What it does
Checks for existence of `Mapped` or other ORM container class type annotations in SQLAlchemy
models.

#### Why is this bad?
If an annotation is missing, type checkers will treat the corresponding field as type `Any`.

#### Example
```python
from sqlalchemy import Integer
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import mapped_column

class Base(DeclarativeBase):
    pass


class MyModel(Base):
    __tablename__ = "my_model"
    id: Mapped[int] = mapped_column(primary_key=True)

    count = mapped_column(Integer)


m = MyModel()
reveal_type(m.count)  #  note: Revealed type is "Any"
```

Use instead:
```python
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import mapped_column

class Base(DeclarativeBase):
    pass


class MyModel(Base):
    __tablename__ = "my_model"
    id: Mapped[int] = mapped_column(primary_key=True)

    count: Mapped[int]


m = MyModel()
reveal_type(m.count)  #  note: Revealed type is "builtins.int"
```

### legacy-collection (SA202)

#### What it does
Checks for existence of `DynamicMapped`.

#### Why is this bad?
`DynamicMapped` is considered legacy and exposes the legacy query API.

#### Example
```python
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import DynamicMapped
from sqlalchemy.orm import mapped_column
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import relationship

class Base(DeclarativeBase):
    pass


class MyModel(Base):
    __tablename__ = "my_model"
    id: Mapped[int] = mapped_column(primary_key=True)

    children: DynamicMapped["Child"] = relationship()
```

Use instead:
```python
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import mapped_column
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import relationship
from sqlalchemy.orm import WriteOnlyMapped

class Base(DeclarativeBase):
  pass


class MyModel(Base):
  __tablename__ = "my_model"
  id: Mapped[int] = mapped_column(primary_key=True)

  children: WriteOnlyMapped["Child"] = relationship()
```

## Note on `ruff`

Q: Why still use `flake8` when there is `ruff`!?

A: For rules not supported by `ruff`. There is a proposed [merge request](https://github.com/astral-sh/ruff/pull/18065) to bring the first SQLAlchemy linting rule (`SA201`) to `ruff` ("needs-decision" tagged).

## Note on `flake8-sqlalchemy`

Q: Why not integrate these rules into `flake8-sqlalchemy`?

A: The focus of this package are rules for modern, typed SQLAlchemy. Furthermore, I wanted to learn something new.
GenTS 0.9.5
A useful tool for post-processing Earth System Model output 'history files' into the time series format.
Requires Python: >=3.10.13

# **Gen**erate **T**ime **S**eries (GenTS)

[![Available on pypi](https://img.shields.io/pypi/v/GenTS.svg)](https://pypi.org/project/GenTS/)
[![Docs](https://readthedocs.org/projects/GenTS/badge/?version=latest)](https://gents.readthedocs.io/en/latest/)
![GitHub License](https://img.shields.io/github/license/AgentOxygen/GenTS)

The GenTS (Generate Time Series) is an open-source Python Package designed to simplify the post-processing of history files into time series files. This package includes streamlined functions that require minimal input to operate and a documented API for custom workflows.

## Installation

GenTS can be installed using `pip`:

```
pip install gents['parallel']
```

Although it is reccomended to use the Dask implementation, you may wish to implement your own parallel solution for large datasets. If you then don't want to include Dask in your installation, you may omit `['parallel']` from the command (this limits GenTS to only run in serial).

To install from source, please view the [ReadTheDocs Documentation](https://gents.readthedocs.io/en/latest/).

## Example

Barebones starting example:

```
from gents.hfcollection import HFCollection
from gents.timeseries import TSCollection
from dask.distributed import LocalCluster, Client

cluster = LocalCluster(n_workers=30, threads_per_worker=1, memory_limit="2GB")
client = cluster.get_client()

input_head_dir = "... case directory with model output ..."
output_head_dir = "... scratch directory to output time series to ..."

hf_collection = HFCollection(input_head_dir)
hf_collection = hf_collection.include_patterns(["*/atm/*", "*/ocn/*", "*.h4.*"])
hf_collection.pull_metadata()

ts_collection = TSCollection(hf_collection.include_years(0, 5), output_head_dir)
ts_collection = ts_collection.apply_overwrite("*")
ts_collection.execute()
```

The serial equivalent (without Dask) is the same, just without the Dask `Client` or `LocalCluster`:

```
from gents.hfcollection import HFCollection
from gents.timeseries import TSCollection

input_head_dir = "... case directory with model output ..."
output_head_dir = "... scratch directory to output time series to ..."

hf_collection = HFCollection(input_head_dir)
hf_collection = hf_collection.include_patterns(["*/atm/*", "*/ocn/*", "*.h4.*"])
hf_collection.pull_metadata()

ts_collection = TSCollection(hf_collection.include_years(0, 5), output_head_dir)
ts_collection = ts_collection.apply_overwrite("*")
ts_collection.execute()
```

## Contributor/Bug Reporting Guidelines

Please report all issues to the [GitHub issue tracker](https://github.com/AgentOxygen/GenTS/issues). When submitting a bug, run `gents.utils.enable_logging(verbose=True)` at the top of your script to include all log output. This will aid in reproducing the bug and quickly developing a solution.

For development, it is recommended to use the [Docker method for testing](https://gents.readthedocs.io/en/latest/). These tests are automatically run in the GitHub workflow, but should be run before committing changes.