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