New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

csvy

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csvy

Convenience wrappers for the standard library csv module.

  • 0.1.5
  • PyPI
  • Socket score

Maintainers
1

csvy

Basic context wrappers for stardard library csv.read and csv.write methods.

Writer Example

B

The writer returns a straight up csv.writer object:

import csvy

with csvy.writer('csvpath.csv') as csvfile:
    csvfile.writerow([1, 2, 3, 4])
Reader Example

The reader returns a proxy object that behaves a bit differently. You must call the iter method that yield an enumerator:

import csvy

with csvy.reader('csvpath.csv') as csvfile:
    for index, row in csvfile.iter():
        print(f"{index}: {row}")

If a header row is detected, the row object will be a namedtuple based on the values of the header line:

"""
src.csv:

A,B,C,column D
1,2,3,4
5,6,7,8

"""
import csvy

with csvy.reader('src.csv') as csvfile:
    for index, row in csvfile.iter():
        print(row.a)
        print(row.column_d)

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc