Code Monkey home page Code Monkey logo

python-codes-'s Introduction

python-codes-

In this repo , i put some simple codes which are useful in day to day life of a developer .

The repo will be having code base of python codes .

####################### 1st .py file In this my first try is to put some basic's of connecting python(3.6) with mongodb secoundary db in server , many people face serious problem's in configuration .

This configuration.py file also contains basic mongo query operation , to pull data in various ways .

#################### 2nd .py file
In python_elastic_search.py file , i tried to do the below task ,

--> create index in server side elastic search one index using pyelasticsearch package .

--> tried to make a mapping for our index , before pushing data .

--> tried pushing data into elasticsearch index type by restful API's (GET & POST requests)

--> pull data from elastic search into local python console .

################### 3rd .py file

In Date_parser.py file , i had tried to include a awesome library from natty called as dateparser to parse textual dates like , yesterday , tomorrow , or any other format . It can extract dates from a string contain a date like below .

" my birthday was tomorrow " = It will extract tomorrow and give tomorrows date in datetime format
datetime.datetime(2018, 3, 14, 17, 9, 56)

I created two functions in this file , first(DateParsing(inp2)) to identify dates , secound is to compare is the asked date ispresent or past or future date (which_date() ) .

########## data_update_elastic.py

1.In this file , i have demonstrated a way how you can define your own schema

for your database in elastic , and push some data according to that .

  1. Defined a function called provider_value_insert(provider_name,sensor_1,sensor_2,sensor_3), which allows any users to create

a index/database in elasticSearch ,along with 3 tables .

The dates are defined for today , previous and day before yesterday .

I hard coded the data inside , but users are free to change and manipulate as per there choices .

Then i used standard CURL requests to push data into elastic search .

###########multiple_db_query.py

  1. I created a function called ,provider_details(providers_name,single_sensor_retrievel,data_inserted_in_sensor) , which basically gives users

flexibility to decide which DB user want to access , along with , define a single table/type value whose data user wants to see .

third if after manipulation user wants to push changes to a selected table he can describe it here .

In this i tried to pull data from multiple index/dbs from elasticsearch .

python-codes-'s People

Contributors

aki83reo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.