Skip to main content

Convert Android vector drawable XML files to Apple's Asset Catalog format

Project description

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.

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

vectortoapple-0.1.2.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vectortoapple-0.1.2-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file vectortoapple-0.1.2.tar.gz.

File metadata

  • Download URL: vectortoapple-0.1.2.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.6

File hashes

Hashes for vectortoapple-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9516773d293eb1afcf6333e4561830b20c349c082bc795129b0a1b5560a06dd5
MD5 18d2c3cf1840c1e6b554e8211047ae2d
BLAKE2b-256 72fe61b81efe47228cb5cfd8ee5757b2c42eb321a08e02bc6d7fccabf8d93439

See more details on using hashes here.

File details

Details for the file vectortoapple-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: vectortoapple-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.6

File hashes

Hashes for vectortoapple-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8e7bc0cd330f1dc738ce7a7207844445ec1202cb7f44ccb35226c5382ff98a13
MD5 496cbe7b82d9972c57f29c389001a98c
BLAKE2b-256 88e0033a06f9eca2bdac0238d030cff794f698978bb111e9c95273813af86e30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page