Python SDK for Atlas API - A research cartography platform
Project description
Atlas Python SDK
Official Python SDK for the Atlas API.
Installation
pip install wattslab-atlas
Quick Start
Create an Atlas API key in the web app, then pass it directly or set ATLAS_API_KEY.
from wattslab_atlas import AtlasClient
client = AtlasClient(api_key="atlas_...")
features = client.list_features()
for feature in features:
print(f"{feature.feature_name}: {feature.feature_description}")
papers = client.list_papers()
print(f"You have {papers.total_papers} papers")
You can also use an environment variable:
export ATLAS_API_KEY="atlas_..."
from wattslab_atlas import AtlasClient
client = AtlasClient()
projects = client.list_projects()
Authentication
API-key authentication is the recommended SDK path. The client sends the key as X-API-Key on every request.
client = AtlasClient(api_key="atlas_...")
client.set_api_key("atlas_new_key")
The older magic-link flow is still available for compatibility:
client = AtlasClient()
client.login("user@example.com")
client.validate_magic_link("token-from-email")
Usage
Working with Features
from wattslab_atlas.models import FeatureCreate
features = client.list_features()
feature = FeatureCreate(
feature_name="Sample Size",
feature_description="Number of participants",
feature_identifier="sample_size",
feature_type="integer",
)
created = client.create_feature(feature)
client.delete_feature(created.id)
Working with Papers
papers = client.list_papers(page=1, page_size=10)
result = client.upload_paper(
project_id="project-123",
file_path="paper.pdf",
)
task_id = result["paper.pdf"]
status = client.check_task_status(task_id)
client.reprocess_paper(paper_id, project_id)
Managing Projects
features = client.get_project_features(project_id)
client.update_project_features(
project_id,
feature_ids=["feat1", "feat2"],
)
client.remove_project_features(
project_id,
feature_ids=["feat1"],
)
result = client.reprocess_project(project_id)
Error Handling
from wattslab_atlas import AtlasClient, APIError, ResourceNotFoundError
client = AtlasClient(api_key="atlas_...")
try:
features = client.list_features()
except APIError as exc:
print(f"Atlas API error: {exc}")
except ResourceNotFoundError as exc:
print(f"Resource not found: {exc}")
Requirements
- Python 3.9+
- Atlas API key
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wattslab_atlas-1.3.0.tar.gz.
File metadata
- Download URL: wattslab_atlas-1.3.0.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
167fee283dc4f82badf7238c5393dd8d29f908eac33dcb6380c03b7646cdfdac
|
|
| MD5 |
12941d111e3762de436378d21cf24212
|
|
| BLAKE2b-256 |
2d731889c3bf5ce1283fa2d3c1f9e6bc10d702ee2addb621172419e908d1a34a
|
File details
Details for the file wattslab_atlas-1.3.0-py3-none-any.whl.
File metadata
- Download URL: wattslab_atlas-1.3.0-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e94b0202ad3127e855e87dbacad5efdc851d0637f377779c370c758075e6c6b2
|
|
| MD5 |
74a1348a748a4fb5ce4c64ab99eaa1d6
|
|
| BLAKE2b-256 |
9ccb4c0721e4c8ce3842b9e0d7bcd991ff305aa57c9115cc926f3384c32290d5
|