Metadata-Version: 2.1
Name: cowin-async
Version: 1.0
Summary: Interact with CoWin APIs
Home-page: UNKNOWN
Author: Prasanna Venkadesh
Author-email: prasmailme@gmail.com
License: UNKNOWN
Project-URL: Source, https://gitlab.com/prashere/cowin-async
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Framework :: AsyncIO
Classifier: Framework :: Trio
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: httpx (==0.18.*)
Provides-Extra: develop
Requires-Dist: pytest-asyncio (==0.15.1) ; extra == 'develop'
Requires-Dist: pytest-cov (==2.11.1) ; extra == 'develop'
Requires-Dist: pytest (==6.2.4) ; extra == 'develop'

## Cowin API

Python package to interact with [COWIN Public API](https://apisetu.gov.in/public/marketplace/api/cowin/cowin-public-v2)

### Features

- [x] Supports both Synchronous and Asynchronous modes.
- [x] 95% test coverage with mocking API responses.
- [x] Get list of states
- [x] Get list of districts for a state
- [x] Generate and Verify OTP
- [ ] Download Certificates

Example:

For API response payload samples visit the [API portal](https://apisetu.gov.in/public/marketplace/api/cowin/cow).

```python
# blocking synchronous client
from cowin import Cowin

client = Cowin()

states = client.get_states()
districts = client.get_districts(state_id=4)

# below function accepts optional datetime.date object
# by default current date is used
vaccine_sessions = client.get_sessions_by_pincode(pincode='605001')

# get OTP to mobile number
response = client.get_otp(mobile='9876543210')
txn_id = response['txnId']

# verify OTP and receive token
response = client.confirm_otp(txn_id=txn_id, otp='123456')
token = response['token']
```

```python
# non-blocking async client
from cowin import AsyncCowin

async_client = AsyncCowin()

states = await async_client.get_stateS()
districts = await async_client.get_districts(state_id=4)

vaccine_sessions = await async_client.get_sessions_by_pincode(pincode='605001')

# get OTP to mobile number
response = await async_client.get_otp(mobile='9876543210')
txn_id = response['txnId']

# verify OTP and receive token
response = await async_client.confirm_otp(txn_id=txn_id, otp='123456')
token = response['token']
```

### Contributions

Issues and pull requests are welcome. Feel free to improve the package.

# License:

LGPL v3.0


