GithubHelp home page GithubHelp logo

ianachando / nse-stock-price-crawler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kwoshvick/nse-stock-price-crawler

1.0 0.0 0.0 30.91 MB

Nairobi Security Exchange (NSE) Kenya daily historical prices of all the stocks listed since 11 September 2006

License: MIT License

Python 100.00%

nse-stock-price-crawler's Introduction

NSE Stock Price Crawler

This is a web crawler for Nairobi Security Exchange (NSE) Share prices since its digitization on 11th September 2006 to 28th April 2022. The data crawled can be found in the data folder.

Setup

  • Install python3 and pip3 installed
  pip3 install -r requirements.txt
  • To install the python3 dependencies.

Data Format in the csv

  • Daily csv Format

    • Each csv contains daily prices for all the companies for that day.
    • Code | Name | Lowest Price of the Day | Highest Price of the Day | Closing Price | Previous Day Closing Price | Volume Traded
  • Monthly , Yearly and Company csv Format

    • Each csv contains a particulars company prices for the month/ year
    • Date | Lowest Price of the Day | Highest Price of the Day | Closing Price | Previous Day Closing Price | Volume Traded

The data folder has 4 folders inside:

  • Daily folder Has all NSE daily prices ordered by year and months
  • Monthly folder All daily data put in a single csv for that month ordered by company code name.
  • Yearly folder All monthly data put in a single csv for that year.
  • Company folder All yearly data put in a single csv for that company.

All errors 404 errors for pages not found can be found in the errorlog folder in the error.log

NB Unable to remove the following holidays as of now because they are dynamic

  • Eid al Adha (was gazetted in Kenya as of September 2016)

  • Eid Fitr

Usage

  • To run the crawler
python3 getData.py

getData file

  • Set the following input

    • Start month
    • Start year
    • End month
    • End Year
  • The script also does the following:

    • The script crawls the data given the start dates and end dates. It gets data from mystocks website , credits to them and saves them under the data/daily/ folder.

    • It gets each company's data from the daily csvs. It creates a csv for each company and saves the monthly share prices of that company. The data is stored in the data/monthly/ folder.

    • It gets each company's data from the monthly csvs. It creates a csv for each company and saves the yearly share prices of that company. The data is stored in the data/yearly/ folder.

    • It gets each company's data from the yearly csvs. It creates a csv for each company and saves the company's share prices for the period specified. The data is stored in the data/company/ folder.

nse-stock-price-crawler's People

Contributors

dependabot[bot] avatar kwoshvick avatar

Stargazers

 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.