Software Open Access

detect-delimiter software project

McNamara, Timothy S

JSON-LD ( Export

  "inLanguage": {
    "alternateName": "eng", 
    "@type": "Language", 
    "name": "English"
  "description": "<p>Data sharing and research collaboration is hindered when messy data is released. Despite this, it still exists. detect-delimiter aims to provide tools with an option for inspecting the header of a text file and checking the actual delimiter used, rather than blindly believing the file extension.</p>\n\n<p><strong>Usage</strong></p>\n\n<p>The detect_delimiter module exposes the detect() functinon, which takes a str as input and returns a delimiter.</p>\n\n<pre><code class=\"language-python\">&gt;&gt;&gt; from detect_delimiter import detect\n&gt;&gt;&gt; detect(\"looks|like|the vertical bar\\n is|the|delimiter\\n\")\n'|'</code></pre>\n\n<p>When detect() doesn&#39;t know, it returns None:</p>\n\n<pre><code class=\"language-python\">&gt;&gt;&gt; text = \"not really any delimiters in here.\\nthis is just text.\\n\"\n&gt;&gt;&gt; detect()</code></pre>\n\n<p>It&#39;s possible to provide a default, which will be used in that case:</p>\n\n<pre><code class=\"language-python\">&gt;&gt;&gt; detect(text, default=',')\n','</code></pre>\n\n<p><br>\nBy default, detect() will prevent avoid checking alpha-numeric characters and the period/full stop character (&quot;.&quot;). This can be adjusted via the blacklist parameter.</p>\n\n<p>If you believe that you know the delimiter, it&#39;s possible to provide a list of possible delimiters to check for via the whitelist parameter. If you don&#39;t provide a value, [&#39;,&#39;, &#39;;&#39;, &#39;:&#39;, &#39;|&#39;, &#39;\\t&#39;] will be checked.</p>", 
  "license": "", 
  "creator": [
      "affiliation": "DOT loves data", 
      "@id": "", 
      "@type": "Person", 
      "name": "McNamara, Timothy S"
  "url": "", 
  "datePublished": "2018-07-29", 
  "version": "0.1.1", 
  "keywords": [
    "text processing", 
    "Python programming"
  "@context": "", 
  "identifier": "", 
  "@id": "", 
  "@type": "SoftwareSourceCode", 
  "name": "detect-delimiter software project"
All versions This version
Views 112112
Downloads 2323
Data volume 71.3 kB71.3 kB
Unique views 101101
Unique downloads 2222


Cite as