doc: Improve py md readme

* Put examples in a table
* Show command to create symlinks for intellisense
This commit is contained in:
John Colvin committed 2025-06-16 11:08:56 -04:00
1 parent e1fdf6306b
commit 075acdc8eb
1 file changed
+16 -18
+16 -18
View File
@@ -19,20 +19,22 @@ which can be loaded at runtime.
* Parsing is **NOT** case sensitive (though it is conventional to use `UPPER_CASE` strings)
* Type name prefixes (SECURITY_TYPE_, VENUE_, SIDE_ etc.) are **NOT** required
* ***Having said that,*** we recommend UPPER_CASE strings without the type prefix. Here are a few examples:
* SECURITY_TYPE
* "SPOT"
* "FUTURE"
* "OPTION"
* etc.
* VENUE:
* "BYBIT"
* "GATEIO"
* "DERIBIT"
* "COINBASE"
* etc.
* SIDE, AGGRESSOR_SIDE:
* "BUY"
* "SELL"
| Enum | Examples |
|------|---------|
| **SecurityType** | "SPOT", "FUTURE", "OPTION" |
| **Venue** | "BYBIT", "GATEIO", "DERIBIT", "COINBASE" |
| **Side** | "BUY", "SELL" |
* All .py files in the `python_md_providers` dir are copied to a special plugins directory
at build time, so they may be loaded at runtime.
* For intellisense, create symlinks to the *.so* and *.pyi* files in the `python_md_providers` dir
> *These files are excluded from source control via .gitignore, so don't worry about accidentally checking them in*
```bash
# Run in src/lib_python_md/python_md_providers
ln -s ../../../build/sparkd-debug-clang/src/lib_python_md/stubs/python_md_module.pyi .
ln -s ../../../build/sparkd-debug-clang/src/lib_python_md/python_md_module.cpython-310-x86_64-linux-gnu.so .
```
## Example
```python
@@ -83,7 +85,3 @@ class MdProviderExample(pymd.MdProvider):
def stop(self):
print("Stopping MdProviderExample")
```
## Devs
Python files in `python_md_providers/` (child dir of this dir) are copied to<br/>
the plugins directory at build time, and should automatically be loaded at runtime.