Skip to main content

News Signals

Example Colab Notebooks

These notebooks let you try out news-signals without installing anything!

The Colab notebooks above 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 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.8
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.8 if you're using Anaconda, alternatively python3.8 -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.

Metadata

Release files for news-signals 0.4.0

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.4.0
File Size Uploaded Provenance Actions
news-signals-0.4.0.tar.gz 1.0 MB Without provenance Details for news-signals-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.1 MB

Release files / news-signals-0.4.0.tar.gz

Download URL news-signals-0.4.0.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
1506e05917d9bdf6bb9bc3d9c2e3c440e19ed24d0a136781fc61ba8bfbd9fee8
BLAKE2b-256 checksum
How to use checksums
4df1ffb468e33c884cffec45ecffeac46e50ffd19636ef7427bfaf1952a9040d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

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

Download URL news_signals-0.4.0-py3-none-any.whl
Size 62.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b4106cf90c70402c0b094c74ca55e146793e967bdd2989b197436d41b563808
BLAKE2b-256 checksum
How to use checksums
447562213d9c7e558a175eb96ee6751b6e97f161481407191161fd2526f81a0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Security for news-signals 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files No provenance

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