Skip to content

Commit

Permalink
Merge pull request #42 from xros/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
xros authored Jul 4, 2019
2 parents 5f8cc29 + edfb213 commit 9ab0759
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
json-py-es
==========

[![Downloads](https://pepy.tech/badge/jsonpyes)](https://pepy.tech/project/jsonpyes)
[![Build Status](https://travis-ci.org/xros/jsonpyes.svg?branch=master)](https://travis-ci.org/xros/jsonpyes)
[![GitHub release](https://img.shields.io/github/release/xros/jsonpyes.svg)](https://github.com/xros/jsonpyes/releases)
[![GitHub license](https://img.shields.io/github/license/xros/jsonpyes.svg)](https://github.com/xros/jsonpyes/blob/master/LICENSE)
Expand Down Expand Up @@ -104,6 +105,6 @@ Reference
---------
* Algorithm handwritting

![handwritting](http://i.imgur.com/fgm1Mxt.jpg?1)
![handwritting](https://raw.githubusercontent.com/xros/jsonpyes/master/static/algo.png)

##### Happy hacking!
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
json-py-es
==========

|Build Status| |GitHub release| |GitHub license|
|Downloads| |Build Status| |GitHub release| |GitHub license|

Alexander Liu

Expand Down Expand Up @@ -144,14 +144,16 @@ Reference

- Algorithm handwritting

.. figure:: http://i.imgur.com/fgm1Mxt.jpg?1
.. figure:: https://raw.githubusercontent.com/xros/jsonpyes/master/static/algo.png
:alt: handwritting

handwritting

Happy hacking!
''''''''''''''

.. |Downloads| image:: https://pepy.tech/badge/jsonpyes
:target: https://pepy.tech/project/jsonpyes
.. |Build Status| image:: https://travis-ci.org/xros/jsonpyes.svg?branch=master
:target: https://travis-ci.org/xros/jsonpyes
.. |GitHub release| image:: https://img.shields.io/github/release/xros/jsonpyes.svg
Expand Down
7 changes: 4 additions & 3 deletions jsonpyes.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
Metadata-Version: 2.1
Name: jsonpyes
Version: 1.4.1
Version: 1.4.2
Summary: A Tool to Import JSON raw data to ElasticSearch in one line of commands
Home-page: https://github.com/xros/jsonpyes
Author: Alexander Liu
Author-email: alex@nervey.com
License: FTE V1
Download-URL: https://github.com/xros/jsonpyes/archive/1.4.1.zip
Download-URL: https://github.com/xros/jsonpyes/archive/1.4.2.zip
Description: json-py-es
==========

[![Downloads](https://pepy.tech/badge/jsonpyes)](https://pepy.tech/project/jsonpyes)
[![Build Status](https://travis-ci.org/xros/jsonpyes.svg?branch=master)](https://travis-ci.org/xros/jsonpyes)
[![GitHub release](https://img.shields.io/github/release/xros/jsonpyes.svg)](https://github.com/xros/jsonpyes/releases)
[![GitHub license](https://img.shields.io/github/license/xros/jsonpyes.svg)](https://github.com/xros/jsonpyes/blob/master/LICENSE)
Expand Down Expand Up @@ -113,7 +114,7 @@ Description: json-py-es
---------
* Algorithm handwritting

![handwritting](http://i.imgur.com/fgm1Mxt.jpg?1)
![handwritting](https://raw.githubusercontent.com/xros/jsonpyes/master/static/algo.png)

##### Happy hacking!

Expand Down
12 changes: 7 additions & 5 deletions jsonpyes.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,19 +406,21 @@ def run():
doc_type = ""
thread_amount = 1
# Get info from process_jobs
# fix the syntax bug after upgrading support from Python2.7 to Python3.6, thanks to @tdracz
for job in process_jobs:
if type(job) == dict:
if job.has_key('data'):
if 'data' in job:
data = job['data']
if job.has_key('bulk'):
if 'bulk' in job:
bulk = job['bulk']
if job.has_key('index'):
if 'index' in job:
index = job['index']
if job.has_key('type'):
if 'type' in job:
doc_type = job['type']
if job.has_key('thread'):
if 'thread' in job:
thread_amount = int(job['thread_amount'])


#### 1) Only check not importing
if ("check" in process_jobs) and ("import" not in process_jobs) :
# check JSON
Expand Down
2 changes: 1 addition & 1 deletion jsonpyes_contrib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# version number like 1.2.3a0 or 1.2.3, must have at least 2 parts, like 1.2
__version__ = '1.4.1'
__version__ = '1.4.2'
Binary file added static/algo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9ab0759

Please sign in to comment.