Giter Club home page Giter Club logo

robotframework-csvlibrary's Issues

Read Csv File To List - Integers are read as Floats

When reading a CSV file into RF, the Library implicitly converts INTs to FLOATs.

Example CSV data:

1,"Some","Data"
2,"More","Stuff"

RF:

Example test
    ${csv_data}=    Read Csv File To List    ${CSV File}    quoting=${2}

Result:

[info] ${csv_data} = [[1.0, 'Some', 'Data'], [2.0, 'More', 'Stuff']]

CSVLibrary should use Robot Framework DotDict for "read csv file to associative"

Currently when using CSVLibrary to load CSV files into a list of dictionaries, it is loading them as the standard python library as OrderedDict's.

To make the result usable as other Dictionaries created by Robot Framework, it would be nice to use the Robot Framework sub classed DotDict class instead. ( robot.utils.dotdict.DotDict )

With the DotDict class it would be possible to do like this (as long as the header does not contain spaces):

*** Test Cases ***

Read csv file to a dict example test
  @{dict}=    read csv file to associative  data.csv
  Log  ${dict[0].first_name}  ${dict[0].last_name}

Possibility to set encoding while loading CSV file

In different languages it might be needed to store external data in other encodings than the OS default.
So it would be very convenient to be able to set the encoding while loading and saving CSV files.
Python 3 built in function "open" has the parameters already, so the parameters "just" has to be fed through to the call.

For Python 2, it far more complicated, the io.open is more or less the same as in Python 3, but the csv library in Python 2 does not support unicode at all. So if Python 2 is needed, the file would have to be opened in binary mode and processed or decoded while reading. There exists a replacement csv library for python 2 solving this though. (https://github.com/jdunck/python-unicodecsv)

Please support python3+

When trying to install csvlibrary with python3 getting below error. It seems it is yet support python3.

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/fr/jtjjqpbs1sx0lxh6qbgzgdjw00gftq/T/pip-build-nyn_ua1n/robotframework-csvlibrary/

Kindly provide the support for python3 as well.

Append To Csv File giving "IndexError: list index out of range"

Empty Csv File ${outputFile}
@{list}= Read Csv File To List ${inputFile}
@{list}= Change dateField for the csv data ${list} ${stlDate} ${dataSource}
Append To Csv File ${outputFile} ${list}

${inputFile} --> It is a CSV file containing the data
${outputFile} --> Created a empty csv file

The above code was working file with Python 2.7 and RF 3.1.2 with the version 0.0.3

But after upgrading the Python to 3.8, started getting the error ""IndexError: list index out of range"
for the keyword Append To Csv File

Please help on this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.