New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aiostdlib

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aiostdlib

Only the standard library... but asynchronous!

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

aiostdlib

PyPI Version PyPI Downloads License Python Version

[!WARNING] The library is in the pre-alpha stage.

Key Features

  • Provides asynchronous version of the standard library;
  • The same API as the Python's standard, blocking API;
  • Blocking IO is performed in a separate thread.

Getting Started

Installation

The library is available as aiostdlib on PyPI:

pip install aiostdlib

Usage

The aiostdlib API is the same as the standard library (v3.13), except that it is asynchronous.

[SOON] builtins

For more, see the documentation.

import asyncio

from aiostdlib import builtins


async def main() -> None:
    async with builtins.open("./aiostdlib.txt", mode="w") as file:
        await file.write("aiostdlib")


if __name__ == "__main__":
    asyncio.run(main())
[SOON] io

For more, see the documentation.

import asyncio

from aiostdlib import io


async def main() -> None:
    async with io.open_code("aiostdlib.py") as file:
        data = await file.read()


if __name__ == "__main__":
    asyncio.run(main())
json

For more, see the documentation.

import asyncio

from aiostdlib import builtins, json


async def main() -> None:
    async with builtins.open("./aiostdlib.json", mode="w") as file:
        await json.dump(["aiostdlib"], file)


if __name__ == "__main__":
    asyncio.run(main())
[SOON] pathlib

For more, see the documentation.

import asyncio

from aiostdlib import pathlib


async def main() -> None:
    path = pathlib.Path("./aiostdlib.txt")

    if not await path.exists():
        await path.write_text("aiostdlib")


if __name__ == "__main__":
    asyncio.run(main())
[SOON] shutil

For more, see the documentation.

import asyncio

from aiostdlib import shutil


async def main() -> None:
    await shutil.rmtree("/tmp/aiostdlib/")


if __name__ == "__main__":
    asyncio.run(main())
[SOON] tarfile

For more, see the documentation.

import asyncio

from aiostdlib import tarfile


async def main() -> None:
    if not await tarfile.is_tarfile("./aiostdlib.tar.gz"):
        detail = "The file is not a `tar` archive"
        raise RuntimeError(detail)


if __name__ == "__main__":
    asyncio.run(main())
[SOON] tempfile

For more, see the documentation.

import asyncio

from aiostdlib import tempfile


async def main() -> None:
    tempdir, path = await asyncio.gather(
        tempfile.gettempdir(),
        tempfile.mkdtemp(),
    )

    if not path.startswith(tempdir):
        detail = "This is strange..."
        raise RuntimeError(detail)


if __name__ == "__main__":
    asyncio.run(main())
tomllib

For more, see the documentation.

import asyncio

from aiostdlib import builtins, tomllib


async def main() -> None:
    async with builtins.open("./aiostdlib.toml", mode="rb") as file:
        data = await tomllib.load(file)

        if "aiostdlib" not in data:
            detail = "Where is 'aiostdlib'?"
            raise RuntimeError(detail)


if __name__ == "__main__":
    asyncio.run(main())
[SOON] zipfile

For more, see the documentation.

import asyncio

from aiostdlib import zipfile


async def main() -> None:
    if not await zipfile.is_zipfile("./aiostdlib.zip"):
        detail = "The file is not a `zip` archive"
        raise RuntimeError(detail)


if __name__ == "__main__":
    asyncio.run(main())

License

MIT License, Copyright (c) 2024 Sergei Bogdanov. See LICENSE file.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc