All Projects → PolarizedIons → Eskom Loadshedding Api

PolarizedIons / Eskom Loadshedding Api

Basic (in-progress) api to expose the eskom endpoints for loadshedding.

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Eskom Loadshedding Api

Stocks
Haskell library for the IEX trading API: https://iextrading.com/developer/docs/
Stars: ✭ 13 (-38.1%)
Mutual labels:  api
Active Forks
Find active github forks of a repo https://git.io/vSnrC
Stars: ✭ 879 (+4085.71%)
Mutual labels:  api
Anabelle
👸 API documentation generator (JSON-RPC / REST)
Stars: ✭ 20 (-4.76%)
Mutual labels:  api
Currencyviewer
Short python framework that dynamically displays and converts the cryptocurrencies in your Kraken wallet into equivalents fiat money.
Stars: ✭ 13 (-38.1%)
Mutual labels:  api
Shgf
Simple HTTP golang framework
Stars: ✭ 13 (-38.1%)
Mutual labels:  api
Covid 19 Api
Covid-19 Virus Data API from Johns Hopkins CSSE
Stars: ✭ 15 (-28.57%)
Mutual labels:  api
Office365 Management Api Elk
An API connector for the Office 365 Management API and the Elastic Stack
Stars: ✭ 13 (-38.1%)
Mutual labels:  api
Repos
Pull down a list of GitHub repos for the given user or org, and save to a local JSON file.
Stars: ✭ 20 (-4.76%)
Mutual labels:  api
Weixinbot
网页版微信API,包含终端版微信及微信机器人
Stars: ✭ 6,903 (+32771.43%)
Mutual labels:  api
E Commerce 2 django
Guest register, user register, user login, user logout, account home page, product view history, change password, reset password, change name, send activation email when register, resend activation email, add shipping address, add billing address, add nickname to the addresses, edit shipping address, edit billing address, view list of your addresses, reuse shipping addresses when order products, reuse billing addresses when ordeer products, show sales analytics if staff or admin only using -chart.js-, get analytics data with Ajax, receive marketing email, change if user will receive marketing email or not by admin, send contact message with Ajax, products list, product detail, download product detail as a PDF file, download digital product files -if the user purchased that digital product only-, orders list, list of digital products files, order detail, download order detail as a PDF file, verify order ownership with Ajax -to secure order detail page-, show cart products, add or remove product from cart, checkout page, thanks page when order placed successfully, add or reuse payment method, add or reuse payment method with Ajax, search products by title, search products by description, search products by price, search products by tag title, write tags for products -by admin only-, auto fill contact email, full name if user logged in.
Stars: ✭ 20 (-4.76%)
Mutual labels:  api
Osrs.me
A comprehensive dataset for OldSchool Runescape.
Stars: ✭ 13 (-38.1%)
Mutual labels:  api
Nhversion
NHVersion for version your api
Stars: ✭ 13 (-38.1%)
Mutual labels:  api
Bookingapi
A simple API to book tickets for public transport in Switzerland.
Stars: ✭ 15 (-28.57%)
Mutual labels:  api
Falko Api
📈 Falko API: Plataform for agile projects management 📊
Stars: ✭ 13 (-38.1%)
Mutual labels:  api
Bandcamp Api
API wrapper for querying band, album, and track data from bandcamp.com
Stars: ✭ 20 (-4.76%)
Mutual labels:  api
Meaju
meaju is a free link shortener from Germany, which everyone can install on his own server.
Stars: ✭ 13 (-38.1%)
Mutual labels:  api
Xlnt
📊 Cross-platform user-friendly xlsx library for C++11+
Stars: ✭ 876 (+4071.43%)
Mutual labels:  api
Zhihu Api
Zhihu API for Humans
Stars: ✭ 911 (+4238.1%)
Mutual labels:  api
Hashapi Lib Node
Tierion Hash API client library for Node.js
Stars: ✭ 20 (-4.76%)
Mutual labels:  api
Express Knex Objection
A simple API system on a pg database, using knex and objection to simplify connection and management
Stars: ✭ 20 (-4.76%)
Mutual labels:  api

