How To Create a Kyriba Python Pipeline with PyAirbyte

10 min read
April 24, 2024

When extracting data from Kyriba for integration into various systems or for analytics, developers often face challenges such as dealing with complex APIs, ensuring secure authentication, and managing cumbersome custom scripts that are difficult to maintain. These challenges can significantly slow down the data integration process, making it both time-consuming and prone to errors.

PyAirbyte offers a compelling solution to these issues by simplifying the data extraction and integration process. With its user-friendly configuration and automatic handling of complexities, PyAirbyte reduces the technical overhead, making it easier to set up efficient, reliable data pipelines.

Traditional Methods for Creating Kyriba Data Pipelines

Traditionally, integrating data from Kyriba into other systems or data warehouses involves writing custom Python scripts. These scripts are designed to interact with Kyriba's APIs, extract the needed data, transform it into a suitable format, and then load it into the target system. This process, often part of an ETL (Extract, Transform, Load) pipeline, requires in-depth knowledge of Python programming, understanding of Kyriba's API endpoints, authentication mechanisms, and data structures.

Pain Points in Extracting Data from Kyriba

Extracting data from Kyriba using custom scripts presents several challenges:

  • API Complexity and Limitations: Kyriba's APIs might have rate limits, complex authentication processes, or return data in formats that are not directly compatible with target systems. This requires additional code for handling these nuances, making the scripts complicated and hard to maintain.
  • Error Handling: Custom scripts need robust error handling to manage intermittent connectivity issues, API changes, or data format changes. Implementing comprehensive error handling can be time-consuming and requires regular updates to the scripts.
  • Data Transformation Efforts: Kyriba's data model might not directly map to the schema of the target system. Developers must therefore write complex transformation logic, which can become a significant maintenance burden as the number of data fields or API endpoints grows.
  • Scalability Issues: As the volume of data grows, custom scripts might struggle to process data efficiently. Scaling these scripts to handle more data or additional data sources can require significant refactoring.

Impact on Data Pipeline Efficiency and Maintenance

The challenges of using custom Python scripts for Kyriba data integration have a direct impact on the efficiency and maintenance of data pipelines:

  • Reduced Efficiency: The time and effort required to handle API complexity, write transformation logic, and manage error handling can significantly slow down data pipeline development and execution. This reduces the overall efficiency of data operations, as resources are diverted to maintaining existing pipelines instead of focusing on new insights or analytics.
  • Increased Maintenance Burden: Custom scripts, once written, require ongoing maintenance to accommodate API changes, adjust to new data requirements, or scale with growing data volumes. This maintenance is not trivial; it demands continuous effort from developers, who must understand both the data source and the intricacies of the scripts.
  • Rigidity and Lack of Flexibility: Hard-coded scripts offer limited flexibility for integrating new data sources or making adjustments to the data pipeline. Any significant change often requires substantial modifications to the codebase, leading to delays and increasing the risk of errors.

In summary, while custom Python scripts for creating Kyriba data pipelines can be tailored to specific needs, they come with significant challenges that impact efficiency and add to the maintenance burden. These issues underscore the need for more streamlined, adaptable solutions like PyAirbyte, which aims to simplify the data integration process.

Implementing a Python Data Pipeline for Kyriba with PyAirbyte

Installation of Airbyte Package

pip install airbyte

This command installs the Airbyte Python package, which is necessary to begin setting up your data pipeline. Airbyte is an open-source data integration platform that supports connecting to various data sources and targets.

Importing Airbyte and Configuring the Source Connector

import airbyte as ab

# Create and configure the source connector, don't forget to use your own values in the config:
source = ab.get_source(
   source-kyriba,
   install_if_missing=True,
   config={
       "domain": "demo.kyriba.com",
       "username": "user_example",
       "password": "securepassword123",
       "start_date": "2021-01-10",
       "end_date": "2022-03-01"
   }
)

Here, we import the Airbyte module and use it to create and configure a source connector for Kyriba. The get_source() function includes parameters for specifying the source type (source-kyriba), automatically installing the source connector if it's not already available (install_if_missing=True), and providing the necessary configuration details (domain, username, password, start and end date). These configuration details are critical for authenticating and establishing a connection with your Kyriba account.

Verifying Configuration and Credentials

source.check()

This line of code calls the check() method on the source object to verify the provided configuration and credentials. It's a crucial step to ensure that the connection to Kyriba can be established successfully before proceeding with data extraction.

Listing Available Streams

source.get_available_streams()

The get_available_streams() method lists all the available data streams that can be extracted from Kyriba through the configured source connector. This typically includes various types of financial data like transactions, balances, payments, etc., depending on Kyriba's API offerings and the access permissions of the provided credentials.

Selecting Streams for Extraction

source.select_all_streams()

