|
| 1 | +<p align="center"> |
| 2 | + <img src="docs/_static/logo.png" alt="PyAthena logo" width="200"> |
| 3 | +</p> |
| 4 | + |
| 5 | +# PyAthena |
| 6 | + |
| 7 | +PyAthena is a Python [DB API 2.0 (PEP 249)](https://www.python.org/dev/peps/pep-0249/) client for [Amazon Athena](https://docs.aws.amazon.com/athena/latest/APIReference/Welcome.html). |
| 8 | + |
| 9 | +| | | |
| 10 | +|---------|------------------------------------------------| |
| 11 | +| Package | [](https://badge.fury.io/py/pyathena) [](https://pypi.org/project/PyAthena/) [](https://pepy.tech/project/pyathena) | |
| 12 | +| CI/CD | [](https://github.com/laughingman7743/PyAthena/actions/workflows/test.yaml) [](https://github.com/laughingman7743/PyAthena/actions/workflows/docs.yaml) | |
| 13 | +| Meta | [](https://github.com/laughingman7743/PyAthena/blob/master/LICENSE) [](https://github.com/astral-sh/ruff) [](https://mypy-lang.org/) | |
| 14 | + |
| 15 | +## Requirements |
| 16 | + |
| 17 | +* Python |
| 18 | + |
| 19 | + - CPython 3.10, 3.11, 3.12, 3.13, 3.14 |
| 20 | + |
| 21 | +## Installation |
| 22 | + |
| 23 | +```bash |
| 24 | +$ pip install PyAthena |
| 25 | +``` |
| 26 | + |
| 27 | +Extra packages: |
| 28 | + |
| 29 | +| Package | Install command | Version | |
| 30 | +|------------|--------------------------------------|----------| |
| 31 | +| SQLAlchemy | `pip install PyAthena[SQLAlchemy]` | >=1.0.0 | |
| 32 | +| Pandas | `pip install PyAthena[Pandas]` | >=1.3.0 | |
| 33 | +| Arrow | `pip install PyAthena[Arrow]` | >=10.0.0 | |
| 34 | +| Polars | `pip install PyAthena[Polars]` | >=1.0.0 | |
| 35 | + |
| 36 | +## Usage |
| 37 | + |
| 38 | +```python |
| 39 | +from pyathena import connect |
| 40 | + |
| 41 | +cursor = connect(s3_staging_dir="s3://YOUR_S3_BUCKET/path/to/", |
| 42 | + region_name="us-west-2").cursor() |
| 43 | +cursor.execute("SELECT * FROM one_row") |
| 44 | +print(cursor.description) |
| 45 | +print(cursor.fetchall()) |
| 46 | +``` |
| 47 | + |
| 48 | +## License |
| 49 | + |
| 50 | +[MIT license](LICENSE) |
| 51 | + |
| 52 | +Many of the implementations in this library are based on [PyHive](https://github.com/dropbox/PyHive), thanks for [PyHive](https://github.com/dropbox/PyHive). |
| 53 | + |
| 54 | +## Links |
| 55 | + |
| 56 | +- Documentation: https://laughingman7743.github.io/PyAthena/ |
| 57 | +- PyPI Releases: https://pypi.org/project/PyAthena/ |
| 58 | +- Source Code: https://github.com/laughingman7743/PyAthena/ |
| 59 | +- Issue Tracker: https://github.com/laughingman7743/PyAthena/issues |
| 60 | + |
| 61 | +## Logo |
| 62 | + |
| 63 | +The PyAthena logo was generated using [Nano-Banana Pro](https://deepmind.google/models/gemini-image/pro/) (Gemini 3 Pro Image). |
0 commit comments