Skip to main content

Pipeline inline inspection data as CSV file.

Project description

PipelineCsv library

GitHub Workflow Status GitHub Workflow Status Codacy Badge Codacy Badge

In Russian

The free, open source PipelineCsv library is designed to work with the results of analysis of in-line flaw detection data in the form of a CSV file.

The library provides a set of high-level operations with CSV file.

Data can be

  • mirrored
  • glued together from several CSV files
  • stretched/compressed along the distance according to a given set of intermediate points
  • interpreted as an iterable sequence of pipes with geodata
  • get statistics about objects in a CSV file
  • calculate the degree of danger of defects using various methods

Installation

pip install pipeline-csv

Usage

It is necessary to define the sets of defects and markers used in your project. To do this, you need to define your class for CSV row by deriving it from the pipeline_csv.csvfile.row.Row class and override two methods of this class: defekts_dict and lineobj_dict.

from pipeline_csv.csvfile.row import Row

class TypeMarker:
    VALVE = 0
    CASE_START = 1
    CASE_END = 2

class TypeDefekt:
    CORROZ = 0
    DENT = 1
    FACTORY = 2

class MyRow(Row):

    @staticmethod
    def defekts_dict():
        return {
          TypeDefekt.CORROZ: "Corrosion",
          TypeDefekt.DENT: "Dent",
          TypeDefekt.FACTORY: "Manufacturing defect",
        }

    @staticmethod
    def lineobj_dict():
        return {
          TypeMarker.VALVE: "Valve",
          TypeMarker.CASE_START: "Casing start",
          TypeMarker.CASE_END: "Casing end",
        }

For the data mirroring operation, you need to override the markers_reverse method, which returns a dictionary that specifies the rules for replacing when mirroring.

class MyRow(Row):

    @staticmethod
    def markers_reverse():
        return {
          TypeMarker.CASE_START: TypeMarker.CASE_END,
          TypeMarker.CASE_END: TypeMarker.CASE_START,
        }

Further, the MyRow class can be used in operations with data of CSV files.

Development

git clone git@github.com:vb64/pipeline.csv.git
cd pipeline.csv
make setup PYTHON_BIN=/path/to/python3
make tests

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

pipeline_csv-1.22.tar.gz (32.2 kB view details)

Uploaded Source

Built Distribution

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

pipeline_csv-1.22-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

Details for the file pipeline_csv-1.22.tar.gz.

File metadata

  • Download URL: pipeline_csv-1.22.tar.gz
  • Upload date:
  • Size: 32.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pipeline_csv-1.22.tar.gz
Algorithm Hash digest
SHA256 1ea7c2044fdd101a4d57dc9311e96579fedabab943b860fed077e8124e1695c6
MD5 753f6ea468c981385cd056932472f39c
BLAKE2b-256 19fb5c61d4bf64f2b68f98249368b3289fb9fc6e0b10c7e1639c7bb0b4686c2c

See more details on using hashes here.

File details

Details for the file pipeline_csv-1.22-py3-none-any.whl.

File metadata

  • Download URL: pipeline_csv-1.22-py3-none-any.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pipeline_csv-1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 418aca7cb80388d4c5bc93b55c18cd4da59be1a8a015565ae15e2f36aacabd82
MD5 62e1f644c1cc2b52f3ee5da16bd6cfc5
BLAKE2b-256 532d162bd78ba7d65d3bffc7c373766703f7b80713dd852c8fc236f4dfa9082e

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