Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyxpo-media-library

Photo library permissions and saving photos and videos from pyxpo apps (expo-media-library shape).

This is an optional pyxpo native module. Apps that do not list it carry none of its code, permissions or dependencies.

Install

pip install pyxpo-media-library

Then link it into your app in pyproject.toml:

[tool.pyxpo]
modules = ["media-library"]

and rebuild (pyxpo run ios, pyxpo build android, ...). The build copies the module's Swift and Kotlin sources into the native project and its Python package into the app.

Use

from pyxpo_media_library import MediaLibrary

if (await MediaLibrary.requestPermissionsAsync(writeOnly=True))["granted"]:
    asset = await MediaLibrary.createAssetAsync(path)   # photo or video; {"id", "uri", "mediaType", ...}

getPermissionsAsync(writeOnly=False) / requestPermissionsAsync(writeOnly=False) return expo's {"status", "granted", "canAskAgain", "expires", "accessPrivileges"}; a user who allowed only some photos gets granted with accessPrivileges == "limited". Pass writeOnly=True when you only add to the library.

Permissions and Info.plist keys:

  • iOS: NSPhotoLibraryAddUsageDescription (addUsageDescription option) and NSPhotoLibraryUsageDescription (usageDescription option), set with [tool.pyxpo.module_options.media-library] addUsageDescription = "...".
  • Android: adding needs no permission on Android 10+ (WRITE_EXTERNAL_STORAGE up to Android 9). Reading uses READ_MEDIA_IMAGES / READ_MEDIA_VIDEO / READ_MEDIA_VISUAL_USER_SELECTED on 13+ and READ_EXTERNAL_STORAGE before, declared like expo-media-library does. Google Play restricts the READ_MEDIA_* permissions to apps that need broad photo access.
  • Asset uri is ph://<id> on iOS and a content:// URI on Android; duration is in seconds (0 for photos).

What is in the package

  • pyxpo_media_library/__init__.py: the Python API.
  • pyxpo_media_library/pyxpo-module.json: autolink metadata (bridge name, Swift and Kotlin classes, Android namespace and dependencies, Info.plist keys).
  • pyxpo_media_library/ios/: Swift sources compiled into the iOS app.
  • pyxpo_media_library/android/src/main/: Kotlin sources and the manifest merged into the Android app.

Metadata

Release files for pyxpo-media-library 0.1.0a1

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

Source distribution (sdist)

Source distribution for pyxpo-media-library 0.1.0a1
File Size Uploaded
pyxpo_media_library-0.1.0a1.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyxpo-media-library 0.1.0a1
File Interpreter ABI Platform
pyxpo_media_library-0.1.0a1-py3-none-any.whl Python 3 none any Details

Total release size: 22.9 kB

Release files / pyxpo_media_library-0.1.0a1.tar.gz

Download URL pyxpo_media_library-0.1.0a1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
572fbb8668105d9f835868d9d760771b89936dfae6b0ee8f777e2ef2b547499b
BLAKE2b-256 checksum
How to use checksums
9f5af414283c757ac5bdf9864e34cda733f3f182c3e5311e0bd373c3d0d6787b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release files / pyxpo_media_library-0.1.0a1-py3-none-any.whl

Download URL pyxpo_media_library-0.1.0a1-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28bc5b62ee7f59d84bb9c123dbc12d3abb5532a84c17cd55cee91caf974caaa9
BLAKE2b-256 checksum
How to use checksums
75420020f4cb1ecdf18a0851889870cde8cd501aaec65e9679379c2e06ee240d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 release files

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