OriginPro
 
Loading...
Searching...
No Matches
originpro.dc.Connector Class Reference

Public Member Functions

def __init__ (self, wks, dctype='', keep_DC=True)
 
def __del__ (self)
 
def settings (self)
 
def source (self)
 
def source (self, s)
 
def new_sheet (self, name)
 
def imp (self, fname='', sel='', sparks=False)
 

Public Attributes

 keep
 
 wks
 
 dc
 
 source
 

Detailed Description

Data Connector
    Parameters:
        wks (DSheet): the worksheet or martix sheet to use the connector
        dctype(str):  Name of the connector, CSV, Excel etc
        keep_DC(bool): Keep the connector after import
    Example:
        import originpro as op
        f = op.path('e')+r'Samples\Import and Export\S15-125-03.dat'
        wks = op.find_sheet()
        dc = op.Connector(wks)
        ss = dc.settings()
        partial = ss['partial']
        partial[op.attrib_key('Use')]='1'
        partial['row']='10:20'
        dc.imp(f)

Member Function Documentation

◆ imp()

def originpro.dc.Connector.imp (   self,
  fname = '',
  sel = '',
  sparks = False 
)
Import file
Parameters:
    fname(string): source file name
    sel(string):selection
Returns:
    none
Examples:
    wks=op.find_sheet()
    dc=op.Connector(wks)
    f=op.path('e')+r'Samples\Import and Export\ASCII Simple.dat'
    dc.imp(f)

◆ new_sheet()

def originpro.dc.Connector.new_sheet (   self,
  name 
)
    Import a new selection into a new sheet

Parameters:
    name(str): selection, for example an Excel sheet name

Returns:
    None
Examples:
    dc.imp(f, sel='Oil')
    dc.new_sheet('Natural Gas')

◆ settings()

def originpro.dc.Connector.settings (   self)
Parameters:
    none
Returns:
    Import settings
Examples:
    wks=op.find_sheet()
    dc=op.Connector(wks)
    ss=dc.settings()

◆ source() [1/2]

def originpro.dc.Connector.source (   self)
Property getter returns the source of Data Connector
Parameters:
    none
Returns:
    (str) Data Source
Examples:
    wks=op.find_sheet()
    dc=op.Connector(wks)
    print(dc.source)

◆ source() [2/2]

def originpro.dc.Connector.source (   self,
  s 
)
    Property setter set the source of Data Connector
    Parameters:
        s(str): Data Source
    Returns:
        None
    Examples:
        wks=op.find_sheet()
        dc=op.Connector(wks)
        dc.source=op.path('e')+r'Samples\Import and Export\S15-125-03.dat'
        dc.imp()

The documentation for this class was generated from the following file: