semvec/pypi-packages huggingface dataset:
webtoken 0.5.0
A Rust-backed JWT library
Requires Python: >=3.11

![Python Version](https://img.shields.io/badge/python-3.12%20%7C%203.13%20%7C%203.14-darkgreen?style=flat&logo=python&logoColor=blue)

# webtoken

**Rust-backed JWT**

##  Size

The `.so` size on linux is ~3.5Mb, no external dependencies.

##  Speed

[Simple benchmark](https://github.com/h5rdly/toke/blob/main/benchmarks/benchmarks.py)

```
HS256
Enc: 2.1x | Dec: 1.5x

RS256
Enc: 54.4x | Dec: 1.3x

ES256
Enc: 1.9x | Dec: 1.4x

EdDSA
Enc: 2.9x | Dec: 2.5x

ES512
Enc: 1.9x | Dec: 1.5x
```

More under [benchmarks](https://github.com/h5rdly/toke/blob/main/benchmarks/).

##  Installation

`pip install webtoken`

- Developed on Linux / Python 3.13
- Tested on Linux (+ Alpine) / Windows / MacOS / FreeBSD
- Wheels available for Linux (+ Alpine) / Windows / MacOS 

##  Usage

#### PyJWT Style (Drop-in Replacement)

```python
import webtoken as jwt

key = "secret"
payload = {"sub": "1234567890", "name": "John Doe", "iat": 1516239022}
token = jwt.encode(payload, key, algorithm="HS256")

decoded = jwt.decode(token, key, algorithms=["HS256"])
print(decoded)
# {'sub': '1234567890', 'name': 'John Doe', 'iat': 1516239022}
```

#### Asyncio variants

- The rust based encode/decode release the GIL

- You can send them away on asyncio.to_thread(), or use the provided wrappers

```python
import webtoken as wt

payload = {"name": "Bob"}
token = await wt.encode_async(payload, "secret", algorithm="HS256")

decoded = await wt.decode_async(token, "secret", algorithms=["HS256"])
print(decoded)
# {'name': 'Bob'}
```
#### Crypto / base64 complementary utils

- Since webtoken already has aws-lc-rs in its standalone module, it exposes several auxiliary utilities

- This, for example, allows running tests, such as the PyJWT ported test suites, without importing cryptography

```python
import webtoken as wt


wt.base64url_encode('bob')    # utf8 strings or bytes
# b'Ym9i'

wt.base64url_decode(b'Ym9i').decode()
# 'bob'

rand_7 = wt.random_bytes(7)       # Get your cryptographically secure random bytes here 

priv, pub = wt.generate_key_pair('rs256')  

verifier, challenge = wt.generate_pkce_pair()
```

##  Compatibility

Effort is made to make toke as compatible as possible with [PyJWT](https://github.com/jpadilla/pyjwt). For compatibility details, See the readme under [tests](https://github.com/h5rdly/webtoken/tree/main/tests). 

##  Crypto

The crypto backend used by webtoken is [aws-lc-rs](https://github.com/aws/aws-lc-rs).


### Supported algorithms

PyJWT compat - 
- HS256
- HS384
- HS512
- RS256
- RS384
- RS512
- ES512

As well as - 
- ES256K
- ML-DSA-65
nx5d 2.0.2
NX5 Duct Tape
Requires Python: >=3.8

Nx5d - Data Analysis Done Right
===============================

`nx5d` is a scientific data analysis framework aiming
at a high degree of automation. It is centered around the
[Spice Concept](#./doc/concepts.md#the-spice-concept),
a management mechanism for defaults and customization
of analysis settings.

Although originates from the KMC3-XPP beamline of BESSY-II
and was built around pump-probe X-ray diffraction requirements,
it's actually intended as an application-agnostic
framework suitable for any scan-oriented data anlysis
workflows. If you come from a different background
and wish to dip your toes in Nx5d, the authors will love
to hear about it.


Why Yet Another Analysis Framework?...
--------------------------------------

In short: because people should be free to do "people things".

The main motivation behind Nx5d is to use computers at what
they're good for -- doing menial, stupid, repeptitive work.
Instead of being wasted on managing boilerplate code for data
transformation, a scientist's cognitive potential should be used
for the things that a computer *can't* do:
understanding things and creating insight.


Can I use it right away?
------------------------

Probably not today.

As of now, september 2025, 
it's still very much work-in-progress where it's really
just the basic concepts that have barely settled. It has lots
of sharp edges, and to add insult to injury, it *severly* lacks
in the [documentation](https://nx5d.readthedocs.io/) department.

Having said that, it's in a *kind-of-usable* state,
being used on a daily basis at the author's home beamline.
The current main focus is indeed documenting and cleaning
up the basic tools and APIs, and they're getting better suited
for a broader audience by the day.

If you consider yourself the adventurous, slightly impatient type,
and still insist on dipping your does in *right now*, by all
means... go ahead!
You are strongly encouraged to get in contact with the authors for
a closer collaboration and support.


Caveats & Bugs
--------------

Not enough code to call them "bugs" yet. We call them "gaping, deep,
dark holes." :-p

Also, most of Nx5d is being developed and tested primarily on Linux.
But we'd love to see it perform more robustly on Windows, if we
receive help by testing and quality patches.
spatialxgene 0.2.1
Browser-based spatial transcriptomics viewer (cellxgene-style)
Requires Python: >=3.9

# Spatialxgene

**v0.2.1** — Browser-based spatial transcriptomics viewer and preprocessing (cellxgene-style). **Launch** the viewer to explore spatial plots (zoom/pan, color by gene or annotation, optional tissue image), or run **infer** / **preprocess** on raw h5ad.

## Requirements

- **Python ≥3.9**
- If you **install from PyPI** (`pip install spatialxgene`): no other requirements; the frontend is included.
- If you **install from source** (`pip install -e .`): [Node.js](https://nodejs.org/) is needed to build the frontend once (see [docs/development.md](docs/development.md)).

## Install

```bash
# From PyPI (recommended; frontend included)
pip install spatialxgene

# From source (e.g. for development)
git clone <repo> && cd spatialxgene
pip install -e .
# Then build frontend once: see docs/development.md
```

## Commands

| Command | Description |
|---------|-------------|
| `spatialxgene launch` | Start the browser viewer; serve preprocessed h5ad from a directory. |
| `spatialxgene infer` | Add spatial coordinates when the h5ad has none (e.g. Stereo-seq grid). |
| `spatialxgene preprocess` | Expression pipeline: QC, normalize, HVG, PCA, UMAP, Leiden. Does not change spatial. |

For development (frontend watch): `spatialxgene dev` — see [docs/development.md](docs/development.md).

## Quick start

1. **Launch the viewer**

   ```bash
   spatialxgene launch --data-dir /path/to/preprocessed/h5ad/dir
   ```

   Opens http://127.0.0.1:8000. Use the sidebar to pick a dataset, color by annotation or gene, choose a tissue background image (if present), and zoom/pan the plot.

2. **Infer spatial** (when raw h5ad has no coordinates)

   ```bash
   spatialxgene infer /path/to/raw.h5ad
   # or a directory: spatialxgene infer /path/to/dir
   ```

3. **Preprocess expression** (QC, reduce, cluster)

   ```bash
   spatialxgene preprocess /path/to/raw.h5ad
   # Writes *_preprocessed.h5ad (or input/preprocessed/ for a directory)
   ```

## Data format (viewer)

Preprocessed h5ad for `launch` should have:

- **Spatial**: `obsm['spatial']` or `obs['x']` and `obs['y']`.
- **Expression**: `X`, `var` index = gene names.
- **Annotations** (optional): e.g. `obs['leiden']` for coloring.
- **Tissue images** (optional): Visium-style `uns['spatial'][sample]['images']` (e.g. `hires`, `lowres`) and `scalefactors`.

More options: `spatialxgene launch --help`, `spatialxgene infer --help`, `spatialxgene preprocess --help`.

## Documentation

- [CHANGELOG.md](CHANGELOG.md) — Release history.
- [docs/](docs/) — Development, project layout, design, and plans: [development.md](docs/development.md), [master_plan.md](docs/master_plan.md), [implementation_plan.md](docs/implementation_plan.md), [design_guidelines.md](docs/design_guidelines.md), [tasks.md](docs/tasks.md).