Skip to content

Instantly share code, notes, and snippets.

View dchaplinsky's full-sized avatar

Dmitry Chaplinsky dchaplinsky

View GitHub Profile
# -*- coding: utf-8 -*-
# Copyright 2016 Matt Martz
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
from rpy2 import robjects
from rpy2.robjects.packages import importr, STAP
jsonlite = importr("jsonlite")
with open('function_to_test_decl_read_incomr_process.R', 'r') as f:
s = f.read()
proc = STAP(s, "declaration_income_processing")
with open("declarations_bank/data/01/авраменко_максим_ігорович_01a15d65-8f55-4c59-86f3-c6a58bc2f37b.json", "r") as fp:
{
"name": "ПАТ «БАНК КРЕДИТ ДНІПРО»",
"owners": [
{
"share": "100",
"company": {
"name": "БРЕНКРОФТ ЕНТЕРПРАЙЗЕЗ ЛІМІТЕД",
"name_en": "BRANCROFT ENTERPRISES LIMITED",
"country": "Кіпр",
"owners": [
<?xml version="1.0" encoding="UTF-8"?>
<company>
<name>ПАТ «БАНК КРЕДИТ ДНІПРО»</name>
<owners>
<owner>
<share>100</share>
<company>
<name>БРЕНКРОФТ ЕНТЕРПРАЙЗЕЗ ЛІМІТЕД</name>
<name_en>BRANCROFT ENTERPRISES LIMITED</name_en>
<country>Кіпр</country>
# coding: utf-8
from __future__ import unicode_literals
from unicodecsv import reader, writer
class ConvertException(Exception):
pass
def guess(tagline, mapping):
@dchaplinsky
dchaplinsky / GoogleSpreadsheets.py
Last active November 26, 2015 17:44 — forked from cspickert/GoogleSpreadsheets.py
Export a Google Spreadsheet using python.
#!/usr/bin/python
import re, urllib, urllib2
class Spreadsheet(object):
def __init__(self, key):
super(Spreadsheet, self).__init__()
self.key = key
class Client(object):
<root>
<id>A</id>
<author_surname></author_surname>
<author_name></author_name>
<title>На болото в Закарпатті повернулися вода та бобри</title>
<publ_in>Львівська газета</publ_in>
<url>http://www.gazeta.lviv.ua/ecology/37205</url>
<publ_part></publ_part>
<publ_place></publ_place>
<publisher></publisher>
{"sentence": [["Гучне", [[["adj", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_naz", "CAse"], ["compb", "forms"]], [["adj", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_zna", "CAse"], ["compb", "forms"]]]], ["затримання", [[["noun", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_naz", "CAse"], ["inanim", "ANim"]], [["noun", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_rod", "CAse"], ["inanim", "ANim"]], [["noun", "post"], ["s", "nmbr"], ["n", "gndr"], ["v_zna", "CAse"], ["inanim", "ANim"]], [["noun", "post"], ["p", "nmbr"], ["v_naz", "CAse"], ["inanim", "ANim"]], [["noun", "post"], ["p", "nmbr"], ["v_zna", "CAse"], ["inanim", "ANim"]]]], ["підполковника", [[["noun", "post"], ["s", "nmbr"], ["m", "gndr"], ["v_rod", "CAse"], ["anim", "ANim"]], [["noun", "post"], ["s", "nmbr"], ["m", "gndr"], ["v_zna", "CAse"], ["anim", "ANim"]]]], ["Нацгвардії", []], ["за", [[["prep", "post"], ["rv_rod", "req_case"], ["rv_zna", "req_case"], ["rv_oru", "req_case"]]]], ["хабар", [[["noun", "post"], ["s", "nmbr"], ["m", "gndr"], ["v_naz", "
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
#Django Frontend
config.vm.network "forwarded_port", guest: 8000, host: 8080
@dchaplinsky
dchaplinsky / declarations_api.py
Last active December 3, 2021 00:06
Simple example of how to export all assets declarations from declarations.com.ua website.
import requests
import json
from time import sleep
data = []
print("Fetching page #%s" % 1)
r = requests.get("http://declarations.com.ua/search?format=opendata").json()
data += r["results"]["object_list"]