.. highlight:: python .. py:module:: schwab.debug .. _help: ============ Getting Help ============ Even the most experienced developer needs help on occasion. This page describes how you can get help and make progress. -------------------------- Asking for Help on Discord -------------------------- ``schwab-py`` has a vibrant community that hangs out in our `discord server `__. If you're having any sort of trouble, this server should be your first stop. Just make sure you follow a few rules to ask for help. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provide Adequate Information ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Nothing makes it easier to help you than information. The more information you provide, the easier it'll be to help you. At the very least, you should provide the code you're using. If you're shy about your code, write a small test script to demonstrate the issue. Also, make sure you `wrap your code in backticks to make it easier to read `__. In addition to your code, it would really help if you shared: 1. Your OS (Windows? Mac OS? Linux?) and execution environment (VSCode? A raw terminal? A notebook? A docker container in the cloud?) 2. Your ``schwab-py`` version. You can see this by executing ``print(schwab.__version__)`` in a python shell. Make sure you're using the most recent version *before* asking for help. You can ensure this using ``pip install --upgrade schwab-py`` 3. The full stack trace and error message. Descriptions of errors will be met with requests to provide more information. Optionally, you may want to share diagnostic logs generated by ``schwab-py``. Not only does this provide even more information to the community, reading through the logs might also help you solve the problem yourself. You can read about enabling logging :ref:`here `. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Format Your Request Properly ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Take advantage of Discord's wonderful `support for code blocks `__ and format your error, stack traces, and code using triple backticks. To do this, put ``````` before and after your message. Failing to do this will be met with a request to edit your message to be better formatted. --------------- Reporting a Bug --------------- ``schwab-py`` is not perfect. Features are missing, documentation may be out of date, and it almost certainly contains bugs. If you think of a way in which ``schwab-py`` can be improved, we're more than happy to hear it. This section outlines the process for getting help if you found a bug. If you need general help using ``schwab-py``, or just want to chat with other people interested in developing trading strategies, you can `join our discord `__. If you still want to submit an issue, we ask that you follow a few guidelines to make everyone's lives easier: .. _enable_logging: ~~~~~~~~~~~~~~ Enable Logging ~~~~~~~~~~~~~~ Behind the scenes, ``schwab-py`` performs diagnostic logging of its activity using Python's `logging `__ module. You can enable this debug information by telling the root logger to print these messages: .. code-block:: python import logging logging.getLogger('').addHandler(logging.StreamHandler()) Sometimes, this additional logging is enough to help you debug. Before you ask for help, carefully read through your logs to see if there's anything there that helps you. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Gather Logs For Your Bug Report ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you still can't figure out what's going wrong, ``schwab-py`` has special functionality for gathering and preparing logs for filing issues. It works by capturing ``schwab-py``'s logs, anonymizing them, and then dumping them to the console when the program exits. You can enable this by calling this method **before doing anything else in your application**: .. code-block:: python schwab.debug.enable_bug_report_logging() This method will redact the logs to scrub them of common secrets, like account IDs, tokens, access keys, etc. However, this redaction is not guaranteed to be perfect, and it is your responsibility to make sure they are clean before you ask for help. When filing a issue, please upload the logs along with your description. **If you do not include logs with your issue, your issue may be closed**. For completeness, here is this method's documentation: .. automethod:: schwab.debug.enable_bug_report_logging ~~~~~~~~~~~~~~~~~~ Submit Your Ticket ~~~~~~~~~~~~~~~~~~ You are now ready to write your bug. Before you do, be warned that your issue may be be closed if: * It does not include code. The first thing we do when we receive your issue is we try to reproduce your failure. We can't do that if you don't show us your code. * It does not include logs. It's very difficult to debug problems without logs. * Logs are not adequately redacted. This is for your own protection. * Logs are copy-pasted into the issue message field. Please write them to a file and attach them to your issue. * You do not follow the issue template. We're not *super* strict about this one, but you should at least include all the information it asks for. You can file an issue on our `GitHub page `__.