Sword

Latest version: v0.0.3

Safety actively analyzes 682251 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.0.3

Overview

New functions for reading rows

`csv_read_row`:

This function reads a single CSV row from a string, and returns a tuple containing:

* The list containing the row elements.
* The remaining unread string.

*Example:*

py
>>> import sword
>>> sword.csv_read_row("54.7,32.6,54.7\n")
([b'54.7', b'32.6', b'54.7'], b'\n')


`csv_count_rows`:

Counts the number of rows in a CSV-string

*Exmaple:*

py
>>> import sword
>>> sword.csv_count_rows("1,2\n3,4\n5,5,5,5\n")
3



`csv_count_cols`:

Counts the number of columns in a CSv-string

*Example:*

py
>>> import sword
>>> sword.csv_count_cols("1,2,3,4\n")
4

0.0.2

Overview

Minimal changes since last release. A new CSV count function

py
>>> import sword
>>> help(sword)
Help on module sword:

NAME
sword - A fast and effecient data mining C extension.

FUNCTIONS
csv_count_cols(...)
Counts the columns in the first row of a CSV string.

csv_count_rows(...)
Counts the rows in a CSV string.


From this release forward will switch to a more python focused train of development.

0.0.1

This release is the very first version of sword. It is an active development version which is not stable. The following functions are contained in the API:



csv_row_count(csv_string)

Counts the rows in a csv string. Only counts the rows with at least one item.

Example

py
>>> import sword
>>> sword.csv_row_count("3,4\n\n")
1

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.