semvec/pypi-packages huggingface dataset:
tasi 0.13.0
Library for Traffic Analysis and Situation Interpretation
Requires Python: <4.0.0,>=3.11.0

# TrAffic Situation analysis and Interpretation

[![pypi](https://img.shields.io/pypi/v/tasi.svg)](https://pypi.python.org/pypi/tasi/) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.14034644.svg)](https://doi.org/10.5281/zenodo.14034644) [![DLR-TS](https://img.shields.io/badge/developed%20by-DLR%20TS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://www.dlr.de/en/ts/about-us/the-institute-of-transportation-systems) [![PyPI Downloads](https://static.pepy.tech/badge/tasi)](https://pepy.tech/projects/tasi)  


TASI is a library to provide high-performance, easy-to-use data structures and data analysis tools for Python based
traffic situation analysis and interpretation applications.

> **TASI** is backed by those wonderful libraries [`Numpy`](https://numpy.org/), [`Pandas`](https://pandas.pydata.org/),
> and [`Numba`](http://numba.pydata.org/)

## Getting started

Install ``TASI`` from the PyPi registry.
```bash
pip install tasi
```

Download the latest DLR-UT version for demonstration purpose.
```python
from tasi.dlr import DLRUTDatasetManager, DLRUTVersion, 

dataset = DLRUTDatasetManager(DLRUTVersion.latest)
dataset.load()
```

and visualize the trajectories within the dataset using `matplotlib`.

```python
from tasi.dlr import DLRTrajectoryDataset
from tasi.plotting import TrajectoryPlotter

import matplotlib.pyplot as plt

# load the first file of the dataset
ds_ut = DLRTrajectoryDataset.from_csv(dataset.trajectory()[0])

# plot the trajectories
f, ax = plt.subplots()

plotter = TrajectoryPlotter()
plotter.plot(ds_ut, ax=ax)
```

![trajectory-example](etc/example.jpg)
libipld 3.3.2
Python binding to the Rust IPLD library
Requires Python: >=3.8
Keywords: library, lib, ipld, cid, multibase, multihash, dag, cbor, dag-cbor

## Python IPLD

> This project aims to speed up [The AT Protocol SDK](https://github.com/MarshalX/atproto) by using Rust for the heavy lifting. Only atproto related parts are implemented first.

Code snippet:

```python
import libipld

# CID
print(libipld.decode_cid('bafyreig7jbijxpn4lfhvnvyuwf5u5jyhd7begxwyiqe7ingwxycjdqjjoa'))
# Output: {'hash': {'size': 32, 'code': 18, 'digest': b'\xdfHP\x9b\xbd\xbcYOV\xd7\x14\xb1{N\xa7\x07\x1f\xc2C^\xd8D\t\xf44\xd6\xbe\x04\x91\xc1)p'}, 'version': 1, 'codec': 113}
print(libipld.encode_cid(b'\x01q\x12 \xb6\x81\x1a\x1d\x7f\x8c\x17\x91\xdam\x1bO\x13m\xc0\xe2&y\xea\xfe\xaaX\xd6M~/\xaa\xd5\x89\x0e\x9d\x9c'))
# Output: bafyreifwqenb274mc6i5u3i3j4jw3qhcez46v7vkldle27rpvlkysdu5tq

# DAG-CBOR
print(libipld.decode_dag_cbor(b'\xa2aa\x0cabfhello!'))
# Output: {'a': 12, 'b': 'hello!'}
print(libipld.encode_dag_cbor({'a': 12, 'b': 'hello!'}))
# Output: b'\xa2aa\x0cabfhello!'

# multibase
print(libipld.decode_multibase('ueWVzIG1hbmkgIQ'))
# Output: ('u', b'yes mani !')
print(libipld.encode_multibase('u', b'yes mani !'))
# Output: ueWVzIG1hbmkgIQ
```

### Features

#### 🔗 CID (Content Identifier) Operations
- **`decode_cid(data: str | bytes) -> dict`** - Decode CIDs from string representation (e.g., `'bafy...'`) or raw bytes into structured data containing version, codec, and hash information
- **`encode_cid(data: str | bytes) -> str`** - Encode CID raw bytes to string representation, or return string CIDs as-is

#### 📦 DAG-CBOR (Directed Acyclic Graph CBOR) Operations  
- **`decode_dag_cbor(data: bytes) -> Any`** - Decode DAG-CBOR binary data into Python objects (dicts, lists, primitives)
- **`decode_dag_cbor_multi(data: bytes) -> list[Any]`** - Decode multiple concatenated DAG-CBOR objects from a single byte stream
- **`encode_dag_cbor(data: Any) -> bytes`** - Encode Python objects into DAG-CBOR binary format

#### 🌐 Multibase Operations
- **`decode_multibase(data: str) -> tuple[str, bytes]`** - Decode multibase-encoded strings, returning the base identifier and decoded data
- **`encode_multibase(code: str, data: str | bytes) -> str`** - Encode data using specified multibase encoding (e.g., base58btc with code `'u'`)

#### 🚗 CAR (Content Addressable Archives) Operations
- **`decode_car(data: bytes) -> tuple[dict, dict[bytes, dict]]`** - Decode CAR files into header metadata and a mapping of CID bytes to block data

### Requirements

- Python 3.8 or higher.

### Installing

You can install or upgrade `libipld` via

```bash
pip install -U libipld
```

### Contributing

Contributions of all sizes are welcome.

### License

MIT