Pyexch

Latest version: v0.0.2

Safety actively analyzes 623567 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.0.2

[![PyPI version](https://badge.fury.io/py/pyexch.svg)](https://badge.fury.io/py/pyexch)[![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/license/apache-2-0/)[![GitHub](https://img.shields.io/badge/GitHub-Repo-blue.svg)](https://github.com/brianddk/pyexch)[![GitHub Discussions](https://img.shields.io/badge/GitHub-Discussions-blue.svg)](https://github.com/brianddk/pyexch/discussions)[![Donate with Bitcoin Lightning](https://img.shields.io/badge/Donate-Lightning-yellow.svg)](https://tippin.me/dkbriand)[![Donate with Bitcoin](https://img.shields.io/badge/Donate-Bitcoin-orange.svg)](https://mempool.space/address/bc1qwc2203uym96u0nmq04pcgqfs9ldqz9l3mz8fpj)

***EARLY RELEASE*** of a rudimentary python CLI based rest client for Coinbase


usage: pyexch [-h] [--method <get,post,>] [--url https://...]
[--params params.json] [--call get_accounts]
[--keystore ks.json] [--auth exch.auth]

Python Exchange CLI (pyexch)

optional arguments:
-h, --help show this help message and exit
--method <get,post,> rest http method (get<default>,post,put,delete)
--url https://... rest http url to perform actions upon
--params params.json json(5) filename holding rest parameters / data
--call get_accounts call method in the default client
--keystore ks.json json(5) filename where secrets are stored (backup!)
--auth exch.auth the auth method to use from keystore.

NOTE: Must name either "--call" or "--url", but not both, and "keystore.json"
is assumed if "--keystore" is not named


Install with Debug support

If you want to debug one of the client calls or step into a [requests][rj] call, you can install from GIT sources. Then you can add breakpoints in source using calls to `breakpoint()` to get more detailed information.

1. Get source: `git clone https://github.com/brianddk/pyexch.git`
2. Switch directories: `cd pyexch`
3. Install develop mode via pip: `pip install -e .`
4. Verify install (cli-mode): `pyexch --help`
5. Optionally add `breakpoint()` into one of the `*.py` files
6. Optionally step through code in the python debugger (`pdb`)

Install without GIT

To install the most recent edition directly from GitHub tarball:


pip install https://github.com/brianddk/pyexch/archive/refs/heads/main.tar.gz


You won't get to documentation or templates, but all the code will land and function

Install last release from PIP

1. Install: `pip install pyexch`
2. Verify install: `pyexch --help`

Alternatively you can run it in module mode (`python -m pyexch --help`) or run the script directly (`python pyexch.py --help`).

Future Plans

- [x] Use [JSON5][b] for `load` and `loads` operations
- [x] Add [JSON templates][g]
- [x] Add [Trezor templates][f]
- [x] Add [annotated GnuPG / Trezor / JSON files as docs][e]
- [x] Add Keystore.sort() call to beutify JSON ordering
- [x] Add PUT and DELETE methods for Coinbase (untested)
- [x] Mask input on private data so it's is muted on screen
- [ ] Add [AES encryption][n], or port samples to [CryptoDomeX][o]
- [ ] Add Kraken as a supported Exchange
- [ ] Add Binance as a supported Exchange (from USA ?!?)

<!-- Links -->

[a]: https://docs.python.org/3.12/library/collections.html#collections.OrderedDict (OrderedDict)
[b]: https://github.com/Kijewski/pyjson5 (JSON5)
[c]: https://packaging.python.org/en/latest/tutorials/packaging-projects/ (PyPi)
[d]: https://forums.coinbasecloud.dev/t/did-oauth2-revoke-uri-stop-doing-work/7394 (Revoke URI)
[e]: templates
[f]: templates/trezor_ks.json5
[g]: templates/json_ks.json5
[h]: https://stackoverflow.com/a/21928790/4634229 (AES encryption)
[i]: https://stackoverflow.com/a/48175912/4634229 (CryptoDomeX)
[j]: publish-to-github
[k]: https://docs.readthedocs.io/en/stable/tutorial/index.html (RTD Tutorial)
[n]: https://stackoverflow.com/a/21928790/4634229
[o]: https://stackoverflow.com/a/48175912/4634229
[ra]: https://docs.cloud.coinbase.com/sign-in-with-coinbase (api v2)
[rb]: https://docs.cloud.coinbase.com/advanced-trade-api (api v3)
[rc]: https://github.com/coinbase/coinbase-python/blob/master/README.rst#usage (client v2)
[rd]: https://coinbase.github.io/coinbase-advanced-py/coinbase.rest.html#module-coinbase.rest.accounts (client v3)
[re]: https://docs.cloud.coinbase.com/sign-in-with-coinbase/docs/api-users#show-authorization-information
[rf]: https://github.com/coinbase/coinbase-python#usage
[rg]: https://github.com/Kijewski/pyjson5 (JSON5)
[rh]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#oauth2
[ri]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#api-key--secret
[rj]: https://docs.python-requests.org/en/latest/api/
[rk]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#usage
[rl]: https://coinbase.github.io/coinbase-advanced-py/coinbase.rest.html#restclient-constructor
[rm]: https://coinbase.github.io/coinbase-advanced-py/index.html
[rn]: https://stackoverflow.com/a/21928790/4634229
[ro]: https://stackoverflow.com/a/48175912/4634229
[rp]: https://github.com/coinbase/coinbase-python/?tab=readme-ov-file#market-data

0.0.1

***EARLY PREVIEW RELEASE*** of a rudimentary python CLI based rest client for Coinbase


usage: pyexch [-h] [--method <get,post,>] [--url https://...]
[--params params.json] [--call get_accounts] --keystore ks.json
[--auth exch.auth]

Python Exchange CLI (pyexch)

optional arguments:
-h, --help show this help message and exit
--method <get,post,> rest http method (get<default>,post,put,delete)
--url https://... rest http url to perform actions upon
--params params.json json / json5 filename holding rest parameters / data
--call get_accounts call method in the default client
--keystore ks.json json / json5 filename where secrets are stored
(backup!)
--auth exch.auth the auth method to use from keystore.

NOTE: Must name either "--call" or "--url", but not both


Install from PIP

1. Install: `pip install pyexch`
2. Verify install: `pyexch --help`

Future Plans

- [x] Add GET and POST methods for Coinbase
- [x] Add OAuth2, API_v2 and API_v3 support for Coinbase
- [x] Tag a (beta) release to reduce the nead to use the HEAD
- [x] Release to PyPi for better CDN support
- [ ] Add PUT and DELETE methods for Coinbase
- [ ] Add Kraken as a supported Exchange
- [ ] Add Binance as a supported Exchange (from USA ?!?)
- [ ] Mask input on private data so it's is muted on screen

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.