Metadata-Version: 2.1
Name: ani_file
Version: 0.0.1
Summary: ani file reader and writer
Project-URL: Homepage, https://github.com/HoangEevee/ani_file
Author-email: HoangEevee <nguyenquochoang2806@gmail.com>
License: MIT License
        
        Copyright (c) 2022 HoangEevee
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.7
Description-Content-Type: text/markdown

# ani_file 
.ani file (animated cursor) reader and writer written in python 3.

Was trying to batch extract the frame of some .ani file I got but noticed that there were no library to do so in python so I created one. 

**WARNING:** Still in early development. Everything is workable and tested but some names may be changed in the upcoming days (from 31/01/2023) as I clean up the code.
## Starting point
Open ANI file in similar manner to builtin.open():

    f = ani_file.open(file,mode)

`file` can be string or file-like object.

mode can be:
`"r"` or `"rb"` to read an existing .ani file.
`"w"` or `"wb"` to create a new .ani file. **Will overwrite existing file if given same name**

## Read .ani
### Available getter:

`getframesinfo()` (**NOT IMPLEMENTED YET**): dictionary of info about number of frames, display sequence of frames, display rate of frames

`getnframes()`: return number of frames

`getseq`: return list of sequence in which the frames appear

`getrate`: return list of display rate for each frame

`getframesdata`: return list of binary data of each frame

`getauthor`: Get name of artist/corporation if present

`getname`: Get ani file name if present

### Extract and save frames into .ico files:

`saveframestofile(outputpath,filenameprefix)`: Save to specified path. Name of each file will be filenameprefix + index from 0

## Write .ani
### Available getter (**NOT IMPLEMENTED YET**):
Same as for read .ani

### Available setter:

`setframespath(framespath)`: set list of .ico files that make the frames of the final .ani file. The only function that you really need to write an .ani file

`setseq(seq)`: set seq 

`setrate(rate)`: set rate

`setauthor(iart)`: set name of artist

`setname(inam)`: set name of the ani file

### Example (**INCOMING**)

### .ani file structure explain (**INCOMING**)



Code based on wave.py at https://github.com/python/cpython/blob/3.10/Lib/wave.py
