Skip to main content

This project is used to interface with [PDSEnergy's](https://pdsenergy.com/frac-interference-exchange/) FracX platform to programmatically submit and download frac schedules.

Project description

permian-frac-exchange

This project is used to interface with PDSEnergy's FracX platform to programmatically submit and download frac schedules.

Currently, the project interfaces with the FTP import/export service provided by PDS. As other means of integration become available from PDS, those means will be incorporated into this project as additional ways to import and export data from FracX.


Getting Started

  1. Initialize the destination table in the database. Example table definitions can be found in scripts
  2. Define the necessary environment variables in the docker-compose.yml file or in a .env file in the project root directory (examples below).
  3. Run the container with docker-compose: docker-compose up

Usage

  • Run the container using docker-compose: docker-compose up

Example output:

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                app config: fracx.config.ProductionConfig
                flask app: fracx.manage.py
                flask env: production
                backend: postgres://fracx:***@db:5432/driftwood
                collector: sftp.pdswdx.com
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Starting download from sftp.pdswdx.com...
Download successful (download size: 70.58 KB, download_time: 0.0s)
frac_schedules.core_insert_update_on_conflict: inserted 625 records (1.28s)

Configuration

The application can be configured with environment variables that are passed into the container at runtime. Environment variables can either be defined at the system level or in a file named '.env' in the project's root directory.

Saving output to a Postgres database


Using a .env file

Example configuration with .env file:

.env

FRACX_FTP_USERNAME=my_fracx_username
FRACX_FTP_PASSWORD=my_fracx_password
DATABASE_USERNAME=my_database_username
DATABASE_PASSWORD=my_database_passowrd
DATABASE_HOST=my.host.db
DATABASE_NAME=my_database
DATABASE_SCHEMA=my_schema
FRAC_SCHEDULE_TABLE_NAME=frac_schedules

When specifying configuration in a .env file, include it in docker-compose so the configuration is passed into the container at runtime.

docker-compose.yml

version: "3.7"

services:
  collector:
    image: driftwood/fracx
    env_file: .env


##### Using docker-compose.yml

Example configuration directly in the docker-compose.yml file:

services:
  collector:
    image: driftwood/fracx
    environment:
      FRACX_FTP_USERNAME: YOUR_FRACX_FTP_UERNAME
      FRACX_FTP_PASSWORD: YOUR_FRACX_FTP_PASSWORD
      DATABASE_USERNAME: YOUR_DATABASE_USERNAME
      DATABASE_PASSWORD: YOUR_DATABASE_PASSWORD
      DATABASE_HOST: YOUR_DATABASE_HOST
      DATABASE_NAME: YOUR_DATABASE_NAME
      DATABASE_SCHEMA: fracx
      FRAC_SCHEDULE_TABLE_NAME: frac_schedules

Project details


Download files

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

Source Distribution

fracx-0.1.7.tar.gz (30.0 kB view hashes)

Uploaded Source

Built Distribution

fracx-0.1.7-py3-none-any.whl (36.5 kB view hashes)

Uploaded Python 3

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