Skip to main content

News Signals

Example Colab Notebooks

These notebooks let you try out news-signals without installing anything! The Colab notebooks below are also available as jupyter notebooks in research/news-signals-example-notebooks

2023-11-30: NEW: Create_Wikimedia_Signals.ipynb shows how to build and explore a WikimediaSignal which does require not a NewsAPI account and works out-of-the-box for anyone.

Quickstart

Install news-signals in a new environment

conda create -n test-signals-pypi python=3.10
conda activate test-signals-pypi

pip install news-signals

Look at a sample dataset

Do pip install jupyter in your environment,

then run the code below in a jupyter notebook or in in the (i)python repl.

from news_signals.signals_dataset import SignalsDataset

# nasdaq100 sample dataset
dataset_url = 'https://drive.google.com/uc?id=150mfU2YA4ScfTlJvO6Duzto4aT_Q7K3D'

dataset = SignalsDataset.load(dataset_url)

Now try:

import matplotlib.pyplot as plt


fig = dataset.plot()
plt.show()

See the API Documentation for more info.

Installation from source

Install news-signals in a new environment

Run conda create -n news-signals python=3.10 if you're using Anaconda, alternatively python3.10 -m venv news-signals or similar. Note python>=3.8 is required.

source activate news-signals
git clone https://github.com/AYLIEN/news-signals-datasets.git
cd news-signals-datasets
pip install -r requirements.txt
pip install -e . # install in editable mode
make test   # run tests

Setting up Aylien NewsAPI credentials

The news-signals library looks for environment variables called 'NEWSAPI_APP_ID' and 'NEWSAPI_APP_KEY' - these are used to authenticate to the NewsAPI.

One way to set these variables up for local development is to Put your Aylien NewsAPI credentials in a file called ~/.aylienconfig .aylienconfig

app-id=<your-app-id>
app-key=<your-app-key>

Then put the following in your .bashrc or similar shell config file:

export NEWSAPI_APP_ID=$(cat ~/.aylienconfig | grep "app-id" | cut -d'=' -f2)
export NEWSAPI_APP_KEY=$(cat ~/.aylienconfig| grep "app-key" | cut -d'=' -f2)

Generating a new Dataset

Generate a new signals dataset as follows:

make create-dataset DATASET_CONFIG=resources/dataset-config-example.json

The config file specifies all relevant settings for a dataset, e.g. time range. Some examples that we used to create our provided example datasets:

A more detailed guide on generating new datasets is here: dataset-generation.md

Anomaly Classification Experiments

These currently live here.

Release files for news-signals 0.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for news-signals 0.8.2
File Size Uploaded
news_signals-0.8.2.tar.gz 1.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for news-signals 0.8.2
File Interpreter ABI Platform
news_signals-0.8.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / news_signals-0.8.2.tar.gz

Download URL news_signals-0.8.2.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
503eadb961362d6a8c5a12e1d9fbb00f338a4244d1c8d40c5ef899a9b29dcb9d
BLAKE2b-256 checksum
How to use checksums
aa554728328e9d139a86c8818b69d6a422b4bb92d9315af32cfe6cad4c50a6e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / news_signals-0.8.2-py3-none-any.whl

Download URL news_signals-0.8.2-py3-none-any.whl
Size 72.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65b94fec0194573b33f1baf7bf04405023e942f5d0982d71b6e8b7ff02943259
BLAKE2b-256 checksum
How to use checksums
c64b9e454272494b8af0dfdea4752f6345df2b37e23ca388b9a487188cfcd178
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release history Release notifications | RSS feed

This release

0.8.2 This release

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.0

2 release files

0.1.13

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page