Skip to main content

A Python Package for CSV File Parsing and Rendering

Project description

ShanCsv
Python 3.8+ Pip latest license

A Python Package for CSV File Parsing and Rendering

How to install

Install the ShanCsv module using pip

pip install ShanCsv

Then import the ShanCsv module into your program

import ShanCsv

Basic Usage

ShanCsv.dump(data, file)

  • Writes the data (2-dimensional list) in CSV format to the file
  • Other Arguments are transferred to dumps and Csv
  • Example:
 with open("test.csv","w") as file:
    ShanCsv.dump(data, file) # data is a 2-dimensional list

ShanCsv.dumps(data)

  • Returns the data (2-dimensional list) in CSV format as str
  • Other Arguments are transferred to Csv
  • Example:
text = ShanCsv.dumps(data) # data is a 2-dimensional list

ShanCsv.load(file)

  • Reads the file in CSV format and converts it to data (2-dimensional list)
  • Other Arguments are transferred to loads and Csv
  • Example:
 with open("test.csv","r") as file:
    data = ShanCsv.load(file) # data is a 2-dimensional list

ShanCsv.loads(text, getType)

  • Returns the CSV format converted to data (2-dimensional list) as list*
  • The getType argument can have any of these values (list, tuple, str), by default it is list
  • Other Arguments are transferred to Csv
  • Example:
data = ShanCsv.loads(text) # data is a 2-dimensional list

ShanCsv.Csv(inputObj, inputTypeStr, *MoreArgs)

  • A Csv Object that takes an inputObj and handles almost everything needed for parsing and rendering CSV data
  • The inputTypeStr argument is a boolean value that specifies if the inputObj is a str, by default it is True
  • *MoreArgs = itemSplitter, lineSplitter, boolValue, noneValue, floatValue, intValue, customTrueValue, customFalseValue, customNoneValue
  • *MoreArgs Docs coming soon!
  • Example:
c = ShanCsv.Csv(text)
data = c.getList() # data is a 2-dimensional list
text = str(c)

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

ShanCsv-0.3.tar.gz (6.6 kB view details)

Uploaded Source

File details

Details for the file ShanCsv-0.3.tar.gz.

File metadata

  • Download URL: ShanCsv-0.3.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.5

File hashes

Hashes for ShanCsv-0.3.tar.gz
Algorithm Hash digest
SHA256 ed76f0f4b378059d4d25eed6d01c4bf1bb4f7e62e218c241d6c240d1602f0edb
MD5 9be1a30a35cfa069794ce0fa0c2578b4
BLAKE2b-256 210c8b212baa269c2ce0fb47eb38cd59d679af0c2c399abf294894fe9f34c30a

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