Software Open Access

detect-delimiter software project

McNamara, Timothy S


DCAT Export

<?xml version='1.0' encoding='utf-8'?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:adms="http://www.w3.org/ns/adms#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:dctype="http://purl.org/dc/dcmitype/" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:duv="http://www.w3.org/ns/duv#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:frapo="http://purl.org/cerif/frapo/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:gsp="http://www.opengis.net/ont/geosparql#" xmlns:locn="http://www.w3.org/ns/locn#" xmlns:org="http://www.w3.org/ns/org#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:prov="http://www.w3.org/ns/prov#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xmlns:wdrs="http://www.w3.org/2007/05/powder-s#">
  <rdf:Description rdf:about="https://doi.org/10.5281/zenodo.1323186">
    <rdf:type rdf:resource="http://www.w3.org/ns/dcat#Dataset"/>
    <dct:type rdf:resource="http://purl.org/dc/dcmitype/Software"/>
    <dct:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">https://doi.org/10.5281/zenodo.1323186</dct:identifier>
    <foaf:page rdf:resource="https://doi.org/10.5281/zenodo.1323186"/>
    <dct:creator>
      <rdf:Description rdf:about="http://orcid.org/0000-0002-2494-2700">
        <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
        <dct:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0000-0002-2494-2700</dct:identifier>
        <foaf:name>McNamara, Timothy S</foaf:name>
        <foaf:givenName>Timothy S</foaf:givenName>
        <foaf:familyName>McNamara</foaf:familyName>
        <org:memberOf>
          <foaf:Organization>
            <foaf:name>DOT loves data</foaf:name>
          </foaf:Organization>
        </org:memberOf>
      </rdf:Description>
    </dct:creator>
    <dct:title>detect-delimiter software project</dct:title>
    <dct:publisher>
      <foaf:Agent>
        <foaf:name>Zenodo</foaf:name>
      </foaf:Agent>
    </dct:publisher>
    <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#gYear">2018</dct:issued>
    <dcat:keyword>text processing</dcat:keyword>
    <dcat:keyword>Python programming</dcat:keyword>
    <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2018-07-29</dct:issued>
    <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/ENG"/>
    <owl:sameAs rdf:resource="https://zenodo.org/record/1323186"/>
    <adms:identifier>
      <adms:Identifier>
        <skos:notation rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">https://zenodo.org/record/1323186</skos:notation>
        <adms:schemeAgency>url</adms:schemeAgency>
      </adms:Identifier>
    </adms:identifier>
    <dct:isVersionOf rdf:resource="https://doi.org/10.5281/zenodo.1323185"/>
    <owl:versionInfo>0.1.1</owl:versionInfo>
    <dct:description>&lt;p&gt;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.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Usage&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The detect_delimiter module exposes the detect() functinon, which takes a str as input and returns a delimiter.&lt;/p&gt; &lt;pre&gt;&lt;code class="language-python"&gt;&amp;gt;&amp;gt;&amp;gt; from detect_delimiter import detect &amp;gt;&amp;gt;&amp;gt; detect("looks|like|the vertical bar\n is|the|delimiter\n") '|'&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;When detect() doesn&amp;#39;t know, it returns None:&lt;/p&gt; &lt;pre&gt;&lt;code class="language-python"&gt;&amp;gt;&amp;gt;&amp;gt; text = "not really any delimiters in here.\nthis is just text.\n" &amp;gt;&amp;gt;&amp;gt; detect()&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;It&amp;#39;s possible to provide a default, which will be used in that case:&lt;/p&gt; &lt;pre&gt;&lt;code class="language-python"&gt;&amp;gt;&amp;gt;&amp;gt; detect(text, default=',') ','&lt;/code&gt;&lt;/pre&gt; &lt;p&gt;&lt;br&gt; By default, detect() will prevent avoid checking alpha-numeric characters and the period/full stop character (&amp;quot;.&amp;quot;). This can be adjusted via the blacklist parameter.&lt;/p&gt; &lt;p&gt;If you believe that you know the delimiter, it&amp;#39;s possible to provide a list of possible delimiters to check for via the whitelist parameter. If you don&amp;#39;t provide a value, [&amp;#39;,&amp;#39;, &amp;#39;;&amp;#39;, &amp;#39;:&amp;#39;, &amp;#39;|&amp;#39;, &amp;#39;\t&amp;#39;] will be checked.&lt;/p&gt;</dct:description>
    <dct:description>This Python package can also be installed via "pip": "pip install detect-delimiter".</dct:description>
    <dct:accessRights rdf:resource="http://publications.europa.eu/resource/authority/access-right/PUBLIC"/>
    <dct:accessRights>
      <dct:RightsStatement rdf:about="info:eu-repo/semantics/openAccess">
        <rdfs:label>Open Access</rdfs:label>
      </dct:RightsStatement>
    </dct:accessRights>
    <dcat:distribution>
      <dcat:Distribution>
        <dct:license rdf:resource="https://creativecommons.org/licenses/by/4.0/legalcode"/>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.1323186"/>
      </dcat:Distribution>
    </dcat:distribution>
    <dcat:distribution>
      <dcat:Distribution>
        <dcat:accessURL rdf:resource="https://doi.org/10.5281/zenodo.1323186"/>
        <dcat:byteSize>3100</dcat:byteSize>
        <dcat:downloadURL rdf:resource="https://zenodo.org/record/1323186/files/detect_delimiter-0.1.1.tar.gz"/>
        <dcat:mediaType>application/x-tar</dcat:mediaType>
      </dcat:Distribution>
    </dcat:distribution>
  </rdf:Description>
</rdf:RDF>
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