semvec/pypi-packages huggingface dataset:
fastapi-async-sqla 0.0.4
SQLAlchemy extension for FastAPI with support for asyncio, pagination & more, ready for production.
License: MIT
Requires Python: <4.0,>=3.12

# FastAPI-Async-SQLA

![PyPI](https://img.shields.io/pypi/v/fastapi-async-sqla)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-brightgreen.svg)](https://conventionalcommits.org)

FastAPI-Async-SQLA is an extension for [FastAPI] that eases the setup of async
[SQLAlchemy] session and provides support for pagination.

# Installing

Using [pip](https://pip.pypa.io/):
```
pip install fastapi-async-sqla
```

# Quick Example

Assuming it runs against a DB with a table `user` with 2 columns `id` and `name`:

```python
# main.py
from fastapi import FastAPI, HTTPException
from fastapi_async_sqla import Base, Item, Page, Paginate, Session, lifespan
from pydantic import BaseModel
from sqlalchemy import select


app = FastAPI(lifespan=lifespan)


class User(Base):
    __tablename__ = "user"


class UserIn(BaseModel):
    name: str


class UserModel(UserIn):
    id: int


@app.get("/users", response_model=Page[UserModel])
async def list_users(paginate: Paginate):
    return await paginate(select(User))


@app.get("/users/{user_id}", response_model=Item[UserModel])
async def get_user(user_id: int, session: Session):
    user = await session.get(User, user_id)
    if user is None:
        raise HTTPException(404)
    return {"data": user}


@app.post("/users", response_model=Item[UserModel])
async def create_user(new_user: UserIn, session: Session):
    user = User(**new_user.model_dump())
    session.add(user)
    await session.flush()
    return {"data": user}
```

Creating a db using `sqlite3`:
```bash
sqlite3 db.sqlite <<EOF
CREATE TABLE user (
    id    INTEGER PRIMARY KEY AUTOINCREMENT,
    name  TEXT NOT NULL
);
EOF
```

Installing [aiosqlite] to connect to the sqlite db asynchronously:
```bash
pip install aiosqlite
```

Running the app:
```bash
sqlalchemy_url=sqlite+aiosqlite:///db.sqlite?check_same_thread=false uvicorn main:app
```

[aiosqlite]: https://github.com/omnilib/aiosqlite
[FastAPI]: https://fastapi.tiangolo.com/
[SQLAlchemy]: http://sqlalchemy.org/
mesa-reader 0.3.5
Tools for interacting with output from MESA star and MESA binary
License: MIT
Requires Python: >=3.6

mesa_reader
===========

Tools for easily accessing and manipulating data from `MESA star` and `MESA binary` in python.

## Installation
The easiest way to install is via `pip`:

    pip install mesa_reader

You can also install by cloning or downloading the repository at github.com/wmwolf/py_mesa_reader, `cd` into it and then execute

    python setup.py install

or

    pip install .
    
to install the package on your system.

## Uninstallation
Uninstall by executing

    pip uninstall mesa_reader

## Usage
Complete documentation on the `mesa_reader` module found
[here](https://wmwolf.github.io/py_mesa_reader).