Metadata-Version: 2.4
Name: gena-datasets
Version: 0.1.0
Summary: Browse public Gena datasets and submit datasets for review.
License-Expression: MIT
Keywords: gena,datasets,tuluai,machine-learning
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# `gena-datasets`

Python client for browsing public datasets and submitting a dataset to Gena for review.

## Install

```sh
python -m pip install gena-datasets
```

## Read public datasets

```python
from gena_datasets import GenaDatasetsClient

gena = GenaDatasetsClient()
for item in gena.list_datasets():
    print(item["id"], item["title"], item["license"])

dataset = gena.get_dataset("tulueng100-reference")
print(dataset["content"])
```

Public catalog access does not require sign-in. `download_dataset(id)` returns the original dataset file contents as text.

## Submit a dataset

```python
id_token = current_firebase_user.get_id_token()
submission = gena.submit_dataset(
    {
        "title": "Example collection",
        "description": "A short description of the data and how it was collected.",
        "language": "English",
        "license": "CC BY 4.0",
        "fileName": "examples.jsonl",
        "content": '{"text":"Example"}\n',
        "rightsConfirmed": True,
    },
    id_token=id_token,
)

print(submission["datasetId"], submission["status"])
```

Submissions are private while pending review. A designated Gena moderator must approve a submission before it becomes public. The contributor must have permission to share the data and choose a license that allows publication. Current uploads are limited to 900,000 bytes and `.csv`, `.json`, `.jsonl`, or `.txt` files.

## API endpoints

- `GET /api/gena/datasets`
- `GET /api/gena/datasets/{id}`
- `POST /api/gena/datasets` with a signed-in account token

## License

MIT
