Metadata-Version: 2.1
Name: pycwatch-lib
Version: 2.0.0
Summary: A client library for the Cryptowatch Rest API.
Home-page: https://github.com/ljnsn/pycwatch
License: MIT
Keywords: cryptocurrency,crypto,prices,cryptowatch
Author: ljnsn
Author-email: 82611987+ljnsn@users.noreply.github.com
Requires-Python: >=3.7,<4.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Provides-Extra: test
Requires-Dist: api-client (>=1.3.1)
Requires-Dist: attrs (>=23.1.0)
Requires-Dist: black (>=22.1,<23.7) ; extra == "test"
Requires-Dist: cattrs (>=23.1.2)
Requires-Dist: cfgv (<3.4.0) ; extra == "test"
Requires-Dist: commitizen (>=2.38.0) ; extra == "test"
Requires-Dist: coverage[toml] (>=6.3.2,<7.0.0) ; extra == "test"
Requires-Dist: cz-conventional-gitmoji (>=0.1.2) ; extra == "test"
Requires-Dist: identify (<=2.5.24) ; (python_version < "3.8") and (extra == "test")
Requires-Dist: importlib-metadata (<4.3) ; python_version < "3.8"
Requires-Dist: mypy (>=0.931,<1.4) ; extra == "test"
Requires-Dist: pre-commit (<3.0) ; extra == "test"
Requires-Dist: pytest (>=7.0.1) ; extra == "test"
Requires-Dist: pytest-cov (>=3,<5) ; extra == "test"
Requires-Dist: requests (>=2.27.1)
Requires-Dist: ruff (>=0.0.253) ; extra == "test"
Requires-Dist: types-requests (>=2.27.11) ; extra == "test"
Requires-Dist: types-ujson (>=5.8.0.1) ; extra == "test"
Requires-Dist: typing-extensions (>=4.7.1) ; python_version < "3.10"
Requires-Dist: ujson (>=5.7.0)
Requires-Dist: vcrpy (>=4.1.1) ; extra == "test"
Project-URL: Repository, https://github.com/ljnsn/pycwatch
Description-Content-Type: text/markdown

# pycwatch

[![Coverage](https://img.shields.io/codecov/c/github/ljnsn/pycwatch?color=%2334D058)](https://codecov.io/gh/ljnsn/pycwatch)
[![Package version](https://img.shields.io/pypi/v/pycwatch?color=%2334D058&label=pypi%20package)](https://pypi.org/project/pycwatch)
[![Python versions](https://img.shields.io/pypi/pyversions/pycwatch.svg)](https://pypi.org/project/pycwatch)
[![Black style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

The `pycwatch` library provides access to the [Cryptowatch API](https://docs.cryptowat.ch/rest-api/) and implements all resources of the REST API.

## Installation

Either install from pypi or clone this repository and install locally.

```fish
pip install pycwatch
```

## Quick Start

See the [cryptowat.ch docs](https://docs.cryptowat.ch/rest-api) for available endpoints.

```python
from pycwatch import CryptoWatchClient

# create api client
client = CryptoWatchClient()

# get list of available assets
assets = client.list_assets()
# get some price info
exchange, pair = "binance", "btceur"
price = client.get_market_price(exchange, pair)
```

If you have an account at [cryptowat.ch](https://cryptowat.ch), you can either set your key as an environment variable or in the code.

```bash
export CRYPTO_WATCH_KEY="my-awesome-key"
```

or

```python
from pycwatch import CryptoWatchClient

api_key = "my-awesome-key"
client = CryptoWatchClient(api_key)
```

Note that anonymous users are limited to 10 Cryptowatch Credits worth of API calls per 24-hour period.
See <https://docs.cryptowat.ch/rest-api/rate-limit#api-request-pricing-structure> for more information.

