Skip to main content

converts csv to a dictionary

Project description

timeconMT

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

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

csv2dictionary-0.0.2.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

csv2dictionary-0.0.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file csv2dictionary-0.0.2.tar.gz.

File metadata

  • Download URL: csv2dictionary-0.0.2.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.2

File hashes

Hashes for csv2dictionary-0.0.2.tar.gz
Algorithm Hash digest
SHA256 09c5fb5c59eee51fc07b9bc1ea435300a397a8418296ada523c93232fe1c0ce7
MD5 7c173c46a2a14c5cc627a7a16a4e2a3c
BLAKE2b-256 7b0149b123fdc0c87f67fe7ec208bba1cbe85f21999510c2ec928c72df7ff788

See more details on using hashes here.

File details

Details for the file csv2dictionary-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: csv2dictionary-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.2

File hashes

Hashes for csv2dictionary-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6787cac19984f55784c0d393472f2f50493441b4c58c7cf7b0f7d28476dab0d
MD5 31310ad22fd2bf1f7b3d4c3f6801ef0b
BLAKE2b-256 ff81aa859e6a605d9df7b6daef2354a06441ac112049338691fe5486dbf48357

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page