Metadata-Version: 2.1
Name: cc-backend-lib
Version: 0.1.0
Summary: A library with classes and types used througout the backend for Conflict Cartographer
Home-page: https://www.github.com/prio-data/cc_backend_lib
License: MIT
Author: peder2911
Author-email: pglandsverk@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: PyMonad (>=2.4.0,<3.0.0)
Requires-Dist: aiohttp (>=3.8.1,<4.0.0)
Requires-Dist: geojson-pydantic (>=0.3.1,<0.4.0)
Requires-Dist: pydantic (>=1.9.0,<2.0.0)
Requires-Dist: redis (>=4.1.2,<5.0.0)
Requires-Dist: toolz (>=0.11.2,<0.12.0)
Description-Content-Type: text/markdown


# CC Backend Client

This library contains several classes and data models that are useful when
writing services that interact with other services in Conflict Cartographer. In
particular, the modules `api_client` and `schema` respectively provide classes
for retrieving and modelling data from APIs.

## Data retrieval

Data retrieval is offered via the `cc_backend_lib.dal.Dal` class. This class is
instantiated by passing several API clients: 

```
from cc_backend_lib.clients import predictions_client, scheduler_client, users_client, countries_client
from cc_backend_lib import dal

cc_dal = dal.Dal(
      predictions = predictions_client.PredictionsClient(...),
      scheduler = scheduler_client.SchedulerClient(...),
      users = users_client.UsersClient(...),
      countries = countries_client.CountriesClient(...),
   )
```

The class has several methods that offer access to data and summaries. See `help(Dal)`

