8000 GitHub - trufnetwork/adapters
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

trufnetwork/adapters

Repository files navigation

TN Adapters

Adapters facilitate the ingestion of data from various sources into TN, leveraging the SDK and Prefect for efficient data management.

Note: While adapters use a Python Framework, it's also possible to push data from other languages like Go or JavaScript. Refer to the respective SDKs for more information:

Prerequisites

  • Programming Knowledge:
  • Tools:
    • Docker
    • Prefect
    • Access to a TN Node (local or remote). You can refer to documentation here. TLDR: you can run task single:start from that repository after you clone it.

Setting Up the Development Environment

  1. Clone the Repository:
git clone https://github.com/trufnetwork/adapters.git
cd adapters
  1. Configure Environment Variables:
  • Duplicate the .env.example file and rename it to .env.
  • Update the environment variables in the .env file as needed.
  1. Setup Virtual Environment:

We recommend using a virtual environment to manage dependencies. You can create one using the following commands:

python -m venv .venv
source .venv/bin/activate
pip install -e ."[dev]"
  1. Launch Services with Docker Compose:
docker compose up -d

This command initializes the necessary services in the background.

  1. Browser:

If you prefer to see the flows and blocks in browser, you can access http://localhost:4200/dashboard, on your local machine.

Understanding Reusable Tasks

The repository offers several reusable tasks to facilitate data ingestion into TN. However you can develop your own tasks to fit your use-case, these tasks can serve as example how to implement custom adapter to your data:

Reading Data:

TN Operations:

Data Manipulation:

Examples

Ingesting Data from Google Sheets

The repository includes examples demonstrating data ingestion from Google Sheets:

  • Direct Method: Specify the sheet ID and source ID directly.
  • Dynamic Method: Retrieve the sheet ID and source ID from a CSV file in a GitHub repository.

Refer to the examples directory for detailed implementations.

Additional Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

0