Official API wrapper client for the autolook.al service
Project description
Autolook API Client
- The official API wrapper for Python of the https://autolook.al API.
- The API documentation can be found at https://autolook.al/api
- The Package is also uploaded to GitHub: https://github.com/AutolookOrg/autolook-api-py
- The Repo is also uploaded to PyPi: https://pypi.org/project/autolook-api
Quickstart
First you want to install the library: (skip this step if you have locally cloned this library)
pip install autolook-api
Then you can use the API like this:
from autolook_api import AlApiClient, Error, l
import asyncio, dotenv, os, time
async def main():
dotenv.load_dotenv()
alacctoken = os.getenv("ALACCTOKEN") # or hardcoded:
# alacctoken = "alaccauthXXXXXXXXXXXXXXXXXXXXXXXXXXX"
alcli = AlApiClient(alacctoken, debug=False)
try:
await alcli.start()
# Buys a new email address
email = await alcli.buy_email("outlook.com")
l().info(f"Waiting till email: '{email}' receives a new mail (timeout 120 seconds)")
# Tries to find new mails for 120 seconds (if found, it automatically unlocks them)
time_start = time.perf_counter()
new_mails = await alcli.get_new_mails_loop(email, timeout_secs=120, autobuy_locked=True, parse_links=True)
l().info(f"New mails after: {time.perf_counter() - time_start} seconds, found mails: {len(new_mails)}")
for mail in new_mails:
l().debug("- Mail: %s", mail.__str__())
print("---\nDone")
except Error as e: # Library specific errors
l().error(f"{e}", exc_info=True)
except Exception as e: # Generic unhandled error handling
l().error(f"Unexpected: {e}", exc_info=True)
except KeyboardInterrupt as e: # Gracefully shutting down the client upon user exit (Ctrl+C)
l().info("User signaled shutdown, exiting...")
finally:
await alcli.close()
if __name__ == "__main__":
asyncio.run(main())
You can find more examples at the ./examples folder
Notes
- The 01_basic.py
- It is recommended to read through the code, especially the alapi.py and error.py files as they give a good idea of what possible API functions and the input and output structures are
Contributions
Feel free to submit Issues (if the code is wrong) and Pull requests (expansions/feature implementations), however for support, please reach out on Telegram linked on the website
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autolook_api-0.2.0.tar.gz.
File metadata
- Download URL: autolook_api-0.2.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebe836a0f1d0c4456bddae7e49a4f92cf6590fb16bb606e5416bc7ba59b5466a
|
|
| MD5 |
f3155558ee55eb99fdb59709c3cf34b9
|
|
| BLAKE2b-256 |
a7f01a4e0707ad2c4fc86dd17cdcc6503f5184e60162e31c16959a9cc8564507
|
File details
Details for the file autolook_api-0.2.0-py3-none-any.whl.
File metadata
- Download URL: autolook_api-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c48cc4cc829708804311e2ced2a9fe094f76626578080c8f9bc255d87962f13e
|
|
| MD5 |
6ad5cf6c57b64f884bdf68c2a167d8f3
|
|
| BLAKE2b-256 |
b2a207cc9b6c7a6adb690bb6630a1c6403488e8a3566d533f954afbac62da41f
|