Skip to main content

FracX is a library that can be used to interface with PDS Energy's FracX platform for exchanging frac schedules.

Project description

permian-frac-exchange

The FracX Python library is a tool to interface with PDS Energy's FracX platform, used to 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.

Available on PyPI and Docker


Installation

Install with pipx:

pipx install fracx

Usage

Set environment variables:

export FRACX_FTP_USERNAME=my_fracx_username
export FRACX_FTP_PASSWORD=my_fracx_password
export FRACX_DATABASE_USERNAME=my_database_username
export FRACX_DATABASE_PASSWORD=my_database_passowrd
export FRACX_DATABASE_HOST=my.host.db
export FRACX_DATABASE_NAME=my_database
export FRACX_DATABASE_SCHEMA=my_schema
export FRACX_TABLE_NAME=frac_schedules

Initialize the database:

fracx db init

Initialization creates one table and one view in the target database:

  • frac_schedules (or the value of FRACX_TABLE_NAME)
  • frac_schedules_by_api10 (or the value of FRACX_TABLE_NAME+"_by_api10")

Re-running the db init command will attempt to create the table or view if they dont already exist. It will NOT drop an existing table or view. This must be done manually.

Run the app

Run the app:

fracx run collector

A successful execution will yield the following 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 Reference

Environment variables reference:

name default description
FRACX_FTP_URL sftp.pdswdx.com url to the remote ftp server
FRACX_FTP_PORT 21 port for the ftp server connection
FRACX_FTP_INPATH /Inbound ftp directory where uploads will be saved
FRACX_FTP_OUTPATH /Outbound ftp directory to look for downloads in
FRACX_FTP_USERNAME "" username for ftp authentication
FRACX_FTP_PASSWORD "" password for ftp authentication
FRACX_DATABASE_USERNAME "" username for database authentication
FRACX_DATABASE_PASSWORD "" password for database authentication
FRACX_DATABASE_DIALECT postgres database dialect ("postgres" or "mssql")
FRACX_DATABASE_HOST localhost database host name
FRACX_DATABASE_PORT 5432 database port
FRACX_DATABASE_NAME postgres database name
FRACX_TABLE_NAME frac_schedules database table to store 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.16.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fracx-0.1.16-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file fracx-0.1.16.tar.gz.

File metadata

  • Download URL: fracx-0.1.16.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.6.7 Darwin/19.0.0

File hashes

Hashes for fracx-0.1.16.tar.gz
Algorithm Hash digest
SHA256 6620eca64bae43729af3484b2910e30ab74700befedc2042d57a77752564efff
MD5 08e5810b734fda0158998eb2f4b60599
BLAKE2b-256 6570007b485a315ba937491abc62e10c9c374d665ddfd74fafb5e59c744e84fc

See more details on using hashes here.

File details

Details for the file fracx-0.1.16-py3-none-any.whl.

File metadata

  • Download URL: fracx-0.1.16-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.6.7 Darwin/19.0.0

File hashes

Hashes for fracx-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 a072e73df468e6e19a8a2951902dae9be115f89d85e61d19b3acdfffb376fac0
MD5 544738e94b83866b91d7e6baea79f561
BLAKE2b-256 b7dd4bfac76e5e8f0b235b4d6354f528d87f54aaf2f5ae3116e88ff179641aef

See more details on using hashes here.

Supported by

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