Software Open Access

detect-delimiter software project

McNamara, Timothy S


JSON-LD (schema.org) 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": "https://creativecommons.org/licenses/by/4.0/legalcode", 
  "creator": [
    {
      "affiliation": "DOT loves data", 
      "@id": "https://orcid.org/0000-0002-2494-2700", 
      "@type": "Person", 
      "name": "McNamara, Timothy S"
    }
  ], 
  "url": "https://zenodo.org/record/1323186", 
  "datePublished": "2018-07-29", 
  "version": "0.1.1", 
  "keywords": [
    "text processing", 
    "Python programming"
  ], 
  "@context": "https://schema.org/", 
  "identifier": "https://doi.org/10.5281/zenodo.1323186", 
  "@id": "https://doi.org/10.5281/zenodo.1323186", 
  "@type": "SoftwareSourceCode", 
  "name": "detect-delimiter software project"
}
112
23
views
downloads
All versions This version
Views 112112
Downloads 2323
Data volume 71.3 kB71.3 kB
Unique views 101101
Unique downloads 2222

Share

Cite as