Coder Social home page Coder Social logo

dltins-data-extract's Introduction

This repository is showing the steps to create lambda function for extracting the data from xml file provided in the assignment of the Python Engineer role in Steel-eye company.

Steps:

  1. Create and activate the virtual environment named 'steeleye'.

virtualenv -p /usr/bin/python3.6 steeleye

cd steeleye

source bin/activate

  1. go to site-packages directory

cd lib/python3.6/site-packages

  1. Install the requirements from requirements.txt

pip install -r requirements.txt

  1. Create a file lambda_fucntion.py in the current working directory and define your function in this file.(Unzip steeleyr.zip from this repository and use lambda_function.py file in your codes)

  2. Create a zip file named ‘lambda_function.zip’ with the following directories/files in the same directory.

  • certifi(dir)
  • chardet(dir)
  • _distutils_hack(dir)
  • idna(dir)
  • requests(dir)
  • urllib3(dir)
  • distutils-precedence.pth(file)
  • lambda_function(file)
  1. Log in to the AWS console and access the lambda service.

  2. Create a new function with the name ‘Steeleye’. Import the zip file created in step 5 from Actions button. After the successful import content of the zip file should be visible in the Environment pane, visible towards the left side.

  3. Go to Runtime settings by scrolling down, select runtime as ‘Python 3.6’, and save the changes.

  4. Go to Basic Settings by further scrolling down the screen and increase the Memory(MB) to 4096 and Timeout to 5 mins.

  5. Create a bucket in S3 services with the name of ‘steeleyetest3424’ and save the bucket.

  6. Deploy the function by clicking on the ‘Deploy’ button.

  7. Test the function by clicking on the ‘Test’ button.

  8. Once the test is successful, open the S3 bucket, access the 'tmp' directory within the S3 bucket, and download datafile.csv to get the records mentioned in the assignment. (datafile.csv file has 0.5 Million records. Unzip datafile.zip file to access datafile.csv file).

dltins-data-extract's People

Contributors

codinjaoftheworld 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.