Git Product home page Git Product logo

edgar-analytics's Introduction

Table of Contents

  1. Introduction
  2. Approach
  3. Requirements
  4. Running the code
  5. Testing
  6. Author

Introduction

This Repository was created to submit to the Insight Data Engineering Coding Challenge.

Approach

I approached this coding challenge using Python 3.6 and through an object-oriented perspective. I created three classes to process and store the EDGAR data.

This class is called to process an EDGAR log file and "Sessionize" the log into sessions based on IP address. Two support classes are used to represent the sessions (Session) and the set of sessions (SessionSet).

I ignored the document being retrieved at each request, as duplicate document requests are counted twice.

The Session class:

  • Stores all important information about a session
  • Formats data for output
  • Updates the session as needed
  • Provides a function to assess if the session has ended

The SessionSet class creates, stores, and closes all the sessions. An important feature of this class is that when deleted, it will close all sessions that are open and write them to file. Currently, this occurs at the end of a log file.

Currently, these classes are relatively minimal, but they can be easily extended to:

  • Accept different file formats
  • Change the criteria to end a session
  • Alter the output format

An easy way to speed up processing many log files would be to process separate log files in parallel.

Requirements

Language:

  • Python 3.6

Third-Party Libraries:

  • None

Systems Tested:

  • Windows 10
  • Ubuntu

Running the Code:

This repository's code can be run with:

./run.sh

Testing the Code:

This repository can be tested by:

cd insight_testsuite
chmod +x ./run_tests.sh
./run_tests.sh

Unittests

A few trivial python unittests were provided and added to the run_tests.sh script. These were not the focus of testing but to demonstrate an alternative testing approach. They can be run separately by running:

python setup.py test

Author

Created by Stephen J. Wilson

edgar-analytics's People

Contributors

stephenjwilson avatar

Stargazers

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