mett 0.0.1a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mett-0.0.1a1/PKG-INFO +248 -0
- mett-0.0.1a1/README.md +214 -0
- mett-0.0.1a1/mett.egg-info/PKG-INFO +248 -0
- mett-0.0.1a1/mett.egg-info/SOURCES.txt +118 -0
- mett-0.0.1a1/mett.egg-info/dependency_links.txt +1 -0
- mett-0.0.1a1/mett.egg-info/entry_points.txt +2 -0
- mett-0.0.1a1/mett.egg-info/requires.txt +19 -0
- mett-0.0.1a1/mett.egg-info/top_level.txt +2 -0
- mett-0.0.1a1/mett_dataportal/__init__.py +18 -0
- mett-0.0.1a1/mett_dataportal/cli/__init__.py +5 -0
- mett-0.0.1a1/mett_dataportal/cli/core/__init__.py +8 -0
- mett-0.0.1a1/mett_dataportal/cli/core/genes.py +318 -0
- mett-0.0.1a1/mett_dataportal/cli/core/genomes.py +239 -0
- mett-0.0.1a1/mett_dataportal/cli/core/species.py +100 -0
- mett-0.0.1a1/mett_dataportal/cli/core/system.py +41 -0
- mett-0.0.1a1/mett_dataportal/cli/experimental/__init__.py +22 -0
- mett-0.0.1a1/mett_dataportal/cli/experimental/drugs.py +188 -0
- mett-0.0.1a1/mett_dataportal/cli/experimental/essentiality.py +41 -0
- mett-0.0.1a1/mett_dataportal/cli/experimental/fitness.py +86 -0
- mett-0.0.1a1/mett_dataportal/cli/experimental/mutant_growth.py +43 -0
- mett-0.0.1a1/mett_dataportal/cli/experimental/operons.py +70 -0
- mett-0.0.1a1/mett_dataportal/cli/experimental/orthologs.py +57 -0
- mett-0.0.1a1/mett_dataportal/cli/experimental/proteomics.py +37 -0
- mett-0.0.1a1/mett_dataportal/cli/experimental/reactions.py +39 -0
- mett-0.0.1a1/mett_dataportal/cli/interactions/__init__.py +6 -0
- mett-0.0.1a1/mett_dataportal/cli/interactions/ppi.py +155 -0
- mett-0.0.1a1/mett_dataportal/cli/interactions/ttp.py +141 -0
- mett-0.0.1a1/mett_dataportal/cli/main.py +78 -0
- mett-0.0.1a1/mett_dataportal/cli/other.py +267 -0
- mett-0.0.1a1/mett_dataportal/cli/output.py +101 -0
- mett-0.0.1a1/mett_dataportal/cli/utils.py +140 -0
- mett-0.0.1a1/mett_dataportal/client.py +544 -0
- mett-0.0.1a1/mett_dataportal/config.py +97 -0
- mett-0.0.1a1/mett_dataportal/constants.py +9 -0
- mett-0.0.1a1/mett_dataportal/exceptions.py +23 -0
- mett-0.0.1a1/mett_dataportal/models/__init__.py +68 -0
- mett-0.0.1a1/mett_dataportal/request_utils.py +77 -0
- mett-0.0.1a1/mett_dataportal/utils.py +56 -0
- mett-0.0.1a1/mett_dataportal/version.py +33 -0
- mett-0.0.1a1/mett_dataportal_sdk/__init__.py +274 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/__init__.py +23 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/drugs_api.py +1708 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/essentiality_api.py +457 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/fitness_api.py +423 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/gene_fitness_correlations_api.py +599 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/genes_api.py +3730 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/genomes_api.py +2747 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/mutant_growth_api.py +461 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/operons_api.py +720 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/orthologs_api.py +662 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/pooled_ttp_interactions_api.py +1443 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/protein_protein_interactions_api.py +1720 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/proteomics_api.py +402 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/py_hmmer_results_api.py +865 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/py_hmmer_search_api.py +284 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/reactions_api.py +408 -0
- mett-0.0.1a1/mett_dataportal_sdk/api/species_api.py +1044 -0
- mett-0.0.1a1/mett_dataportal_sdk/api_client.py +753 -0
- mett-0.0.1a1/mett_dataportal_sdk/api_response.py +20 -0
- mett-0.0.1a1/mett_dataportal_sdk/configuration.py +597 -0
- mett-0.0.1a1/mett_dataportal_sdk/exceptions.py +219 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/__init__.py +126 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/amr_schema.py +157 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/contig_schema.py +90 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/dbx_ref_schema.py +83 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/drug_metabolism_data_schema.py +197 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/drug_metabolism_search_query_schema.py +197 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/drug_mic_data_schema.py +171 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/drug_mic_search_query_schema.py +175 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/essentiality_search_query_schema.py +156 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/fitness_search_query_schema.py +139 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/gene_advanced_search_query_schema.py +185 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/gene_paginated_response_schema.py +126 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/gene_response_schema.py +389 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/gene_search_query_schema.py +119 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/genes_by_genome_query_schema.py +130 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/genome_paginated_response_schema.py +126 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/genome_response_schema.py +154 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/genome_search_query_schema.py +132 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/genomes_by_isolate_names_query_schema.py +84 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/get_all_genes_query_schema.py +106 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/get_all_genomes_query_schema.py +106 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/mutant_growth_search_query_schema.py +164 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/paginated_response_schema.py +116 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/paginated_strain_drug_metabolism_response_schema.py +138 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/paginated_strain_drug_mic_response_schema.py +133 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/pagination_metadata_schema.py +103 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_all_neighbors_response_schema.py +106 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_all_neighbors_schema.py +110 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_interaction_schema.py +342 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_neighbors_query_schema.py +105 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_network_properties_query_schema.py +107 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_network_properties_response_schema.py +108 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_network_properties_schema.py +100 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_network_query_schema.py +111 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_network_response_schema.py +106 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_network_schema.py +90 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_score_types_response_schema.py +100 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_search_query_schema.py +186 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ppi_search_response_schema.py +126 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/proteomics_search_query_schema.py +134 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/reactions_search_query_schema.py +133 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/response_status.py +35 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/result_query_schema.py +117 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/search_request_schema.py +223 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/species_genome_search_query_schema.py +124 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/strain_drug_data_response_schema.py +144 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/success_response_schema.py +105 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ttp_compound_interactions_query_schema.py +148 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ttp_gene_interactions_query_schema.py +149 -0
- mett-0.0.1a1/mett_dataportal_sdk/models/ttp_interaction_query_schema.py +119 -0
- mett-0.0.1a1/mett_dataportal_sdk/py.typed +0 -0
- mett-0.0.1a1/mett_dataportal_sdk/rest.py +243 -0
- mett-0.0.1a1/pyproject.toml +57 -0
- mett-0.0.1a1/setup.cfg +4 -0
- mett-0.0.1a1/tests/test_cli.py +113 -0
- mett-0.0.1a1/tests/test_cli_experimental.py +218 -0
- mett-0.0.1a1/tests/test_cli_genes.py +89 -0
- mett-0.0.1a1/tests/test_cli_genomes.py +81 -0
- mett-0.0.1a1/tests/test_cli_species.py +45 -0
mett-0.0.1a1/PKG-INFO
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mett
|
|
3
|
+
Version: 0.0.1a1
|
|
4
|
+
Summary: Python client and CLI for the METT Data Portal API
|
|
5
|
+
Author-email: microbiome-informatics <vikasg@ebi.ac.uk>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: microbiome,mgnify,genomics,api,cli
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: pydantic>=2.5
|
|
19
|
+
Requires-Dist: typer>=0.12
|
|
20
|
+
Requires-Dist: click>=8.1
|
|
21
|
+
Requires-Dist: rich>=13.7
|
|
22
|
+
Requires-Dist: requests>=2.31.0
|
|
23
|
+
Requires-Dist: urllib3<3,>=1.26
|
|
24
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
25
|
+
Requires-Dist: typing_extensions>=4.7.0
|
|
26
|
+
Requires-Dist: tomli>=2.0; python_version < "3.11"
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-mock>=3.11; extra == "dev"
|
|
30
|
+
Requires-Dist: ruff>=0.5; extra == "dev"
|
|
31
|
+
Requires-Dist: pre-commit>=3.5; extra == "dev"
|
|
32
|
+
Requires-Dist: build>=1; extra == "dev"
|
|
33
|
+
Requires-Dist: twine>=5; extra == "dev"
|
|
34
|
+
|
|
35
|
+
# METT Data Portal Client
|
|
36
|
+
|
|
37
|
+
[](https://www.python.org/downloads/)
|
|
38
|
+
[](https://opensource.org/licenses/MIT)
|
|
39
|
+
[](https://badge.fury.io/py/mett)
|
|
40
|
+
|
|
41
|
+
Python client library and command-line interface (CLI) for the METT Data Portal API. Access genomic data, experimental results, and protein interactions for gut microbiome research.
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- 🚀 **High-level Python API** - Clean, intuitive interface for programmatic access
|
|
46
|
+
- 💻 **Command-line Interface** - Powerful CLI with tab completion and rich output
|
|
47
|
+
- 📊 **Multiple Output Formats** - JSON, TSV, and formatted tables
|
|
48
|
+
- 🔒 **Flexible Authentication** - Environment variables or config file support
|
|
49
|
+
- 📚 **Comprehensive Documentation** - Auto-generated API reference with examples
|
|
50
|
+
- 🔄 **Auto-generated SDK** - Stays in sync with the API schema
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
### Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install mett
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### CLI Usage
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# List all species
|
|
64
|
+
mett species list
|
|
65
|
+
|
|
66
|
+
# Search genomes
|
|
67
|
+
mett genomes search --query "Bacteroides" --per-page 5
|
|
68
|
+
|
|
69
|
+
# Get gene information
|
|
70
|
+
mett genes get BU_ATCC8492_00001
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Python API
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from mett_dataportal import DataPortalClient
|
|
77
|
+
|
|
78
|
+
# Initialize client
|
|
79
|
+
client = DataPortalClient()
|
|
80
|
+
|
|
81
|
+
# List species
|
|
82
|
+
species = client.list_species()
|
|
83
|
+
print(f"Found {len(species)} species")
|
|
84
|
+
|
|
85
|
+
# Search genomes
|
|
86
|
+
result = client.search_genomes(query="Bacteroides", per_page=5)
|
|
87
|
+
print(f"Found {len(result.items)} genomes")
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Documentation
|
|
91
|
+
|
|
92
|
+
### Quick Links
|
|
93
|
+
|
|
94
|
+
- 📖 **[API Reference](docs/reference/api-reference.qmd)** - Complete API documentation with tabbed examples (Quarto format)
|
|
95
|
+
- 📘 **[Usage Guide](docs/guides/USAGE.md)** - Detailed usage examples for CLI and Python API
|
|
96
|
+
- ⚙️ **[Configuration Guide](docs/guides/CONFIGURATION.md)** - Authentication and configuration options
|
|
97
|
+
- 🔧 **[Development Guide](docs/developers/DEVELOPMENT.md)** - Setup, testing, and contributing
|
|
98
|
+
- 📦 **[Architecture Guide](docs/developers/ARCHITECTURE.md)** - Package architecture and design decisions
|
|
99
|
+
|
|
100
|
+
### Viewing API Documentation
|
|
101
|
+
|
|
102
|
+
The API reference is in Quarto format (`.qmd`). To view it:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Generate from OpenAPI spec (if needed)
|
|
106
|
+
python3 scripts/generate-api-docs.py
|
|
107
|
+
|
|
108
|
+
# Render to HTML
|
|
109
|
+
quarto render docs/reference/api-reference.qmd
|
|
110
|
+
|
|
111
|
+
# Open in browser
|
|
112
|
+
open docs/reference/api-reference.html
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Or use preview mode (auto-reloads on changes):
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
quarto preview docs/reference/api-reference.qmd
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The rendered HTML includes interactive tabs showing examples in three formats:
|
|
122
|
+
- **Friendly CLI** - High-level `mett` commands
|
|
123
|
+
- **Generic CLI** - `mett api request` commands
|
|
124
|
+
- **cURL** - Raw HTTP requests
|
|
125
|
+
|
|
126
|
+
For more information, see the [Documentation README](docs/README.md).
|
|
127
|
+
|
|
128
|
+
## Installation
|
|
129
|
+
|
|
130
|
+
### From PyPI
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pip install mett
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### From Source
|
|
137
|
+
|
|
138
|
+
#### Recommended (with `uv`)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
git clone https://github.com/your-org/mett-dataportal-client.git
|
|
142
|
+
cd mett-dataportal-client
|
|
143
|
+
|
|
144
|
+
# Create a virtual environment and install all dependencies from pyproject.toml
|
|
145
|
+
uv sync --all-extras --dev
|
|
146
|
+
|
|
147
|
+
# Run the CLI via uv (no manual activation needed)
|
|
148
|
+
uv run mett --help
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Running tests and linting
|
|
152
|
+
|
|
153
|
+
With `uv` (recommended):
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Install all dev dependencies (if not already done)
|
|
157
|
+
uv sync --all-extras --dev
|
|
158
|
+
|
|
159
|
+
# Run tests
|
|
160
|
+
uv run pytest -v
|
|
161
|
+
|
|
162
|
+
# Run Ruff lint and formatting checks
|
|
163
|
+
uv run ruff check mett_dataportal/ scripts/ tests/
|
|
164
|
+
uv run ruff format --check mett_dataportal/ scripts/ tests/
|
|
165
|
+
|
|
166
|
+
# (Optional) Run pre-commit hooks on all files
|
|
167
|
+
uv run pre-commit run --all-files
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Alternative (classic `pip` workflow)
|
|
171
|
+
|
|
172
|
+
If you prefer not to use `uv`, you can still work with a standard virtual environment:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
python -m venv .venv
|
|
176
|
+
source .venv/bin/activate
|
|
177
|
+
|
|
178
|
+
pip install --upgrade pip
|
|
179
|
+
pip install -e ".[dev]"
|
|
180
|
+
|
|
181
|
+
# CLI is now on PATH inside the venv
|
|
182
|
+
mett --help
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Requirements
|
|
186
|
+
|
|
187
|
+
- Python 3.10+
|
|
188
|
+
- See `pyproject.toml` for full dependency list
|
|
189
|
+
|
|
190
|
+
## Project Structure
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
mett-dataportal-client/
|
|
194
|
+
├── mett_dataportal/ # Main package
|
|
195
|
+
│ ├── cli/ # CLI commands (organized by API type)
|
|
196
|
+
│ │ ├── core/ # Core APIs (system, species, genomes, genes)
|
|
197
|
+
│ │ ├── experimental/ # Experimental APIs (drugs, proteomics, etc.)
|
|
198
|
+
│ │ └── interactions/ # Interaction APIs (PPI, TTP)
|
|
199
|
+
│ ├── client.py # High-level API client
|
|
200
|
+
│ ├── config.py # Configuration management
|
|
201
|
+
│ └── utils.py # Utility functions
|
|
202
|
+
├── mett_dataportal_sdk/ # Auto-generated SDK
|
|
203
|
+
├── docs/ # Documentation
|
|
204
|
+
│ ├── guides/ # User guides
|
|
205
|
+
│ │ ├── USAGE.md # Usage examples
|
|
206
|
+
│ │ └── CONFIGURATION.md # Configuration guide
|
|
207
|
+
│ ├── developers/ # Developer documentation
|
|
208
|
+
│ │ └── DEVELOPMENT.md # Development guide
|
|
209
|
+
│ ├── reference/ # API reference
|
|
210
|
+
│ │ ├── api-reference.qmd # Main API reference (Quarto)
|
|
211
|
+
│ │ └── cli-examples*.md # Example files
|
|
212
|
+
│ └── assets/ # Static assets (CSS, etc.)
|
|
213
|
+
├── scripts/ # Utility scripts
|
|
214
|
+
└── tests/ # Test suite
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Contributing
|
|
218
|
+
|
|
219
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
220
|
+
|
|
221
|
+
1. Fork the repository
|
|
222
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
223
|
+
3. Make your changes
|
|
224
|
+
4. Run tests and linting (see **Running tests and linting** above)
|
|
225
|
+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
226
|
+
6. Push to the branch (`git push origin feature/feature/amazing-feature`)
|
|
227
|
+
7. Open a Pull Request
|
|
228
|
+
|
|
229
|
+
## License
|
|
230
|
+
|
|
231
|
+
MIT License - see LICENSE file for details.
|
|
232
|
+
|
|
233
|
+
## Support
|
|
234
|
+
|
|
235
|
+
- **Issues**: [GitHub Issues](https://github.com/your-org/mett-dataportal-client/issues)
|
|
236
|
+
- **Documentation**: See [docs/](docs/) directory
|
|
237
|
+
- **Email**: vikasg@ebi.ac.uk
|
|
238
|
+
|
|
239
|
+
## Acknowledgments
|
|
240
|
+
|
|
241
|
+
Built for the METT Data Portal project. Special thanks to all contributors.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
**Note**: For development environments without SSL certificates, you may need to set:
|
|
246
|
+
```bash
|
|
247
|
+
export METT_VERIFY_SSL=false
|
|
248
|
+
```
|
mett-0.0.1a1/README.md
ADDED
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# METT Data Portal Client
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/downloads/)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://badge.fury.io/py/mett)
|
|
6
|
+
|
|
7
|
+
Python client library and command-line interface (CLI) for the METT Data Portal API. Access genomic data, experimental results, and protein interactions for gut microbiome research.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- 🚀 **High-level Python API** - Clean, intuitive interface for programmatic access
|
|
12
|
+
- 💻 **Command-line Interface** - Powerful CLI with tab completion and rich output
|
|
13
|
+
- 📊 **Multiple Output Formats** - JSON, TSV, and formatted tables
|
|
14
|
+
- 🔒 **Flexible Authentication** - Environment variables or config file support
|
|
15
|
+
- 📚 **Comprehensive Documentation** - Auto-generated API reference with examples
|
|
16
|
+
- 🔄 **Auto-generated SDK** - Stays in sync with the API schema
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
### Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install mett
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### CLI Usage
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# List all species
|
|
30
|
+
mett species list
|
|
31
|
+
|
|
32
|
+
# Search genomes
|
|
33
|
+
mett genomes search --query "Bacteroides" --per-page 5
|
|
34
|
+
|
|
35
|
+
# Get gene information
|
|
36
|
+
mett genes get BU_ATCC8492_00001
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Python API
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from mett_dataportal import DataPortalClient
|
|
43
|
+
|
|
44
|
+
# Initialize client
|
|
45
|
+
client = DataPortalClient()
|
|
46
|
+
|
|
47
|
+
# List species
|
|
48
|
+
species = client.list_species()
|
|
49
|
+
print(f"Found {len(species)} species")
|
|
50
|
+
|
|
51
|
+
# Search genomes
|
|
52
|
+
result = client.search_genomes(query="Bacteroides", per_page=5)
|
|
53
|
+
print(f"Found {len(result.items)} genomes")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
### Quick Links
|
|
59
|
+
|
|
60
|
+
- 📖 **[API Reference](docs/reference/api-reference.qmd)** - Complete API documentation with tabbed examples (Quarto format)
|
|
61
|
+
- 📘 **[Usage Guide](docs/guides/USAGE.md)** - Detailed usage examples for CLI and Python API
|
|
62
|
+
- ⚙️ **[Configuration Guide](docs/guides/CONFIGURATION.md)** - Authentication and configuration options
|
|
63
|
+
- 🔧 **[Development Guide](docs/developers/DEVELOPMENT.md)** - Setup, testing, and contributing
|
|
64
|
+
- 📦 **[Architecture Guide](docs/developers/ARCHITECTURE.md)** - Package architecture and design decisions
|
|
65
|
+
|
|
66
|
+
### Viewing API Documentation
|
|
67
|
+
|
|
68
|
+
The API reference is in Quarto format (`.qmd`). To view it:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Generate from OpenAPI spec (if needed)
|
|
72
|
+
python3 scripts/generate-api-docs.py
|
|
73
|
+
|
|
74
|
+
# Render to HTML
|
|
75
|
+
quarto render docs/reference/api-reference.qmd
|
|
76
|
+
|
|
77
|
+
# Open in browser
|
|
78
|
+
open docs/reference/api-reference.html
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Or use preview mode (auto-reloads on changes):
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
quarto preview docs/reference/api-reference.qmd
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The rendered HTML includes interactive tabs showing examples in three formats:
|
|
88
|
+
- **Friendly CLI** - High-level `mett` commands
|
|
89
|
+
- **Generic CLI** - `mett api request` commands
|
|
90
|
+
- **cURL** - Raw HTTP requests
|
|
91
|
+
|
|
92
|
+
For more information, see the [Documentation README](docs/README.md).
|
|
93
|
+
|
|
94
|
+
## Installation
|
|
95
|
+
|
|
96
|
+
### From PyPI
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
pip install mett
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### From Source
|
|
103
|
+
|
|
104
|
+
#### Recommended (with `uv`)
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
git clone https://github.com/your-org/mett-dataportal-client.git
|
|
108
|
+
cd mett-dataportal-client
|
|
109
|
+
|
|
110
|
+
# Create a virtual environment and install all dependencies from pyproject.toml
|
|
111
|
+
uv sync --all-extras --dev
|
|
112
|
+
|
|
113
|
+
# Run the CLI via uv (no manual activation needed)
|
|
114
|
+
uv run mett --help
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Running tests and linting
|
|
118
|
+
|
|
119
|
+
With `uv` (recommended):
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Install all dev dependencies (if not already done)
|
|
123
|
+
uv sync --all-extras --dev
|
|
124
|
+
|
|
125
|
+
# Run tests
|
|
126
|
+
uv run pytest -v
|
|
127
|
+
|
|
128
|
+
# Run Ruff lint and formatting checks
|
|
129
|
+
uv run ruff check mett_dataportal/ scripts/ tests/
|
|
130
|
+
uv run ruff format --check mett_dataportal/ scripts/ tests/
|
|
131
|
+
|
|
132
|
+
# (Optional) Run pre-commit hooks on all files
|
|
133
|
+
uv run pre-commit run --all-files
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### Alternative (classic `pip` workflow)
|
|
137
|
+
|
|
138
|
+
If you prefer not to use `uv`, you can still work with a standard virtual environment:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
python -m venv .venv
|
|
142
|
+
source .venv/bin/activate
|
|
143
|
+
|
|
144
|
+
pip install --upgrade pip
|
|
145
|
+
pip install -e ".[dev]"
|
|
146
|
+
|
|
147
|
+
# CLI is now on PATH inside the venv
|
|
148
|
+
mett --help
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Requirements
|
|
152
|
+
|
|
153
|
+
- Python 3.10+
|
|
154
|
+
- See `pyproject.toml` for full dependency list
|
|
155
|
+
|
|
156
|
+
## Project Structure
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
mett-dataportal-client/
|
|
160
|
+
├── mett_dataportal/ # Main package
|
|
161
|
+
│ ├── cli/ # CLI commands (organized by API type)
|
|
162
|
+
│ │ ├── core/ # Core APIs (system, species, genomes, genes)
|
|
163
|
+
│ │ ├── experimental/ # Experimental APIs (drugs, proteomics, etc.)
|
|
164
|
+
│ │ └── interactions/ # Interaction APIs (PPI, TTP)
|
|
165
|
+
│ ├── client.py # High-level API client
|
|
166
|
+
│ ├── config.py # Configuration management
|
|
167
|
+
│ └── utils.py # Utility functions
|
|
168
|
+
├── mett_dataportal_sdk/ # Auto-generated SDK
|
|
169
|
+
├── docs/ # Documentation
|
|
170
|
+
│ ├── guides/ # User guides
|
|
171
|
+
│ │ ├── USAGE.md # Usage examples
|
|
172
|
+
│ │ └── CONFIGURATION.md # Configuration guide
|
|
173
|
+
│ ├── developers/ # Developer documentation
|
|
174
|
+
│ │ └── DEVELOPMENT.md # Development guide
|
|
175
|
+
│ ├── reference/ # API reference
|
|
176
|
+
│ │ ├── api-reference.qmd # Main API reference (Quarto)
|
|
177
|
+
│ │ └── cli-examples*.md # Example files
|
|
178
|
+
│ └── assets/ # Static assets (CSS, etc.)
|
|
179
|
+
├── scripts/ # Utility scripts
|
|
180
|
+
└── tests/ # Test suite
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Contributing
|
|
184
|
+
|
|
185
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
186
|
+
|
|
187
|
+
1. Fork the repository
|
|
188
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
189
|
+
3. Make your changes
|
|
190
|
+
4. Run tests and linting (see **Running tests and linting** above)
|
|
191
|
+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
192
|
+
6. Push to the branch (`git push origin feature/feature/amazing-feature`)
|
|
193
|
+
7. Open a Pull Request
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
MIT License - see LICENSE file for details.
|
|
198
|
+
|
|
199
|
+
## Support
|
|
200
|
+
|
|
201
|
+
- **Issues**: [GitHub Issues](https://github.com/your-org/mett-dataportal-client/issues)
|
|
202
|
+
- **Documentation**: See [docs/](docs/) directory
|
|
203
|
+
- **Email**: vikasg@ebi.ac.uk
|
|
204
|
+
|
|
205
|
+
## Acknowledgments
|
|
206
|
+
|
|
207
|
+
Built for the METT Data Portal project. Special thanks to all contributors.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
**Note**: For development environments without SSL certificates, you may need to set:
|
|
212
|
+
```bash
|
|
213
|
+
export METT_VERIFY_SSL=false
|
|
214
|
+
```
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mett
|
|
3
|
+
Version: 0.0.1a1
|
|
4
|
+
Summary: Python client and CLI for the METT Data Portal API
|
|
5
|
+
Author-email: microbiome-informatics <vikasg@ebi.ac.uk>
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: microbiome,mgnify,genomics,api,cli
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Science/Research
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
16
|
+
Requires-Python: >=3.10
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: pydantic>=2.5
|
|
19
|
+
Requires-Dist: typer>=0.12
|
|
20
|
+
Requires-Dist: click>=8.1
|
|
21
|
+
Requires-Dist: rich>=13.7
|
|
22
|
+
Requires-Dist: requests>=2.31.0
|
|
23
|
+
Requires-Dist: urllib3<3,>=1.26
|
|
24
|
+
Requires-Dist: python-dateutil>=2.8.2
|
|
25
|
+
Requires-Dist: typing_extensions>=4.7.0
|
|
26
|
+
Requires-Dist: tomli>=2.0; python_version < "3.11"
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7.4; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-mock>=3.11; extra == "dev"
|
|
30
|
+
Requires-Dist: ruff>=0.5; extra == "dev"
|
|
31
|
+
Requires-Dist: pre-commit>=3.5; extra == "dev"
|
|
32
|
+
Requires-Dist: build>=1; extra == "dev"
|
|
33
|
+
Requires-Dist: twine>=5; extra == "dev"
|
|
34
|
+
|
|
35
|
+
# METT Data Portal Client
|
|
36
|
+
|
|
37
|
+
[](https://www.python.org/downloads/)
|
|
38
|
+
[](https://opensource.org/licenses/MIT)
|
|
39
|
+
[](https://badge.fury.io/py/mett)
|
|
40
|
+
|
|
41
|
+
Python client library and command-line interface (CLI) for the METT Data Portal API. Access genomic data, experimental results, and protein interactions for gut microbiome research.
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
- 🚀 **High-level Python API** - Clean, intuitive interface for programmatic access
|
|
46
|
+
- 💻 **Command-line Interface** - Powerful CLI with tab completion and rich output
|
|
47
|
+
- 📊 **Multiple Output Formats** - JSON, TSV, and formatted tables
|
|
48
|
+
- 🔒 **Flexible Authentication** - Environment variables or config file support
|
|
49
|
+
- 📚 **Comprehensive Documentation** - Auto-generated API reference with examples
|
|
50
|
+
- 🔄 **Auto-generated SDK** - Stays in sync with the API schema
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
### Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install mett
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### CLI Usage
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# List all species
|
|
64
|
+
mett species list
|
|
65
|
+
|
|
66
|
+
# Search genomes
|
|
67
|
+
mett genomes search --query "Bacteroides" --per-page 5
|
|
68
|
+
|
|
69
|
+
# Get gene information
|
|
70
|
+
mett genes get BU_ATCC8492_00001
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Python API
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from mett_dataportal import DataPortalClient
|
|
77
|
+
|
|
78
|
+
# Initialize client
|
|
79
|
+
client = DataPortalClient()
|
|
80
|
+
|
|
81
|
+
# List species
|
|
82
|
+
species = client.list_species()
|
|
83
|
+
print(f"Found {len(species)} species")
|
|
84
|
+
|
|
85
|
+
# Search genomes
|
|
86
|
+
result = client.search_genomes(query="Bacteroides", per_page=5)
|
|
87
|
+
print(f"Found {len(result.items)} genomes")
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Documentation
|
|
91
|
+
|
|
92
|
+
### Quick Links
|
|
93
|
+
|
|
94
|
+
- 📖 **[API Reference](docs/reference/api-reference.qmd)** - Complete API documentation with tabbed examples (Quarto format)
|
|
95
|
+
- 📘 **[Usage Guide](docs/guides/USAGE.md)** - Detailed usage examples for CLI and Python API
|
|
96
|
+
- ⚙️ **[Configuration Guide](docs/guides/CONFIGURATION.md)** - Authentication and configuration options
|
|
97
|
+
- 🔧 **[Development Guide](docs/developers/DEVELOPMENT.md)** - Setup, testing, and contributing
|
|
98
|
+
- 📦 **[Architecture Guide](docs/developers/ARCHITECTURE.md)** - Package architecture and design decisions
|
|
99
|
+
|
|
100
|
+
### Viewing API Documentation
|
|
101
|
+
|
|
102
|
+
The API reference is in Quarto format (`.qmd`). To view it:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Generate from OpenAPI spec (if needed)
|
|
106
|
+
python3 scripts/generate-api-docs.py
|
|
107
|
+
|
|
108
|
+
# Render to HTML
|
|
109
|
+
quarto render docs/reference/api-reference.qmd
|
|
110
|
+
|
|
111
|
+
# Open in browser
|
|
112
|
+
open docs/reference/api-reference.html
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Or use preview mode (auto-reloads on changes):
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
quarto preview docs/reference/api-reference.qmd
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The rendered HTML includes interactive tabs showing examples in three formats:
|
|
122
|
+
- **Friendly CLI** - High-level `mett` commands
|
|
123
|
+
- **Generic CLI** - `mett api request` commands
|
|
124
|
+
- **cURL** - Raw HTTP requests
|
|
125
|
+
|
|
126
|
+
For more information, see the [Documentation README](docs/README.md).
|
|
127
|
+
|
|
128
|
+
## Installation
|
|
129
|
+
|
|
130
|
+
### From PyPI
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
pip install mett
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### From Source
|
|
137
|
+
|
|
138
|
+
#### Recommended (with `uv`)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
git clone https://github.com/your-org/mett-dataportal-client.git
|
|
142
|
+
cd mett-dataportal-client
|
|
143
|
+
|
|
144
|
+
# Create a virtual environment and install all dependencies from pyproject.toml
|
|
145
|
+
uv sync --all-extras --dev
|
|
146
|
+
|
|
147
|
+
# Run the CLI via uv (no manual activation needed)
|
|
148
|
+
uv run mett --help
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Running tests and linting
|
|
152
|
+
|
|
153
|
+
With `uv` (recommended):
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
# Install all dev dependencies (if not already done)
|
|
157
|
+
uv sync --all-extras --dev
|
|
158
|
+
|
|
159
|
+
# Run tests
|
|
160
|
+
uv run pytest -v
|
|
161
|
+
|
|
162
|
+
# Run Ruff lint and formatting checks
|
|
163
|
+
uv run ruff check mett_dataportal/ scripts/ tests/
|
|
164
|
+
uv run ruff format --check mett_dataportal/ scripts/ tests/
|
|
165
|
+
|
|
166
|
+
# (Optional) Run pre-commit hooks on all files
|
|
167
|
+
uv run pre-commit run --all-files
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
#### Alternative (classic `pip` workflow)
|
|
171
|
+
|
|
172
|
+
If you prefer not to use `uv`, you can still work with a standard virtual environment:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
python -m venv .venv
|
|
176
|
+
source .venv/bin/activate
|
|
177
|
+
|
|
178
|
+
pip install --upgrade pip
|
|
179
|
+
pip install -e ".[dev]"
|
|
180
|
+
|
|
181
|
+
# CLI is now on PATH inside the venv
|
|
182
|
+
mett --help
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Requirements
|
|
186
|
+
|
|
187
|
+
- Python 3.10+
|
|
188
|
+
- See `pyproject.toml` for full dependency list
|
|
189
|
+
|
|
190
|
+
## Project Structure
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
mett-dataportal-client/
|
|
194
|
+
├── mett_dataportal/ # Main package
|
|
195
|
+
│ ├── cli/ # CLI commands (organized by API type)
|
|
196
|
+
│ │ ├── core/ # Core APIs (system, species, genomes, genes)
|
|
197
|
+
│ │ ├── experimental/ # Experimental APIs (drugs, proteomics, etc.)
|
|
198
|
+
│ │ └── interactions/ # Interaction APIs (PPI, TTP)
|
|
199
|
+
│ ├── client.py # High-level API client
|
|
200
|
+
│ ├── config.py # Configuration management
|
|
201
|
+
│ └── utils.py # Utility functions
|
|
202
|
+
├── mett_dataportal_sdk/ # Auto-generated SDK
|
|
203
|
+
├── docs/ # Documentation
|
|
204
|
+
│ ├── guides/ # User guides
|
|
205
|
+
│ │ ├── USAGE.md # Usage examples
|
|
206
|
+
│ │ └── CONFIGURATION.md # Configuration guide
|
|
207
|
+
│ ├── developers/ # Developer documentation
|
|
208
|
+
│ │ └── DEVELOPMENT.md # Development guide
|
|
209
|
+
│ ├── reference/ # API reference
|
|
210
|
+
│ │ ├── api-reference.qmd # Main API reference (Quarto)
|
|
211
|
+
│ │ └── cli-examples*.md # Example files
|
|
212
|
+
│ └── assets/ # Static assets (CSS, etc.)
|
|
213
|
+
├── scripts/ # Utility scripts
|
|
214
|
+
└── tests/ # Test suite
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Contributing
|
|
218
|
+
|
|
219
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
220
|
+
|
|
221
|
+
1. Fork the repository
|
|
222
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
223
|
+
3. Make your changes
|
|
224
|
+
4. Run tests and linting (see **Running tests and linting** above)
|
|
225
|
+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
226
|
+
6. Push to the branch (`git push origin feature/feature/amazing-feature`)
|
|
227
|
+
7. Open a Pull Request
|
|
228
|
+
|
|
229
|
+
## License
|
|
230
|
+
|
|
231
|
+
MIT License - see LICENSE file for details.
|
|
232
|
+
|
|
233
|
+
## Support
|
|
234
|
+
|
|
235
|
+
- **Issues**: [GitHub Issues](https://github.com/your-org/mett-dataportal-client/issues)
|
|
236
|
+
- **Documentation**: See [docs/](docs/) directory
|
|
237
|
+
- **Email**: vikasg@ebi.ac.uk
|
|
238
|
+
|
|
239
|
+
## Acknowledgments
|
|
240
|
+
|
|
241
|
+
Built for the METT Data Portal project. Special thanks to all contributors.
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
**Note**: For development environments without SSL certificates, you may need to set:
|
|
246
|
+
```bash
|
|
247
|
+
export METT_VERIFY_SSL=false
|
|
248
|
+
```
|