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 one doesn't exist. It will NOT drop an existing table or view. This must be done manually.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.