|
| 1 | +API Reference |
| 2 | +============= |
| 3 | + |
| 4 | +The ``pysus.api`` package provides a layered architecture for discovering, |
| 5 | +downloading, and reading data from Brazilian public health databases |
| 6 | +(DATASUS). It supports three remote data sources. |
| 7 | + |
| 8 | +Architecture Overview |
| 9 | +--------------------- |
| 10 | + |
| 11 | +The package is organized into a hierarchy of abstract base classes and |
| 12 | +concrete implementations:: |
| 13 | + |
| 14 | + pysus/api/ |
| 15 | + ├── __init__.py # Package entry (re-exports PySUS) |
| 16 | + ├── client.py # Main PySUS orchestrator |
| 17 | + ├── extensions.py # File format handlers |
| 18 | + ├── models.py # Abstract base classes |
| 19 | + ├── types.py # Type aliases |
| 20 | + ├── _impl/ |
| 21 | + │ └── databases.py # High-level convenience functions |
| 22 | + ├── ducklake/ # S3 DuckLake catalog client |
| 23 | + ├── ftp/ # FTP client |
| 24 | + └── dadosgov/ # dados.gov.br API client |
| 25 | + |
| 26 | +Quick Start |
| 27 | +----------- |
| 28 | + |
| 29 | +The simplest way to use PySUS is via the high-level convenience |
| 30 | +functions:: |
| 31 | + |
| 32 | + from pysus import sinan |
| 33 | + |
| 34 | + df = sinan(disease="dengue", year=2023) |
| 35 | + |
| 36 | +Or with the async API:: |
| 37 | + |
| 38 | + from pysus.api.client import PySUS |
| 39 | + |
| 40 | + async with PySUS() as pysus: |
| 41 | + files = await pysus.query(dataset="sinan", group="DENG", year=2023) |
| 42 | + for f in files: |
| 43 | + await pysus.download(f) |
| 44 | + |
| 45 | + |
| 46 | +Main Client |
| 47 | +----------- |
| 48 | + |
| 49 | +.. automodule:: pysus.api.client |
| 50 | + :members: |
| 51 | + :undoc-members: |
| 52 | + :show-inheritance: |
| 53 | + |
| 54 | +Types |
| 55 | +----- |
| 56 | + |
| 57 | +.. automodule:: pysus.api.types |
| 58 | + :members: |
| 59 | + :undoc-members: |
| 60 | + |
| 61 | +File Format Handlers |
| 62 | +-------------------- |
| 63 | + |
| 64 | +.. automodule:: pysus.api.extensions |
| 65 | + :members: |
| 66 | + :undoc-members: |
| 67 | + :show-inheritance: |
| 68 | + |
| 69 | +Abstract Base Models |
| 70 | +-------------------- |
| 71 | + |
| 72 | +.. automodule:: pysus.api.models |
| 73 | + :members: |
| 74 | + :undoc-members: |
| 75 | + :show-inheritance: |
| 76 | + |
| 77 | +High-Level Data Functions |
| 78 | +------------------------- |
| 79 | + |
| 80 | +.. automodule:: pysus.api._impl.databases |
| 81 | + :members: |
| 82 | + :undoc-members: |
| 83 | + :show-inheritance: |
| 84 | + |
| 85 | +DuckLake Client |
| 86 | +--------------- |
| 87 | + |
| 88 | +.. automodule:: pysus.api.ducklake.client |
| 89 | + :members: |
| 90 | + :undoc-members: |
| 91 | + :show-inheritance: |
| 92 | + |
| 93 | +.. automodule:: pysus.api.ducklake.catalog |
| 94 | + :members: |
| 95 | + :undoc-members: |
| 96 | + :show-inheritance: |
| 97 | + |
| 98 | +.. automodule:: pysus.api.ducklake.models |
| 99 | + :members: |
| 100 | + :undoc-members: |
| 101 | + :show-inheritance: |
| 102 | + |
| 103 | +FTP Client |
| 104 | +---------- |
| 105 | + |
| 106 | +.. automodule:: pysus.api.ftp.client |
| 107 | + :members: |
| 108 | + :undoc-members: |
| 109 | + :show-inheritance: |
| 110 | + |
| 111 | +.. automodule:: pysus.api.ftp.databases |
| 112 | + :members: |
| 113 | + :undoc-members: |
| 114 | + :show-inheritance: |
| 115 | + |
| 116 | +.. automodule:: pysus.api.ftp.models |
| 117 | + :members: |
| 118 | + :undoc-members: |
| 119 | + :show-inheritance: |
| 120 | + |
| 121 | +DadosGov Client |
| 122 | +--------------- |
| 123 | + |
| 124 | +.. automodule:: pysus.api.dadosgov.client |
| 125 | + :members: |
| 126 | + :undoc-members: |
| 127 | + :show-inheritance: |
| 128 | + |
| 129 | +.. automodule:: pysus.api.dadosgov.databases |
| 130 | + :members: |
| 131 | + :undoc-members: |
| 132 | + :show-inheritance: |
| 133 | + |
| 134 | +.. automodule:: pysus.api.dadosgov.models |
| 135 | + :members: |
| 136 | + :undoc-members: |
| 137 | + :show-inheritance: |
0 commit comments