semvec/pypi-packages huggingface dataset:
fastapi-lifespan-manager 0.1.4
FastAPI Lifespan Manager
License: MIT
Requires Python: >=3.8,<4.0

<h1 align="center">
Fastapi LifespanManager
</h1>

`fastapi-lifespan-manager` is a Python library that provides a lifespan manager for FastAPI applications.

The `LifespanManager` in `fastapi-lifespan-manager` allows you to have multiple lifespan in one
application.

This library is particularly useful for managing background tasks, such as starting and stopping a database
connection or managing a cache, as well as for performing cleanup tasks, such as closing open file
handles or shutting down running processes.

To use `fastapi-lifespan-manager`, simply install it via pip:

```bash
pip install fastapi-lifespan-manager
```

Usage Example:

```python
from typing import AsyncIterator

from fastapi import FastAPI
from redis.asyncio import Redis
from sqlalchemy.ext.asyncio import create_async_engine

from fastapi_lifespan_manager import LifespanManager, State

manager = LifespanManager()


@manager.add
async def setup_db(app: FastAPI) -> AsyncIterator[State]:
    engine = await create_async_engine("postgresql+asyncpg://user:password@localhost/db")

    yield {"db": engine}

    await engine.dispose()


@manager.add
async def setup_cache(app: FastAPI) -> AsyncIterator[State]:
    redis = await Redis.from_url("redis://localhost:6379/0")

    yield {"cache": redis}

    await redis.close()
    await redis.wait_closed()


app = FastAPI(lifespan=manager)
```
py-tgx 0.4.0
Temporal Graph Visualization with TGX
License: MIT
Requires Python: >=3.6
Keywords: Temporal Graph Visualization

<!-- # TGX -->
![TGX logo](docs/2023_TGX_logo.png)

# Temporal Graph Analysis with TGX
<h4>
	<a href="https://arxiv.org/abs/2402.03651"><img src="https://img.shields.io/badge/arXiv-pdf-yellowgreen"></a>
	<a href="https://pypi.org/project/py-tgx/"><img src="https://img.shields.io/pypi/v/py-tgx.svg?color=brightgreen"></a>
	<a href="https://complexdata-mila.github.io/TGX/"><img src="https://img.shields.io/badge/docs-orange"></a>
</h4> 

This repository contains the code for the paper "Temporal Graph Analysis with TGX" (WSDM 2024, Demo Track).

TGX overview:
- TGX supports all datasets from [TGB](https://tgb.complexdatalab.com/) and [Poursafaei et al. 2022](https://openreview.net/forum?id=1GVpwr2Tfdg) as well as any custom dataset in `.csv` format. 
- TGX provides numerous temporal graph visualization plots and statistics out of the box.


## Dependecies
TGX implementation works with `python >= 3.9` and can be installed as follows.

1. Set up virtual environment (conda should work as well).
	```
	python -m venv tgx_env/
	source tgx_env/bin/activate
	```

2. Upgrade pip (Optional)
	```
	pip install --upgrade pip
	```

3. Install external packages
	```
	pip install -r requirements.txt
	```

4. Install local dependencies under root directory `/TGX`.
	```
	pip install -e .
	```

5. [Aternative] Install TGX from [`PyPi`](https://pypi.org/project/py-tgx/):

	```
	pip install py-tgx
	```

6. [optional] Install `mkdocs` dependencies to serve the documentation locally.
	```
	pip install mkdocs-glightbox
	```


For tutorials on how to use TGX to generate visualizations and compute statistics for temporal graphs, see [`docs/tutorials/data_viz_stats.ipynb`](https://github.com/ComplexData-MILA/TGX/blob/master/docs/tutorials/data_viz_stats.ipynb)


### Citation
If TGX is useful for your work, please consider citing it:
```bibtex
@article{shirzadkhani2024temporal,
  title={Temporal Graph Analysis with TGX},
  author={Shirzadkhani, Razieh and Huang, Shenyang and Kooshafar, Elahe and Rabbany, Reihaneh and Poursafaei, Farimah},
  journal={arXiv preprint arXiv:2402.03651},
  year={2024}
}
```