Skip to main content

Official API wrapper client for the autolook.al service

Project description

Autolook API Client

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")

        # Tries to find new mails for 120 seconds
        time_start = time.perf_counter()
        new_mails = await alcli.get_new_mails_loop(email, timeout_secs=120)
        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

autolook_api-0.1.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autolook_api-0.1.2-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file autolook_api-0.1.2.tar.gz.

File metadata

  • Download URL: autolook_api-0.1.2.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for autolook_api-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5e83f7f56d2c1de7337f9cb7ec1f1e168c02e28810f3333f11c237019153e6d0
MD5 994c26149b11d7bd366560872c8fa7ce
BLAKE2b-256 5c5671cf34f7b28480dbb2cb20967db9219e1988b5b4f72a1b2b4a2478c6e2a7

See more details on using hashes here.

File details

Details for the file autolook_api-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: autolook_api-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for autolook_api-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9daa36bf174a969c2cd3ed2c98cef6dc50c092cede470b822030dad1bacbab8a
MD5 84bb20146ba9e851c76bb42900037220
BLAKE2b-256 df0cd27f9abef9ec99f3cacd07389a32aaf52f57adcd8c68d2420823495330f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page