vectorToApple
Overview
vectortoapple is a Python tool that converts Android vector drawable XML files into iOS, tvOS, and universal-compatible image assets. It generates SVG and PNG files, scales them for different resolutions, and creates the necessary Contents.json files for Xcode asset catalogs.
Installation
To install vectortoapple you can use pip, the Python package manager. Follow the steps below:
Prerequisites
Make sure you have Python 3.6 or higher installed on your system. You can download it from python.org.
Install via PyPI
You can install vectortoapple directly from the Python Package Index (PyPI) using the following command:
pip install vectortoapple
Install from Source
If you prefer to install from the source, you can clone the repository and install it manually:
-
Clone the repository:
git clone https://github.com/Ginder-Singh/vectortoapple.git cd vectortoapple
-
Install the package:
pip install .
Install Development Dependencies
If you want to contribute to the development of vectortoapple, you may want to install the development dependencies. You can do this by creating a virtual environment and installing the requirements:
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
# Install development dependencies
pip install -r requirements.txt
Features
- Converts Android vector drawables to SVG format.
- Converts SVG files to PNG format with specified dimensions.
- Scales PNG images for 1x, 2x, and 3x resolutions.
- Generates
Contents.jsonfiles for asset organization.
Requirements
- Python 3.x
cairosvglibraryPIL(Pillow) librarytqdmlibrary- Node.js with
npxinstalled vector-drawable-svgpackage
Setup
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
- Install required packages:
pip install cairosvg Pillow tqdm
Usage
After installing vectortoapple, you can use it from the command line. Simply run the following command:
vectortoapple
Output
The script will create an .xcassets directory containing:
- SVG files for each vector drawable.
- PNG files scaled for 1x, 2x, and 3x (if applicable).
Contents.jsonfiles for each image set.
Contributing
If you would like to contribute to vectortoapple, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for vectortoapple 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vectortoapple-0.1.3.tar.gz | 16.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vectortoapple-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.6 kB
Release files / vectortoapple-0.1.3.tar.gz
| Download URL | vectortoapple-0.1.3.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0670e289257ee597ac0825de5acdbb2d50cd998ce4501e555988a2c8eadb6b0b
|
|
BLAKE2b-256 checksum How to use checksums |
c71c52f13b31fc1f15cd5feb8c661e2031ebcac1b6c47c460d25b3aa339339fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.6
|
Release files / vectortoapple-0.1.3-py3-none-any.whl
| Download URL | vectortoapple-0.1.3-py3-none-any.whl |
|---|---|
| Size | 17.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9baaf10294ff6b3613d8fde45b9d78a0b3bc29d8a152df7d0e2e179c7c727ffe
|
|
BLAKE2b-256 checksum How to use checksums |
86fbb14b444565168ec897aa2136de24754a329dd355731a0171d1ffc59ea4fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.6
|