forked from Qewertyy/LexicaAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from lexica import Client | ||
|
||
def main(image_url: str) -> dict: | ||
client = Client() | ||
response = client.AntiNsfw(image_url) | ||
if response['content']['sfw'] == True: | ||
return "This image is safe for work." | ||
else: | ||
return "This image is not safe for work." | ||
|
||
if __name__ == "__main__": | ||
print(main("https://graph.org/file/13e95c6cc932530823391.png")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from lexica import AsyncClient | ||
import asyncio | ||
|
||
async def main(image_url: str) -> dict: | ||
client = AsyncClient() | ||
response = await client.AntiNsfw(image_url) | ||
await client.close() | ||
if response['content']['sfw'] == True: | ||
return "This image is safe for work." | ||
else: | ||
return "This image is not safe for work." | ||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(main("https://graph.org/file/13e95c6cc932530823391.png"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ def get_long_description(): | |
|
||
setup( | ||
name="lexica-api", | ||
version="1.5.0", | ||
version="1.5.1", | ||
author="Qewertyy", | ||
author_email="[email protected]", | ||
description="The python package for api.qewertyy.me", | ||
|