justicecz 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4c1aa2fe3b0953dc713f9f5a4da6f0846531880
4
- data.tar.gz: 9d707f1f30b468cf1fe184f2bf9cb1469b42b2f4
3
+ metadata.gz: 247796fa3d1e6b2d2f7dbca5810cb657d7916fcc
4
+ data.tar.gz: 23a1b628e8c05d6f166de689138aae584fcba204
5
5
  SHA512:
6
- metadata.gz: 0c03b3042bc2ef13344dbf194dca7ccf18b1fe2ae0ad81c1e8ea0a85387538a515f15bdf176d59464f43775815a1c729a6eb3e5f2c58e61bd3a1fee61bfb1c0b
7
- data.tar.gz: 94d58017c27d44702e9ddfa3cf2c3fed028235bbe324e1dfc39682cf7ed2c500a917173a6316ff33743de8f1491396750e0493f6c9f1d88cedc34c0edf9ae045
6
+ metadata.gz: eb3f653a948b73f7a57f6a36bd2a098909b32c2d6d7b282aaec9d56eec7f423b92c2430c833bbb244bd80d049249629afc4e2069bbc01dd83b6558b9ab26aa77
7
+ data.tar.gz: ad08a4240d67f8ea147496cb8324645ed181afbd4702ea6d6fb94a6a85fced3d19bec4281482e055cb18a36a0534ad1e748d60dc72784e02e07a8f7f55396084
data/README.md CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/redrick/justicecz.svg?branch=master)](https://travis-ci.org/redrick/justicecz)
4
4
 
5
- COMMING SOON
6
-
7
5
  SDK for accessing data from [justice.cz](https://or.justice.cz/ias/ui/rejstrik-$firma)
8
6
 
9
7
  ## Installation
@@ -22,24 +20,124 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- In this first version you can query justice.cz looking for specific ICO:
23
+ In this gem you can query justice.cz looking for things available throught
24
+ their website, see examples below:
26
25
 
27
26
  ```ruby
28
27
  Justicecz::Query.query(ico: '04564634')
29
28
  ```
30
29
 
31
- Which will give you nicely formatted Hash for further processing:
30
+ Which will give you collection of results encapsulated in `Justicecz::Entities::List` class
31
+
32
+ ```ruby
33
+ #<Justicecz::Entities::List:0x007f8b8b44f430 @items=[#<Justicecz::Entities::Company:0x007f8b8b4455e8>]>.........>
34
+ ```
35
+
36
+ To access all results you call `items` like this:
37
+
38
+ ```ruby
39
+ collection = Justicecz::Query.query(nazev: 'NAV')
40
+ collection.items
41
+ ```
42
+
43
+ it returns an array of results each now encapsulated in `Justicecz::Entities::Company` class
44
+
45
+ ```ruby
46
+ #<Justicecz::Entities::Company:0x007f8b8b4455e8 @title="Návrat bytové družstvo", @ico="43003940", @file_number="DrCI 166 vedená u Městského soudu v Praze", @registered_at="11. listopadu 1991", @residence="Praha 4, Stallichova 932/9">
47
+ ```
48
+
49
+ with which you can now easily work to get required data :) (see more on methods available below...)
50
+
51
+ ### Jistice::Query public API
52
+
53
+ With this class you can query like this:
54
+
55
+ ```ruby
32
56
 
33
57
  ```
58
+
59
+ ### Justicecz::Entities::List public API
60
+
61
+ This class only offers:
62
+
63
+ ```ruby
64
+ collection = Justicecz::Query.query(nazev: 'NAV')
65
+ ```
66
+
67
+ tested params in search for now are:
68
+
69
+ ```ruby
34
70
  {
35
- "Název subjektu:" => "autokosmetika s.r.o.",
36
- "IČO:" => "04564634",
37
- "Spisová značka:" => "C 249833 vedená u Městského soudu v Praze",
38
- "Den zápisu:" => "13. listopadu 2015",
39
- "Sídlo:" => "Jičínská 226/17, Žižkov, 130 00 Praha 3"
71
+ nazev: 'string', # search by name of the company
72
+ ico: '04564634', # ICO of the company (unique returns only one result in collection.items array)
73
+ obec: 'Brno', # name of the city (has to be combined with one of required - see required down below)
74
+ ulice: 'Černokostelecká', # name of street (has to be combined with one of required - see required down below)
75
+ polozek: 200, # allows you to get more that default 50 results (allowed 50, 200, 500)
76
+ soud: 'KSPL' # Court of registration (see values below) + (has to be combined with one of required - see required down below)
40
77
  }
41
78
  ```
42
79
 
80
+ REQUIRED FIELDS (one of) -> `nazev` or `ico`
81
+
82
+ Allowed values for `court` params in search hash:
83
+
84
+ ```
85
+ "MSPH" => Městský soud v Praze
86
+ "KSCB" => Krajský soud v Českých Budějovicích
87
+ "KSPL" => Krajský soud v Plzni
88
+ "KSUL" => Krajský soud v Ústí nad Labem
89
+ "KSHK" => Krajský soud v Hradci Králové
90
+ "KSBR" => Krajský soud v Brně
91
+ "KSOS" => Krajský soud v Ostravě
92
+ ```
93
+
94
+ ### Justicecz::Entities::Company List
95
+
96
+ This class offers these methods to access company data fetched:
97
+
98
+ ```ruby
99
+ collection = Justicecz::Query.query(nazev: 'NAVLOG')
100
+ item = collection.items.first
101
+ item.title # "NAVLOG s.r.o."
102
+ item.misc # Miscellaneous -> e.g. "V konkursu, Zahájeno insolvenční řízení na návrh věřitele"
103
+ item.ico # "29453259"
104
+ item.file_numebr # "C 54544 vedená u Krajského soudu v Ostravě"
105
+ item.registered_at # "26. září 2012"
106
+ item.residence # "Ztracená 253/4, 779 00 Olomouc"
107
+ ```
108
+
109
+ You can then access the full name of attribute and value appending `_full` after:
110
+
111
+ ```ruby
112
+ collection = Justicecz::Query.query(nazev: 'NAVLOG')
113
+ item = collection.items.first
114
+ item.title_full # "Název subjektu: NAVLOG s.r.o."
115
+ item.misc_full # Miscellaneous -> e.g. "Ostatní informace: V konkursu, Zahájeno insolvenční řízení na návrh věřitele"
116
+ item.ico_full # "IČO: 29453259"
117
+ item.file_numebr_full # "Spisová značka: C 54544 vedená u Krajského soudu v Ostravě"
118
+ item.registered_at_full # "Den zápis: u26. září 2012"
119
+ item.residence_full # "Sídlo: Ztracená 253/4, 779 00 Olomouc"
120
+ ```
121
+
122
+ Also if you only want to know header names (.ico => 'IČO') append `_header` after:
123
+
124
+ ```ruby
125
+ collection = Justicecz::Query.query(nazev: 'NAVLOG')
126
+ item = collection.items.first
127
+ item.title_header # "Název subjektu"
128
+ item.misc_header # "Ostatní informace"
129
+ item.ico_header # "IČO"
130
+ item.file_numebr_header # "Spisová značka"
131
+ item.registered_at_header # "Den zápis"
132
+ item.residence_header # "Sídlo"
133
+ ```
134
+
135
+ ## TODO
136
+
137
+ * Discover search more
138
+ * Specs
139
+ * More comprehensive documentation
140
+ * Bugfixes
43
141
 
44
142
  ## Thanks
45
143
 
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Andrej Antas']
10
10
  spec.email = ['andrej@antas.cz']
11
11
  spec.summary = 'SDK for quering or.justice.cz'
12
- spec.description = 'SDK for quering or.justice.cz'
13
- spec.homepage = ''
12
+ spec.description = 'SDK for quering the hell out of or.justice.cz HTML pages since there is no API available'
13
+ spec.homepage = 'https://github.com/redrick/justicecz'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -1,3 +1,3 @@
1
1
  module Justicecz
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: justicecz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrej Antas
@@ -136,7 +136,8 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description: SDK for quering or.justice.cz
139
+ description: SDK for quering the hell out of or.justice.cz HTML pages since there
140
+ is no API available
140
141
  email:
141
142
  - andrej@antas.cz
142
143
  executables:
@@ -174,7 +175,7 @@ files:
174
175
  - spec/misc/params_lookup_spec.rb
175
176
  - spec/query_spec.rb
176
177
  - spec/spec_helper.rb
177
- homepage: ''
178
+ homepage: https://github.com/redrick/justicecz
178
179
  licenses:
179
180
  - MIT
180
181
  metadata: {}