<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jonathan Nicholas</title>
    <description>The latest articles on DEV Community by Jonathan Nicholas (@chromadream).</description>
    <link>https://dev.to/chromadream</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F39972%2Fe1dedb96-59ec-48fd-8e5d-4d66f5b5e9fb.jpg</url>
      <title>DEV Community: Jonathan Nicholas</title>
      <link>https://dev.to/chromadream</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chromadream"/>
    <language>en</language>
    <item>
      <title>Introducing instiz, my first published library on PyPI</title>
      <dc:creator>Jonathan Nicholas</dc:creator>
      <pubDate>Fri, 23 Nov 2018 09:07:01 +0000</pubDate>
      <link>https://dev.to/chromadream/introducing-instiz-my-first-published-library-on-pypi-2okl</link>
      <guid>https://dev.to/chromadream/introducing-instiz-my-first-published-library-on-pypi-2okl</guid>
      <description>&lt;p&gt;Hello, I'd like to introduce &lt;code&gt;instiz&lt;/code&gt;, a wrapper to the &lt;a href="http://ichart.instiz.net" rel="noopener noreferrer"&gt;iChart chart website&lt;/a&gt; for Python 3+. iChart is a real-time chart website for Korean music.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Chromadream" rel="noopener noreferrer"&gt;
        Chromadream
      &lt;/a&gt; / &lt;a href="https://github.com/Chromadream/instiz" rel="noopener noreferrer"&gt;
        instiz
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A Python3-only library for iChart K-Pop chart scores. CURRENTLY BROKEN.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;instiz&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A Python3-only library for iChart K-Pop chart scores.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/ambv/black" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5bf9e9fa18966df7cb5fac7715bef6b72df15e01a6efa9d616c83f9fcb527fe2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d626c61636b2d3030303030302e737667" alt="Code style: black"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;code&gt;pip install instiz&lt;/code&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Getting started is easy. The following example is to get the top 10 at the realtime chart of iChart.&lt;/p&gt;
&lt;div class="highlight highlight-source-python notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s1"&gt;instiz&lt;/span&gt; &lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s1"&gt;iChart&lt;/span&gt;

&lt;span class="pl-s1"&gt;ichart&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-en"&gt;iChart&lt;/span&gt;()
&lt;span class="pl-s1"&gt;top_10&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-s1"&gt;ichart&lt;/span&gt;.&lt;span class="pl-en"&gt;realtime_top_10&lt;/span&gt;()&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Type hinting&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;If you're using Python 3.7+'s type hinting feature, the type used for the return type of the chart can be imported from the &lt;code&gt;instiz.models&lt;/code&gt; module.&lt;/p&gt;
&lt;div class="highlight highlight-source-python notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s1"&gt;instiz&lt;/span&gt;.&lt;span class="pl-s1"&gt;models&lt;/span&gt; &lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-v"&gt;Entry&lt;/span&gt;

&lt;span class="pl-k"&gt;def&lt;/span&gt; &lt;span class="pl-en"&gt;get_name&lt;/span&gt;(&lt;span class="pl-s1"&gt;entry&lt;/span&gt;: &lt;span class="pl-v"&gt;Entry&lt;/span&gt;) &lt;span class="pl-c1"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="pl-s1"&gt;str&lt;/span&gt;:
    &lt;span class="pl-k"&gt;return&lt;/span&gt; &lt;span class="pl-s1"&gt;entry&lt;/span&gt;.&lt;span class="pl-s1"&gt;title&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Artist name&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;It's now possible to get the Korean name and the English name of an artist easily, alongside with the raw artist name provided from iChart's site. Nice title property will always return the English name, unless unavailable. If one of the names are unavailable, the property will return an empty string.&lt;/p&gt;
&lt;div class="highlight highlight-source-python notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s1"&gt;instiz&lt;/span&gt;&lt;/pre&gt;…
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Chromadream/instiz" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
 
&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;I recently started contributing to &lt;a href="https://github.com/rkpop" rel="noopener noreferrer"&gt;/r/kpop&lt;/a&gt; as a technical moderator. A glance on the organization may show that it's quite unusual for a Reddit community to use this much code, but it really helped the moderator's job, and provide value-addition to the users of the community. &lt;/p&gt;
&lt;h2&gt;
  
  
  Why does instiz exist?
&lt;/h2&gt;

&lt;p&gt;The subreddit has a real-time charting widget of the songs, which was scraped from iChart hourly. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fuwno3xssdb4cwc8ndhys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fuwno3xssdb4cwc8ndhys.png" alt="old chart"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, as Reddit pushes the redesign, a port of the widget to the redesign is required, so that there is no function disparity between users of the old site and the new site. And so, I started the porting attempt. However, a glance of the source code of the currently-running widget reveals a horribly nested mess. Not only that, the scraper and parser are coupled tightly to the actual updating function.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;instiz&lt;/code&gt; is initially created to provide separation of concern between scraping process and widget update process. It can also be used for any kind of scripts, bots, or any programs that utilizes iChart's data.&lt;/p&gt;
&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;Even though the main functionality of &lt;code&gt;instiz&lt;/code&gt; is fairly straightforward, which is to scrape and process the data from iChart, there are some noteworthy additional features inside it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sane artist name processing. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On iChart's site, artist names are inconsistently formatted. Examples include &lt;code&gt;제니 (JENNIE)&lt;/code&gt;, &lt;code&gt;TWICE (트와이스)&lt;/code&gt;, &lt;code&gt;아이유(IU)&lt;/code&gt;, and &lt;code&gt;Queen(퀸)&lt;/code&gt;. instiz ensures that Korean and English names are pre-processed and can be retrieved easily by the library's user, without the need of additional processing.&lt;/p&gt;

&lt;p&gt;Code example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;instiz&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;iChart&lt;/span&gt;

&lt;span class="n"&gt;ichart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;iChart&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;first_place&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ichart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_next_entry&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;nice_title&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;first_place&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;nice_title&lt;/span&gt; &lt;span class="c1"&gt;# "JENNIE - SOLO"
&lt;/span&gt;&lt;span class="n"&gt;raw_artist_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;first_place&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;artist&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;raw_name&lt;/span&gt; &lt;span class="c1"&gt;# "제니 (JENNIE)"
&lt;/span&gt;&lt;span class="n"&gt;english_artist_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;first_place&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;artist&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;english_name&lt;/span&gt; &lt;span class="c1"&gt;# "JENNIE"
&lt;/span&gt;&lt;span class="n"&gt;korean_artist_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;first_place&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;artist&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;korean_name&lt;/span&gt; &lt;span class="c1"&gt;# "제니"
&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;API refresh.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A refresh function is provided, so that developer doesn't have to initialize a new instance of the class each time a new set of data is needed.&lt;/p&gt;

&lt;p&gt;Code example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;instiz&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;iChart&lt;/span&gt;

&lt;span class="n"&gt;ichart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;iChart&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;top_10&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ichart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;realtime_top_10&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;ichart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;refresh&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;top_10&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ichart&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;realtime_top_10&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;It's fully open-sourced.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;instiz&lt;/code&gt; is published under MIT, and there are some "good first issue" for people wanting to start working on open-source culture. However, I realized that there are some items that usually is on open-source project missing from &lt;code&gt;instiz&lt;/code&gt;. Please help me fulfil that by making a pull request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thank you.
&lt;/h2&gt;

&lt;p&gt;Thank you for reading this post all the way to the bottom. I really appreciate it. Have a good day.&lt;/p&gt;

</description>
      <category>python</category>
      <category>showdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
