Custom OneLink generator for Android and iOS.
Project description
OneLink Generator A Python package for generating platform-specific URLs for Android and iOS with support for custom parameters and fallback URLs.
Installation You can install the package via pip from PyPI:
pip install onelink Or, if you're testing the package from the local source or TestPyPI, use:
pip install --index-url https://test.pypi.org/simple/ onelink Usage
-
Basic Setup To generate OneLink-style URLs for Android and iOS, you need to set the App IDs for each platform and any other parameters you want to include.
-
Creating a Custom Link from onelink.generator import AppLinkGenerator
Initialize the generator with your custom domain
gen = AppLinkGenerator(base_url="https://yourdomain.com")
Set the Android and iOS App IDs
gen.set_android_app_id("com.example.android") gen.set_ios_app_id("123456789")
Optionally, set fallback URLs (for when the app is not installed)
gen.set_android_fallback_url("https://play.google.com/store/apps/details?id=com.example.android") gen.set_ios_fallback_url("https://apps.apple.com/us/app/example/id123456789")
Add custom UTM parameters or any other tracking info
gen.set_custom_param("utm_source", "email", platform="android") gen.set_custom_param("utm_campaign", "holiday2025", platform="ios")
Generate platform-specific links
android_link = gen.generate_android_link() ios_link = gen.generate_ios_link()
Output the generated links
print("Android Link:", android_link) print("iOS Link:", ios_link) Generated Links Android Link: https://yourdomain.com/android?app_id=com.example.android&utm_source=email&utm_campaign=holiday2025&fallback_url=https://play.google.com/store/apps/details?id=com.example.android iOS Link: https://yourdomain.com/ios?app_id=123456789&utm_campaign=holiday2025&fallback_url=https://apps.apple.com/us/app/example/id123456789&utm_source=email
Features
Customizable URLs: Define your own base URL, parameters, and platform-specific links. Fallback URL: If the app is not installed, users will be redirected to the App Store or Play Store. Custom Parameters: Pass UTM parameters or other query parameters. Simple and Extendable: Built with minimal dependencies and easy to extend.
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
File details
Details for the file onelink-0.1.1.tar.gz.
File metadata
- Download URL: onelink-0.1.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77a6b69a24a47671c2d3598d7961e01fa89e45af5f408167939577c86569144a
|
|
| MD5 |
dac701567609e37de94c9d31935fa875
|
|
| BLAKE2b-256 |
124225c09575788b806e580c05a419a9d866421c465cc9b74804334589edc14c
|