Skip to main content

A library for working with text and timeseries data.

Project description

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

news-signals-0.2.9.tar.gz (929.2 kB view details)

Uploaded Source

Built Distribution

news_signals-0.2.9-py3-none-any.whl (55.8 kB view details)

Uploaded Python 3

File details

Details for the file news-signals-0.2.9.tar.gz.

File metadata

  • Download URL: news-signals-0.2.9.tar.gz
  • Upload date:
  • Size: 929.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for news-signals-0.2.9.tar.gz
Algorithm Hash digest
SHA256 855cc7e470f355b9a4f5e883b01a35c5401b681eb6a5451442c3e252b1e3ab70
MD5 3a52b74386afc6212c3e5df7735b5072
BLAKE2b-256 6b3d18e03c657e5035a9f355dafbbd909fa66df34b07808bc16da538fcd23090

See more details on using hashes here.

File details

Details for the file news_signals-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: news_signals-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 55.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for news_signals-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 cfb49cce59feab36c532ff7fd54ec79483ca841d9ca07b87ed779b818fde2dfb
MD5 0ead1a003b84698aa03b4f49a6f96cf1
BLAKE2b-256 16c9f735d574ab6c463a946bd2fbdda979581fdc75480dbc238ac78a330c3a27

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page