Skip to main content

A tool to parse Aseprite '.ini' format file.

Project description

Aseprite INI

Python PyPI

A tool to parse Aseprite .ini format file.

This format is being used for language translation strings.

Installation

pip install aseprite-ini

Usage

import os

from aseprite_ini import Aseini
from examples import assets_dir, outputs_dir


def main():
    strings_en = Aseini.pull_strings('main')
    strings_en.fallback(Aseini.pull_strings('v1.3-rc4'))
    strings_en.fallback(Aseini.pull_strings('v1.2.40'))
    strings_en.save(os.path.join(outputs_dir, 'en.ini'))

    strings_my = Aseini.load(os.path.join(assets_dir, 'my.ini'))
    translated, total = strings_my.coverage(strings_en)
    print(f'progress: {translated} / {total}')
    strings_my.save(os.path.join(outputs_dir, 'my.ini'), strings_en)
    strings_my.save_alphabet(os.path.join(outputs_dir, 'my.txt'))


if __name__ == '__main__':
    main()

Dependencies

License

Under the MIT license.

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

aseprite-ini-0.0.2.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

aseprite_ini-0.0.2-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

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