Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major overhaul for Sopel 8 and Python 3-only #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
include NEWS
include COPYING
include LICENSE
include README.md
include *requirements.txt

recursive-include tests *
recursive-exclude * __pycache__
Expand Down
99 changes: 99 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
## Changelog

### 1.3.0

First release as `sopel-stocks`, replacing `sopel_modules.stocks`.


### 1.2.3

Added:
* Finnhub data provider

Fixed:
* Alpha Vantage API endpoint (yet again)


### 1.2.2

Changed:
* Further Alpha Vantage API updates


### 1.2.1

Fixed:
* Move away from premium Alpha Vantage endpoint

Meta:
* More packaging workflow updates


### 1.2.0

Added:
* Help message for `.stock` command
* Multi-symbol lookup

Meta:
* Project moved to Sopel's GitHub org, and docs/workflows updated


### 1.1.3

Fixed:
* Bug with newly IPO'd stocks


### 1.1.2

Fixed:
* Handling input of foreign ticker symbols

Meta:
* Additional installation documentation


### 1.1.1

Fixed:
* Presentation bug when using IEX Cloud data

Meta:
* Fixed packaging workflow


### 1.1.0

Added:
* IEX Cloud data provider
* New configuration to select data provider


### 1.0.4

Improved documentation and error handling


### 1.0.3

Fixed handling stocks with no prior history, i.e. new symbols


### 1.0.2

Fixed:
* Formatting for penny stocks

Meta:
* Additional packaging tweaks


### 1.0.1

Style/packaging fixes (no corresponding release)


### 1.0.0

Initial release of `sopel_modules.stocks` module, using Alpha Vantage for data.
53 changes: 25 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,45 @@
# sopel-stocks

A stock lookup plugin for Sopel IRC bots

[![Python Tests](https://github.com/sopel-irc/sopel-stocks/actions/workflows/python-tests.yml/badge.svg?branch=master)](https://github.com/sopel-irc/sopel-stocks/actions/workflows/python-tests.yml)
[![PyPI version](https://badge.fury.io/py/sopel-modules.stocks.svg)](https://badge.fury.io/py/sopel-modules.stocks)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/sopel-irc/sopel-stocks.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/sopel-irc/sopel-stocks/alerts/)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/sopel-irc/sopel-stocks.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/sopel-irc/sopel-stocks/context:python)
[![PyPI version](https://badge.fury.io/py/sopel-stocks.svg)](https://badge.fury.io/py/sopel-stocks)

**Maintainer:** [@RustyBower](https://github.com/rustybower)

# sopel-stocks
sopel-stocks is an stock lookup plugin for Sopel

## Installing
If possible, use `pip` to install this plugin. Below are example commands; you
might need to add `sudo` and/or call a different `pip` (e.g. `pip3`) depending
on your system and environment. Do not use `setup.py install`; Sopel won't be
able to load the plugin correctly.

#### Published release
Releases are hosted on PyPI, so after installing Sopel, all you need is `pip`:

pip install sopel-modules.stocks
```shell
$ pip install sopel-stocks
```

#### From source
### Requirements

# Clone the repo, then run this in /path/to/sopel-stocks
pip install .
This release of `sopel-stocks` requires Python 3.8+ and Sopel 8.0 or higher.

## Configuring
You can automatically configure this plugin using the `sopel configure --plugins` command.
You will need an API key from one of the following providers:

However, if you want or need to configure this plugin manually, you will need to define the following in `~/.sopel/default.cfg`
* [Alpha Vantage](https://www.alphavantage.co/support/#api-key)
* [Finnhub](https://finnhub.io/dashboard) (recommended)
* [IEX Cloud](https://iexcloud.io/console/tokens)

[stocks]
api_key = API_KEY
provider = finnhub (or alphavantage/iexcloud)

## Requirements
#### API Key (from 1 of the following providers)
### Configuring

The easiest way to configure `sopel-stocks` is via Sopel's
configuration wizard—simply run `sopel-plugins configure stocks`
and enter the values for which it prompts you.

https://www.alphavantage.co/support/#api-key
https://iexcloud.io/console/tokens
https://finnhub.io/dashboard (recommended)
However, if you want or need to configure this plugin manually, you will need to
define the following in `~/.sopel/default.cfg`

#### Python Requirements
[stocks]
api_key = API_KEY
provider = finnhub (or alphavantage/iexcloud)

requests
sopel

## Usage

Expand Down
59 changes: 59 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[build-system]
requires = ["setuptools>=63.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
platforms = ["Linux x86, x86-64"]

[tool.setuptools.packages.find]
include = ["sopel_stocks", "sopel_stocks.*"]
namespaces = false

[tool.setuptools.dynamic]
readme = { file=["README.md", "NEWS"], content-type="text/markdown" }

[project]
name = "sopel-stocks"
version = "1.3.0.dev0"
description = "Stock lookup plugin for Sopel IRC bots"

authors = [
{ name="Rusty Bower", email="[email protected]" },
]

license = { text="MIT License" }
dynamic = ["readme"]

classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: Eiffel Forum License (EFL)",
"License :: OSI Approved :: Eiffel Forum License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Communications :: Chat :: Internet Relay Chat",
]
keywords = [
"sopel",
"plugin",
"bot",
"irc",
]

requires-python = ">=3.8, <4"
dependencies = [
"sopel>=8.0",
"requests", # Sopel also requires this, but it's better to be explicit
]

[project.urls]
"Homepage" = "https://github.com/sopel-irc/sopel-stocks"
"Bug Tracker" = "https://github.com/sopel-irc/sopel-stocks/issues"

[project.entry-points."sopel.plugins"]
"stocks" = "sopel_stocks.plugin"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

1 change: 0 additions & 1 deletion sopel_modules/__init__.py

This file was deleted.

11 changes: 0 additions & 11 deletions sopel_modules/stocks/__init__.py

This file was deleted.

File renamed without changes.
Loading