A Python Package for CSV File Parsing and Rendering
Project description
ShanCsv
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
andCsv
- 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
andCsv
- 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.2.tar.gz
(6.6 kB
view details)
File details
Details for the file ShanCsv-0.2.tar.gz
.
File metadata
- Download URL: ShanCsv-0.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4bdcecee91ac72a4f8dfd134b91f97ef3405487b124c6b53804d144276a7f00 |
|
MD5 | bd39cfa3e2a2262f33b46482f44aa4cd |
|
BLAKE2b-256 | 46f23d19466b942556cba44b42319a15ed09472589423cb19349e7e9e1718a00 |