Skip to main content

DRB Python CSV Driver

Project description

DRB Driver CSV

drb-driver-csv is a Python plugin for DRB, representing DRB driver allowing to recognize and to browse CSV (Comma-Separated Values) data.

Installation

pip install drb-driver-csv

Quick Started

from drb.drivers.csv import CsvNodeFactory

# generate the CSV node (DRB resolver can be used also)
node = CsvNodeFactory().create('url/to/csv/data.csv')

# select a row first row by index
row = node[0]
# select a row first row by name
row = node['row_0']

# select first value in a row by index
row[0]
# select a value in a row by name
row['header']

# retrieve value from row: 5, column 1
node[5][1].value

Driver

The drb-driver-csv reads a CSV data like it having a header, so the first row is the second line of the CSV data.

Each node defined in this driver represent a unitary part or whole content of a CSV data:

csv content as node relationship

More details in the following section.

Nodes

CsvBaseNode

The CsvBaseNode wraps another DRB node (base_node) representing the CSV data and allows to provide an entry point to the CSV content.

Attributes

The CsvBaseNode has no attribute.

Children

Each child of the CsvBaseNode repersenting a row of the CSV content. Those children are accessible via:

  • index (int): CSV row index
  • name (str): generic name following the pattern row_N:
    • row_ is a string constant
    • N is the row index (int)
Implementations

The CsvBaseNode inherits from the base_node, plus a pandas.DataFrame implementation to see the data as array.

Learn more about pandas.

CsvRowNode

A CsvRowNode represent a row from a CSV content.

Attributes

The CsvRowNode has no attribute.

Children

A child of a CsvRowNode is a node containing the value for the associate header. Those children can be accessible via:

  • index (int): using header index
  • name (str): using the header name
Implementations

The CsvBaseNode has no implementation.

CsvValueNode

A CsvValueNode represent a cell value from a CSV content. The associated value is accessible via the value property

Attributes

A CsvValueNode has no attribute.

Children

A CsvValueNode has no child.

Implementations

A CsvValueNode has no implementation

Factory

The drb-driver-csv provide a factory csv generating only CsvBaseNode.

Topic

The drb-driver-csv comes also with a DRB topic allowing to resolve and to recognize CSV data.

graph RL
    A([CSV<br/>060f724c-9334-4fd5-9378-8d83c629fd1d])
uuid from label category factory
060f724c-9334-4fd5-9378-8d83c629fd1d CSV FORMATTING csv

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

drb-driver-csv-1.1.0.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

drb_driver_csv-1.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file drb-driver-csv-1.1.0.tar.gz.

File metadata

  • Download URL: drb-driver-csv-1.1.0.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for drb-driver-csv-1.1.0.tar.gz
Algorithm Hash digest
SHA256 01220b79f667d67a2dd76f04340452e0014044d84f8857c65ed1035422d899b5
MD5 1cf754466f3393cee21353a734afe0da
BLAKE2b-256 3cf5d31756dbf3b0ef63a18060825ea7dd922a53a66adddb8999de2aff40ed20

See more details on using hashes here.

File details

Details for the file drb_driver_csv-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for drb_driver_csv-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84f8a98c19927f914da03d7bf265bdd9e52c355001e034081cb1dce340cb293c
MD5 d9e5dc7032cab24f514419c822809074
BLAKE2b-256 dad23c86a45dd3b19a9c97faa2a7fd45d9fe0c7ef0c8b8620691871548e5e319

See more details on using hashes here.

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