StockGeist's REST API Python client.
Project description
stockgeist-client-python
Python client for fetching data from StockGeist's REST API.
The full documentation of the REST API can be found at https://docs.stockgeist.ai.
Installation
You can install the package directly from this repository for getting the version with the latest bug fixes and features
pip install git+https://github.com/stockgeist/stockgeist-client-python.git
or you can install the stable version from PyPI
pip install stockgeist-client-python
Getting started
Basic usage is very straightforward. First you have to create an account with
StockGeist and obtain your token for connecting to the REST API.
Then simply create an instance of StockGeistClient
and pass your StockGeist REST API token to it:
import stockgeist
client = stockgeist.StockGeistClient(token="example-token")
client = stockgeist.StockGeistClient(token="example-token")
Now through the client
object you get the access to all methods for fetching data from the REST API.
Let's say that you want to find out how many messages have been posted on social media in the last hour
about the Apple stock (NASDAQ:AAPL). All you have to do is to run the following code snippet:
aapl_response = client.get_message_metrics(symbol="AAPL", timeframe="1h")
print(aapl_response.as_dict)
Resulting output:
{'timestamp': ['2021-06-11 13:20:00+00:00'], 'total_count': [13.0]}
The aapl_response
is an object encapsulating the data fetched from the API together with some useful
methods to easily explore the data, e.g., plot the time series.
For now, the best source of information about the functionality of stockgeist-client-python
are the
docstrings inside the source files.
You can also find a sample Jupyter notebook demonstrating the possibilities of stockgeist-client-python
in the
samples
directory of this project.
Licence
This package is provided as open source under the terms of the MIT Licence.
Contributing
Feel free to contact us at stockgeist@neurotechnology.com or simply create an issue if you would like to see additional features implemented in this package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file stockgeist-client-python-0.1.0.tar.gz
.
File metadata
- Download URL: stockgeist-client-python-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bd8b873bde2f4cfa69a229e17baee0e14e02b7f241f1d081995a9b591a0bac4 |
|
MD5 | cec03970b4cf1e4fc07d8c7af23b911c |
|
BLAKE2b-256 | 3c3901ec8033013c1dcd058e860ea699ddf9e5af415bf5052a49560717a4bbfb |
File details
Details for the file stockgeist_client_python-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: stockgeist_client_python-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73ce6e447c3cdf559789de46895267049eef0939fe10dfaaa6ec5dd63a0af0a3 |
|
MD5 | 8ad2e0f475dec376d18adc2a9f75af76 |
|
BLAKE2b-256 | a383b4bf9157b55522d3f01903039515b4612ceaa084c8b1b3f9de6e93419f2f |