Skip to main content

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:

  1. Clone the repository:

    git clone https://github.com/Ginder-Singh/vectortoapple.git
    cd vectortoapple
    
  2. 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.json files for asset organization.

Requirements

  • Python 3.x
  • cairosvg library
  • PIL (Pillow) library
  • tqdm library
  • Node.js with npx installed
  • vector-drawable-svg package

Setup

  1. Create a virtual environment:
    python -m venv venv
    
  2. Activate the virtual environment:
    • On Windows:
      venv\Scripts\activate
      
    • On macOS/Linux:
      source venv/bin/activate
      
  3. 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.json files for each image set.

Contributing

If you would like to contribute to vectortoapple, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. 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)

Source distribution for vectortoapple 0.1.3
File Size Uploaded
vectortoapple-0.1.3.tar.gz 16.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vectortoapple 0.1.3
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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