Metadata-Version: 2.1
Name: jammy
Version: 0.1.26
Summary: A Versatile ToolBox
License: MIT
Author: Qin
Author-email: qsh.zh27@gmail.com
Requires-Python: >=3.8.1,<3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Provides-Extra: all
Provides-Extra: pro
Provides-Extra: storage
Provides-Extra: torch
Provides-Extra: web
Requires-Dist: GitPython (>=3.1.17)
Requires-Dist: einops (>=0.6.0)
Requires-Dist: filelock (>=3.8.0)
Requires-Dist: gpustat (>=0.6.0)
Requires-Dist: h5py (>=3.4.0) ; extra == "storage" or extra == "all"
Requires-Dist: hydra-core (>=1.2.1)
Requires-Dist: ipdb (>=0.13.8)
Requires-Dist: lightning (>=2.0.0) ; extra == "torch" or extra == "all"
Requires-Dist: line-profiler (>=3.3.1) ; extra == "pro" or extra == "all"
Requires-Dist: lmdb (>=1.2.1) ; extra == "storage" or extra == "all"
Requires-Dist: loguru (>=0.7.0)
Requires-Dist: matplotlib (>=3.7.1)
Requires-Dist: msgpack (>=1.0.2) ; extra == "storage" or extra == "all"
Requires-Dist: msgpack-numpy (>=0.4.7) ; extra == "storage" or extra == "all"
Requires-Dist: numpy (>=1.24.1)
Requires-Dist: parse (>=1.19.0) ; extra == "pro" or extra == "all"
Requires-Dist: pudb (>=2022.1) ; extra == "pro" or extra == "all"
Requires-Dist: pyarrow (>=6.0.0) ; extra == "storage" or extra == "all"
Requires-Dist: python-memcached (>=1.59) ; extra == "storage" or extra == "all"
Requires-Dist: pyzmq (>=22.3.0) ; extra == "web" or extra == "all"
Requires-Dist: scipy (>=1.10.1)
Requires-Dist: stackprinter (>=0.2.10)
Requires-Dist: timeout-decorator (>=0.5.0)
Requires-Dist: torch (>=2.0.0) ; extra == "torch" or extra == "all"
Requires-Dist: torchinfo (>=1.5.3) ; extra == "torch" or extra == "all"
Requires-Dist: torchvision (>=0.15.0) ; extra == "torch" or extra == "all"
Requires-Dist: tornado (>=6.1) ; extra == "web" or extra == "all"
Requires-Dist: tqdm (>=4.11.0)
Requires-Dist: ubelt (>=0.10.2) ; extra == "pro" or extra == "all"
Requires-Dist: wandb (>=0.10.31) ; extra == "torch" or extra == "all"
Project-URL: Documentation, https://jammy.readthedocs.io/en/latest/
Description-Content-Type: text/markdown

<h1 align="center"> Jammy (Jam) </h1>

<p align="center">
  <a href="https://pypi.org/project/jammy/">
    <img src="https://img.shields.io/pypi/v/jammy?style=for-the-badge" alt="PyPI" />
  </a>
  <a href="#">
    <img src="https://img.shields.io/pypi/l/jammy?style=for-the-badge" alt="PyPI - License" />
  </a>
  <a href="https://github.com/qsh-zh/jam">
    <img src="https://img.shields.io/badge/-github-grey?style=for-the-badge&logo=github" alt="GitHub code" />
  </a>
  <a href="https://gitlab.com/qsh.zh/jam">
    <img src="https://img.shields.io/badge/-gitlab-grey?style=for-the-badge&logo=gitlab" alt="GitLab code" />
  </a>
  <a href="https://jammy.readthedocs.io/en/stable/index.html">
    <img src="https://img.shields.io/readthedocs/jammy?style=for-the-badge" alt="Read the Docs" />
  </a>
  <a href="#">
    <img src="https://img.shields.io/pypi/pyversions/jammy?style=for-the-badge" alt="PyPI - Python Version" />
  </a>
  <a href="https://github.com/psf/black">
    <img src="https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge" alt="Code style: black" />
  </a>
  <p align="center">
    <i>A personal toolbox by <a href="https://qsh-zh.github.io/">Qsh.zh</a>.</i>
  </p>
</p>

### Usage

#### setup

* For core package, run `pip install jammy`
* To access functions in `bin`
```shell
git clone https://gitlab.com/qsh.zh/jam.git --recursive
export PATH=<path_to_jam>/bin:$PATH
# run python program
jam-run main.py
jam-crun 1 main.py # use second nvidia gpu
```


#### sample of io
```python
import jammy.io as jio
from jamtorch.utils import as_numpy
jio.dump("ndarray.npz", np.arange(10))
jio.dump("foo.pkl", {"foo": as_numpy(torch.arange(10).cuda())})
ndarray = jio.load("ndarray.npz")
jio.load("foo.pkl")
model_dict = jio.load("checkpoint.pth")
```
```shell
$ jinspect-file foo.pkl
> python3
[ins] print(f1)
# content of foo.pkl

```

### Advanced Usage

* [A DDP pytorch training framework](https://jammy.readthedocs.io/en/stable/jamtorch.ddp.html)
* [Registry](https://jammy.readthedocs.io/en/stable/jammy.utils.html?highlight=registry#jammy.utils.registry.CallbackRegistry)
* TODO

### Etymology
* The naming is inspired from [Jyutping](https://en.wikipedia.org/wiki/Jyutping) of [Qin](https://en.wiktionary.org/wiki/%E6%AC%BD).

### MICS

* The package and framework are inspired from [Jacinle](https://github.com/vacancy/Jacinle) by [vacancy](https://github.com/vacancy), from which I learn and take utility functions shamelessly.