This command selects all the available streams for data extraction and loads them into cache. If you prefer to extract data from specific streams only, you could use the select_streams() method instead, specifying which streams you're interested in.

Loading Data into Cache

cache = ab.get_default_cache()
result = source.read(cache=cache)

These lines of code initialize the default cache (a local DuckDB instance in this case) and load the selected streams' data into this cache. PyAirbyte supports using different cache backends, including Postgres, Snowflake, and BigQuery, among others, allowing for flexibility in how and where the data is temporarily stored.

Reading Data from Cache into a Pandas DataFrame

df = cache["your_stream"].to_pandas()

Finally, this snippet demonstrates how to read data from one of the cached streams into a Pandas DataFrame, making it easy to manipulate, analyze, or visualize the data using Python. You should replace "your_stream" with the actual name of the stream you're interested in. This approach facilitates data exploration and further processing within Python's rich ecosystem of data science tools.

By following these steps and utilizing PyAirbyte, you can efficiently set up a robust data pipeline from Kyriba to your preferred data warehouse or local cache, streamlining the process of data extraction, transformation, and loading with minimal manual effort.

For keeping up with the latest PyAirbyte’s features, make sure to check our documentation. And if you’re eager to see more code examples with PyAirbyte, check out our Quickstarts library.

Why Using PyAirbyte for Kyriba Data Pipelines

PyAirbyte, with its ease of installation via pip, only needs Python installed on your system. This simplicity accelerates the setup process for data pipelines, making it accessible to a wide range of users, from data scientists to business analysts who might not have extensive programming backgrounds.

The process to get and configure available source connectors in PyAirbyte is straightforward. It empowers users to connect to Kyriba and other data sources quickly. Moreover, the flexibility to install custom source connectors means that PyAirbyte can adapt to unique data needs, allowing for bespoke data integrations that might not be supported out of the box.

By enabling users to select specific data streams for extraction, PyAirbyte conserves computing resources. This functionality not only optimizes the data acquisition stage by reducing unnecessary data transfer but also streamlines processing by focusing only on relevant data. This targeted approach to data extraction is particularly beneficial in environments where computing resources are at a premium or where data processing needs to be optimized for efficiency.

The support for multiple caching backends, including DuckDB, MotherDuck, Postgres, Snowflake, and BigQuery, introduces significant flexibility to PyAirbyte's architecture. This diversity in caching options allows users to choose the most suitable backend for their specific scenario, whether it is for lightweight local development using DuckDB (the default cache if no specific Cache is defined) or leveraging cloud-based databases like Snowflake and BigQuery for scalable, distributed data processing environments.

Incremental data reading capability is among PyAirbyte's most significant features for efficiently handling large datasets. This approach minimizes the load on the data sources and reduces the volume of data that needs to be transferred and processed during each update. Incremental reads are essential for maintaining up-to-date data pipelines without over-burdening network resources or data source APIs, making the process more efficient and less prone to errors or bottlenecks.

Compatibility with various Python libraries, such as Pandas for data manipulation and analysis, and SQL-based tools for more structured data queries, opens up a myriad of possibilities for end-to-end data workflow integrations. This compatibility ensures that PyAirbyte can fit into and augment existing Python-based data workflows, from simple data transformations and analyses to complex orchestrations and AI frameworks. This seamless integration with the broader Python ecosystem enables users to leverage PyAirbyte in diverse applications, from data analytics to machine learning model training.

Given its integration capabilities and support for incremental data processing, PyAirbyte is particularly well-suited for powering AI applications. The ability to process and analyze large volumes of data efficiently is crucial for training accurate and effective AI models. PyAirbyte's architecture supports the iterative, data-intensive workflows typical of AI development, from data preprocessing and feature engineering to model training and validation. This makes it a valuable tool in the data engineer's toolkit for enabling sophisticated AI applications that leverage up-to-date and well-processed data sources like Kyriba.

Conclusion

In wrapping up our guide on setting up a Python data pipeline for Kyriba using PyAirbyte, we've walked through the step-by-step process of installing PyAirbyte, configuring a source connector, authenticating, selecting data streams, caching, and finally, extracting the data into a usable format such as a Pandas DataFrame. This streamlined approach leverages the flexibility and power of Python to make data integration from Kyriba both straightforward and efficient.

PyAirbyte stands out for its ease of use, customizability, and compatibility with various data sources and Python tools. It significantly simplifies the process of extracting, transforming, and loading data (ETL), making it accessible even to those without deep technical expertise in programming or data engineering. By focusing on efficiency and minimizing the technical burden of data pipeline maintenance, PyAirbyte allows teams to focus more on data analysis and insights rather than the intricacies of data integration.

Do you have any questions or feedback for us? You can keep in touch by joining our Slack channel! If you want to keep up to date with new PyAirbyte features, subscribe to our newsletter.

Enhancing Python with Airbyte connectors
Try PyAirbyte