Skip to main content

Apache Airflow DolphinDB provider containing Operators.

Project description

Airflow-provider-dolphindb

Installing airflow-provider-dolphindb

pip install airflow-provider-dolphindb

Example DAGs

To create a database and a table in it, and then execute an external .dos script file to insert data, follow these steps:

  1. Copy the example_dolphindb.py file to your DAGs folder. If you use the default airflow configuration airflow.cfg, you may need to create the DAGs folder yourself, which is located in AIRFLOW_HOME/dags.

  2. Copy the insert_data.dos file to the same directory as example_dolphindb.py.

  3. Start your DolphinDB server on port 8848.

  4. Start airflow in the development environment:

    cd /your/project/dir/
    # Only absolute paths are accepted
    export AIRFLOW_HOME=/your/project/dir/
    export AIRFLOW_CONN_DOLPHINDB_DEFAULT="dolphindb://admin:123456@127.0.0.1:8848"
    python -m airflow standalone
    

Please refer to the Official documentation for the production environment.

Now, you can find the example_dolphindb DAG on your airflow web page. You can try to trigger it.

Developer Documentation

Installing Apache Airflow

Refer to https://airflow.apache.org/docs/apache-airflow/stable/start.html for further details on this topic.

# It is recommended to use the current project directory as the airflow working directory
cd /your/source/dir/airflow-provider-dolphindb
# Only absolute paths are accepted
export AIRFLOW_HOME=/your/source/dir/airflow-provider-dolphindb

# Install apache-airflow 2.6.3
AIRFLOW_VERSION=2.6.3
PYTHON_VERSION="$(python --version | cut -d " " -f 2 | cut -d "." -f 1-2)"
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"

pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"

Additionally, you may need to install Kubernetes to eliminate errors in airflow routines:

pip install kubernetes

Installing airflow-provider-dolphindb for testing

Refer to https://pip.pypa.io/en/stable/cli/pip_install/#install-editable for further details on this topic.

python -m pip install -e .

Testing

Run the following commands to validate the installation procedure above.

cd /your/source/dir/airflow-provider-dolphindb
# Only absolute paths are accepted
export AIRFLOW_HOME=/your/source/dir/airflow-provider-dolphindb
export AIRFLOW_CONN_DOLPHINDB_DEFAULT="dolphindb://admin:123456@127.0.0.1:8848"
pytest

Packaging airflow-provider-dolphindb

Run the following command.

python -m build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file airflow_provider_dolphindb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: airflow_provider_dolphindb-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for airflow_provider_dolphindb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6f07c34751ad1dd224ddd64ace78d68449d157f59e5b76642136444ad500c93
MD5 6ee3ad0b192e14150994a9f54cdec6de
BLAKE2b-256 ff3b06b81ce3cbe9704878f38f590b843bcafb61985badd155a5a1512d2b396d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page