Eskom Loadshedding API

Dependencies Downloads Licence Version

A basic (in-progress) api to expose the Eskom loadshedding endpoints. Typescript ready!

Usage / Examples

Get the current status

import { Status, LoadsheddingStage } from 'eskom-loadshedding-api';

Status.getStatus().then((status: LoadsheddingStage) => console.log('Current status: ', status));

Check if currently loadshedding

import { Status, LoadsheddingStage } from 'eskom-loadshedding-api';

Status.getStatus().then((status) => console.log('Is currently loadshedding?', status !== LoadsheddingStage.NOT_LOADSHEDDING));

Search for municipalities

import { Search, Province, Municipality } from 'eskom-loadshedding-api';

Search.getMunicipalities(Province.WESTERN_CAPE).then((municipalities: Municipality[]) =>
    console.log(
        'Western Cape municipalities:',
        municipalities.map((el: Municipality) => el.name)
    )
);

Search for suburbs in municipalities

import { Search, Suburb } from 'eskom-loadshedding-api';

Search.getMunicipalitySuburbs(336 /* Beauford West's id */, 'Aard' /* Search term */).then((suburbs: Suburb[]) => console.log('Filterd suburbs in Beaufort West:', suburbs));

Search for suburbs in SA

import { Search, SearchSuburb } from 'eskom-loadshedding-api';

Search.searchSuburbs('Ashton').then((results: SearchSuburb[]) => console.log('Searching for "Ashton":', results));

Get Schedule for suburb

import { LoadsheddingStage, LoadsheddingSchedule, Schedule } from 'eskom-loadshedding-api';

Schedule.getSchedule(62648 /* Beeldhoursfontein, Beauford West */, LoadsheddingStage.STAGE_1).then((schedule: LoadsheddingSchedule) => console.log(JSON.stringify(schedule, null, 4)));

Schedule.getFullSchedule(62648).then((schedules: LoadsheddingSchedule[]) => console.log(JSON.stringify(schedules, null, 4)));

Methods

Status

  • Status.getStatus(): Promise<LoadsheddingStage>;

Search

  • Search.getMunicipalities(province: Province): Promise<Municipality[]>;
  • Search.getMunicipalitySuburbs(municipalityId: number, searchTerm: string = '', pageNum: number = 1): Promise<Suburb[]>;
  • Search.searchSuburbs(searchTerm: string, maxResults: number = 300): Promise<SearchSuburb[]>;

Schedule

  • Schedule.getSchedule(suburbId: number, stage: LoadsheddingStage): Promise<LoadsheddingSchedule>;
  • Schedule.getFullSchedule(suburbId: number): Promise<LoadsheddingSchedule[]>;

Models

Municipality

class Municipality {
    public id: number;
    public name: string;
}

Suburb

class Suburb {
    public id: number;
    public name: string;
    public total: number;
}

Search Suburb

class SearchSuburb {
    municipality: string;
    province: string;
    suburb: string;
    id: number;
    total: number;
}

Schedule

interface LoadsheddingSchedule {
    schedule: ScheduleDay[];
}

interface ScheduleDay {
    day: Date;
    times: ScheduleTime[];
}

interface ScheduleTime {
    startTime: Date;
    endTime: Date;
}

Enums

Loadshedding Stage

enum LoadsheddingStage {
    UNKNOWN = -1,
    NOT_LOADSHEDDING = 0,
    STAGE_1 = 1,
    STAGE_2 = 2,
    STAGE_3 = 3,
    STAGE_4 = 4,
    STAGE_5 = 5,
    STAGE_6 = 6,
    STAGE_7 = 7,
    STAGE_8 = 8,
}

Province

enum Province {
    EASTERN_CAPE = 1,
    FREE_STATE = 2,
    GAUTENG = 3,
    KWAZULU_NATAL = 4,
    LIMPOPO = 5,
    MPUMALANGA = 6,
    NORTH_WEST = 7,
    NORTHERN_CAPE = 8,
    WESTERN_CAPE = 9,
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].