Skip to content

Commit

Permalink
add default dialect to tests; make default dialect explicit; bump to …
Browse files Browse the repository at this point in the history
…version 1.1.2
  • Loading branch information
OlivierBinette committed Nov 26, 2023
1 parent 9589542 commit b69634e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion csvmeta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from csvmeta.write import DEFAULT_DIALECT, write

__all__ = ["read", "metadata", "write", "DEFAULT_DIALECT"]
__version__ = "1.1.1"
__version__ = "1.1.2"
9 changes: 8 additions & 1 deletion csvmeta/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@

_DialectType = Union[str, dict]

DEFAULT_DIALECT = "unix"
DEFAULT_DIALECT = {
"delimiter": ",",
"quotechar": '"',
"doublequote": True,
"skipinitialspace": False,
"lineterminator": "\n",
"quoting": csv.QUOTE_ALL,
}


def write(
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "csvmeta"
version = "1.1.1"
version = "1.1.2"
description = "Lightweight csv read/write, keeping track of csv dialect and other metadata."
authors = [{ name = "Olivier Binette", email = "[email protected]" }]
readme = "README.md"
Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import pytest

import csvmeta

DIALECTS_LIST = [
csvmeta.DEFAULT_DIALECT,
"excel",
"unix",
{"delimiter": "|", "escapechar": "\\", "quotechar": "'", "quoting": csv.QUOTE_NONE, "lineterminator": "\n"},
Expand Down

0 comments on commit b69634e

Please sign in to comment.