Skip to content

Commit

Permalink
add voterid function
Browse files Browse the repository at this point in the history
  • Loading branch information
nerdyk3 committed Apr 30, 2024
1 parent e143983 commit c62327a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ In this function, User pass the generated key after login and Passport Card imag
dict = b.passport(key, image)
```

**Voter ID**

In this function, User pass the generated key after login and voter id Card image path.

```
import bharatocrclient as b
dict = b.voterid(key, front_image, back_image)
```

### Contribute & support
We are so pleased to your help and help you, If you wanna develop bharatocrclient, Congrats or if you have problem, don't worry create an issue here:

Expand Down
11 changes: 10 additions & 1 deletion bharatocrclient/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@
register,
driving_licence,
passport,
voterid,
)


__all__ = ["pan", "aadhaar", "login", "register", "driving_licence", "passport"]
__all__ = [
"pan",
"aadhaar",
"login",
"register",
"driving_licence",
"passport",
"voterid",
]
1 change: 1 addition & 0 deletions bharatocrclient/clients/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
from bharatocrclient.clients.driving_licence import driving_licence
from bharatocrclient.clients.passport import passport
from bharatocrclient.clients.auth import login, register
from bharatocrclient.clients.voter_id import voterid
16 changes: 16 additions & 0 deletions bharatocrclient/clients/voter_id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import requests as re
from bharatocrclient.clients.common import get_full_path


def parse_voterid_card(key, front_image_path, back_image_path):
url = get_full_path("voter-id")
files = {
"front_side": open(front_image_path, "rb"),
"back_side": open(back_image_path, "rb"),
}
headers = {"Authorization": f"Bearer {key}"}
return re.post(url=url, files=files, headers=headers).json()


def voterid(key, front_image_path, back_image_path):
return parse_voterid_card(key, front_image_path, back_image_path)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setuptools.setup(
name="bharatocr-client",
version="0.1.1",
version="0.2.0",
description="bharatocr-client is an opensource python library to access BharatOcrAPIs ",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit c62327a

Please sign in to comment.