1.1.7 • Published 1 year ago

german-election-polls v1.1.7

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

German Election Polls

Get, query and sort german election polls.\ An internet connection is required.

Usage

Installing

npm install german-election-polls

TypeScript Example

import { Polls, Query, Order, DataType } from 'german-election-polls';

(async () => {
  const polls = new Polls();

  await polls.update();

  const query = polls.select([
    Query.include([DataType.Surveys]),
    Query.Survey.Tasker.ID.isNot([4, 6]),
    Query.Survey.Release.isGreater(new Date('2021-11-21')),
    Query.Survey.Parliament.Shortcut.is(['Nordrhein-Westfalen (NRW)', 'Baden-Württemberg']),
    Query.Survey.Sort.byParticipants(Order.Asc),
    Query.Survey.Sort.allResults(Order.Desc),
  ]);
})();

JavaScript Example

const polls = require('german-election-polls').Polls;
const Query = require('german-election-polls').Query;
const DataType = require('german-election-polls').DataType;
const Order = require('german-election-polls').Order;

(async () => {
  const polls = new Polls();

  await polls.update();

  const query = polls.select([
    Query.include([DataType.Surveys]),
    Query.Survey.Tasker.ID.isNot([4, 6]),
    Query.Survey.Release.isGreater(new Date('2021-11-21')),
    Query.Survey.Parliament.Shortcut.is(['Nordrhein-Westfalen (NRW)', 'Baden-Württemberg']),
    Query.Survey.Sort.byParticipants(Order.Asc),
    Query.Survey.Sort.allResults(Order.Desc),
  ]);

  console.log(query);
})();

Where the data comes from / Legal

We are using the DAWUM API to collect all data.\ \ Data from dawum.de (License: ODC-ODbL)\ Daten von dawum.de (Lizenz: ODC-ODbL)\ \ This script only parses the data provided by DAWUM. Please make sure you understand the licensing requirements for the actual data.

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.0

2 years ago