From 7043ac6bae38924d858871f39d1fbf3b7b2081d6 Mon Sep 17 00:00:00 2001
From: Volodymyr Savchenko <Volodymyr.Savchenko@unige.ch>
Date: Wed, 24 Feb 2021 16:48:46 +0100
Subject: [PATCH] initial prototype

---
 astroquery/oda/__init__.py            | 35 +++++++++++++++++++++++++++
 astroquery/oda/core.py                | 32 ++++++++++++++++++++++++
 astroquery/oda/tests/__init__.py      |  0
 astroquery/oda/tests/setup_package.py | 11 +++++++++
 astroquery/oda/tests/test_oda.py      | 15 ++++++++++++
 5 files changed, 93 insertions(+)
 create mode 100644 astroquery/oda/__init__.py
 create mode 100644 astroquery/oda/core.py
 create mode 100644 astroquery/oda/tests/__init__.py
 create mode 100644 astroquery/oda/tests/setup_package.py
 create mode 100644 astroquery/oda/tests/test_oda.py

diff --git a/astroquery/oda/__init__.py b/astroquery/oda/__init__.py
new file mode 100644
index 0000000000..f218bea61a
--- /dev/null
+++ b/astroquery/oda/__init__.py
@@ -0,0 +1,35 @@
+# Licensed under a 3-clause BSD style license - see LICENSE.rst
+"""
+Astro ODA
+-------
+
+TODO
+
+https://www.astro.unige.ch/cdci/astrooda_/
+https://github.com/oda-hub/oda_api
+https://marketplace.eosc-portal.eu/services/astronomical-online-data-analysis-astrooda
+"""
+from astropy import config as _config
+
+
+class Conf(_config.ConfigNamespace):
+    """
+    Configuration parameters for `astroquery.oda`.
+    """
+
+    server = _config.ConfigItem(
+        ['https://www.astro.unige.ch/cdci/astrooda_'],
+        'frontend base URL')
+
+    timeout = _config.ConfigItem(
+        30,
+        'Time limit')
+
+
+conf = Conf()
+
+from .core import ODA, ODAClass
+
+__all__ = ['ODA', 'ODAClass',
+           'Conf', 'conf',
+           ]
diff --git a/astroquery/oda/core.py b/astroquery/oda/core.py
new file mode 100644
index 0000000000..ecec72122e
--- /dev/null
+++ b/astroquery/oda/core.py
@@ -0,0 +1,32 @@
+# Licensed under a 3-clause BSD style license - see LICENSE.rst
+
+import warnings
+from six import BytesIO
+from astropy.table import Table
+from astropy.io import fits
+from astropy import coordinates
+from astropy import units as u
+from ..query import BaseQuery
+from ..utils import commons
+from ..utils import async_to_sync
+from ..exceptions import InvalidQueryError, NoResultsWarning
+from . import conf
+
+__all__ = ['ODA', 'ODAClass']
+
+
+@async_to_sync
+class ODAClass(BaseQuery):
+
+    """
+    ...
+    """
+
+    URL = conf.server
+    TIMEOUT = conf.timeout
+
+    def query(self):
+        raise NotImplementedError
+
+
+ODA = ODAClass()
diff --git a/astroquery/oda/tests/__init__.py b/astroquery/oda/tests/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/astroquery/oda/tests/setup_package.py b/astroquery/oda/tests/setup_package.py
new file mode 100644
index 0000000000..13172d1491
--- /dev/null
+++ b/astroquery/oda/tests/setup_package.py
@@ -0,0 +1,11 @@
+# Licensed under a 3-clause BSD style license - see LICENSE.rst
+
+
+import os
+
+
+def get_package_data():
+    paths = [os.path.join('data', '*.dat'),
+             os.path.join('data', '*.xml'),
+             ]
+    return {'astroquery.oda.tests': paths}
diff --git a/astroquery/oda/tests/test_oda.py b/astroquery/oda/tests/test_oda.py
new file mode 100644
index 0000000000..a3cb220091
--- /dev/null
+++ b/astroquery/oda/tests/test_oda.py
@@ -0,0 +1,15 @@
+# Licensed under a 3-clause BSD style license - see LICENSE.rst
+
+
+import pytest
+import requests
+
+from ...oda import ODA
+from ...utils import commons
+
+
+@pytest.mark.remote_data
+class TestODA:
+
+    def test_basic_example(self):
+        pass