This is an unofficial python program to access the Schwab api.
Discord, PyPI, Youtube, Github.
pip install schwabdev
You may need to use pip3
instead of pip
pip install schwabdev
pip3
instead of pip
examples/
folder (add your keys in the .env file)
/docs
folder.
import schwabdev #import the package
client = schwabdev.Client('Your app key', 'Your app secret') #create a client
print(client.account_linked().json()) #make api calls
## What can this program do?
- Authenticate and access the full api.
- Automatic token management and "access token" updates.
- Functions for all api functions (examples in `examples/api_demo.py`)
- Stream real-time data with a customizable response handler (examples in `examples/stream_demo.py`)
### TBD
- Paper trading client
- Automatic refresh token updates. (Waiting for Schwab implementation)
### Notes
The schwabdev folder contains code for main operations:
- `__init__.py` linker to client class.
- `client.py` contains functions relating to api calls and requests.
- `tokens.py` contains functions relating to token management.
- `stream.py` contains functions for streaming data from websockets.
## Youtube Tutorials
1. [Authentication and Requests](https://www.youtube.com/watch?v=kHbom0KIJwc&ab_channel=TylerBowers) *Github code has significantly changed since this video*
2. [Streaming Real-time Data](https://www.youtube.com/watch?v=t7F2dUecgWc&list=PLs4JLWxBQIxpbvCj__DjAc0RRTlBz-TR8&index=2&ab_channel=TylerBowers)
## MIT License
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.