Skip to content

colemalphrus/csv2dictionary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csv2dictionary

A conversion from csv file to dictionary by Malphrus Tech

Usage

import

from csv2dictionary.csvpro import CsvBrain

use

data

case1 = CsvBrain('test.csv')
case1.data
#returns a list of dictionaries
#the first line in the csv are the keys in the dictionaries

headers

case1 = CsvBrain('test.csv')
case1.header_labels
#returns a list of Header labels

Search

case1 = CsvBrain('test.csv')
case1.search('dog')
#returns a list of dict's that contain "dog" as a value under any key

castInt

case1 = CsvBrain('test.csv')
case1.castInt('age')
#loops thru the list of dictionaries and changes cast all values under an 'age' key to integers

castInt

case1 = CsvBrain('test.csv')
case1.castFloat('age')
#loops thru the list of dictionaries and changes cast all values under an 'age' key to Floats

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages