How to use the unicodecsv.Dialect function in unicodecsv

To help you get started, we’ve selected a few unicodecsv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github woosmap / woosmap-samples / python-samples / csv_to_woosmap / csv_to_woosmap.py View on Github external
import unicodecsv as csv
import json
import os
import time
import requests
from hashlib import sha1

YOUR_INPUT_CSV_FILE = 'foodmarkets.csv'
WOOSMAP_PRIVATE_API_KEY = '23713926-1af5-4321-ba54-032966f6e95d'
BATCH_SIZE = 5


class MyCSVDialect(csv.Dialect):
    delimiter = ','
    quotechar = '"'
    doublequote = True
    skipinitialspace = False
    lineterminator = '\n'
    quoting = csv.QUOTE_ALL


class Woosmap:
    """A wrapper around the Woosmap Data API."""

    WOOSMAP_API_HOSTNAME = 'api.woosmap.com'

    def __init__(self):
        self.session = requests.Session()