Sunday, 10 December 2017

Mengekstrak Data dari apbd.jakarta.go.id

Status : Draft 

Referensi

  1. APBD Elektronik Pemerintah Provinsi DKI Jakarta, http://apbd.jakarta.go.id/
  2. How to scrape websites with Python and BeautifulSoup, https://medium.freecodecamp.org/how-to-scrape-websites-with-python-and-beautifulsoup-5946935d93fe
  3. Scrappy, An open source and collaborative framework for extracting the data you need from websites. In a fast, simple, yet extensible way, https://scrapy.org
  4. Mewariskan Semangat Bung Hatta kepada Para Pemuda Karang Taruna di Rukun Tetangga, http://pemerintahan.openthinklabs.com/2017/12/mewariskan-semangat-bung-hatta-kepada-para-pemuda-karang-taruna-di-rukun-tetangga.html

Monday, 12 June 2017

Python untuk Pengembangan IoT

Status : Draft

Referensi


  1. Zerynth,  middleware for smart devices, IoT and Industry 4.0 applications, https://www.zerynth.com/

Wednesday, 7 June 2017

PySide : Instalasi

Status : Draft

Ketika melakukan instalasi via pip ( sudo pip install PySide), saya mendapatkan error seperti berikut :

    /usr/bin/ld: /usr/local/lib/python2.7.9/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
    /usr/local/lib/python2.7.9/lib/libpython2.7.a: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    libshiboken/CMakeFiles/libshiboken.dir/build.make:381: recipe for target 'libshiboken/libshiboken-python2.7.so.1.2.4' failed
    make[2]: *** [libshiboken/libshiboken-python2.7.so.1.2.4] Error 1
    CMakeFiles/Makefile2:204: recipe for target 'libshiboken/CMakeFiles/libshiboken.dir/all' failed
    make[1]: *** [libshiboken/CMakeFiles/libshiboken.dir/all] Error 2
    Makefile:127: recipe for target 'all' failed
    make: *** [all] Error 2
    error: Error compiling shiboken
 

Ternyata hal ini terjadi karena python yang digunakan di Ubuntu, dikompilasi tanpa opsi --enable-shared, oleh karena itu kita perlu melakukan kompilasi ulang python.

sudo wget http://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz
sudo tar -xvvzf Python-2.7.9.tgz
cd Python-2.7.9/
sudo ./configure --enable-shared --prefix=/opt/python   LDFLAGS=-Wl,-rpath=/opt/python/lib
sudo make
sudo make install
sudo update-alternatives --install /usr/bin/python python /opt/python/bin/python 1
sudo update-alternatives --config python

Install pip :

wget -c https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install PySide






Sunday, 14 May 2017

Beautiful Soup

Status : Draft

Referensi


  1. Beautiful Soup, a Python library designed for quick turnaround projects like screen-scraping, https://www.crummy.com/software/BeautifulSoup/

Wednesday, 30 November 2016

pypandoc : Konversi HTML Table ke Latex dengan Border

Status : Draft



Output nya, tabel nya masih tanpa border :

Solusi : Menggunakan Filter 

Jika menggunakan pandoc langsung, kita dapat menggunakan filter, 

/usr/bin/pandoc --from=html --to=latex --filter ./pandoc_latex_filter.py 
Filter yang digunakan adalah sebagai berikut : 

Hnya saja, penulis belum tahu, bagaimana cara memanggil filter ini, jika melalui pypandoc. 

Referensi


  1. pypandoc, https://pypi.python.org/pypi/pypandoc
  2. PandocHTMLToLatex, https://www.sharelatex.com/project/583fdcc098f05b214e72a7bc
  3. Latex tables using tabular instead of longtable, https://groups.google.com/forum/#!msg/pandoc-discuss/RUC-tuu_qf0/h-H3RRVt1coJ