Skip to main content

tpdne-py

a very simple wrapper around requests/aiohttp for thispersondoesnotexist.com (and similar)

provides 4 objects, Person, Aioperson, Horse, and AioHorse usage:

from tpdne import Person

def main() -> None:
    x = Person()
    with open('test.png', 'wb') as f:
        f.write(x.bytes)

if __name__ == "__main__":
    main()
from tpdne import AioPerson
import asyncio

async def main() -> None:
    x = await AioPerson()
    with open('test.png', 'wb') as f:
        f.write(x.bytes)

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

optionally fetch=False can be passed to the constructors so that the image can be fetched at a later time with Person.fetch() or await AioPerson.fetch()

from tpdne import Person

def main() -> None:
    x = Person(fetch=False)
    # do something
    bytes = x.fetch()
    with open('test.png', 'wb') as f:
        f.write(bytes)

if __name__ == "__main__":
    main()
from tpdne import AioPerson
import asyncio

async def main() -> None:
    x = await AioPerson(fetch=False)
    # do something
    bytes = await x.fetch()
    with open('test.png', 'wb') as f:
        f.write(bytes)

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

fetch returns bytes so there is no need to directly access .bytes when manually fetching (fetch also updates the instance attribute on first invocation)

Metadata

Release files for tpdne-py 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tpdne-py 0.0.5
File Size Uploaded Provenance Actions
tpdne-py-0.0.5.tar.gz 14.4 kB Without provenance Details for tpdne-py-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tpdne-py 0.0.5
File Interpreter ABI Platform Actions
tpdne_py-0.0.5-py3-none-any.whl Python 3 none any Details for tpdne_py-0.0.5-py3-none-any.whl

Total release size: 28.9 kB

Release files / tpdne-py-0.0.5.tar.gz

Download URL tpdne-py-0.0.5.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9b3443dcb58b37f14a662d761d266ce0dfac8ccbe8b2239ee629ee22a36f3085
BLAKE2b-256 checksum
How to use checksums
6289d1270d518e903dc772ab3b49e8370456572b1969dff5f84cdfb79a6841d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.7

Release files / tpdne_py-0.0.5-py3-none-any.whl

Download URL tpdne_py-0.0.5-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
079fc14c2e1556da4e4eefdeb1a4af87da6500e607ee5ac49e11402b09ab7d36
BLAKE2b-256 checksum
How to use checksums
7530021ee605054f9986b51e16b1a249856ab9dd9e9bcb4eaae72b4b02f10181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.7

Security for tpdne-py 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page