Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Amatobahn/FigmaPy
An unofficial Python3+ wrapper for Figma API
https://github.com/Amatobahn/FigmaPy
api figma python python3 webapi wrapper-api
Last synced: about 2 months ago
JSON representation
An unofficial Python3+ wrapper for Figma API
- Host: GitHub
- URL: https://github.com/Amatobahn/FigmaPy
- Owner: Amatobahn
- License: apache-2.0
- Created: 2018-05-09T14:01:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-14T00:32:26.000Z (about 2 years ago)
- Last Synced: 2024-08-03T16:08:48.266Z (5 months ago)
- Topics: api, figma, python, python3, webapi, wrapper-api
- Language: Python
- Size: 198 KB
- Stars: 47
- Watchers: 5
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-figma - FigmaPy - An unofficial Python3+ wrapper for Figma API. (Rest API integrations)
README
The PyPi package is currently behind on this repo!
An unofficial Python3+ wrapper for Figma API
## Quick start
```python
import figmapy
import pprinttoken = 'REPLACE_WITH_YOUR_TOKEN' # can be found in your figma user profile page
file_key = 'REPLACE_WITH_YOUR_FILE_KEY' # can be found in the URL of the file
figmaPy = figmapy.FigmaPy(token=token)
file = figmaPy.get_file(key=file_key)print([x.name for x in file.document.children])
# ['Page 1', 'Page 2']page1 = file.document.children[0]
print([x.name for x in page1.children])
# ['myArrow', 'myGroup', 'myImage']ids = [x.id for x in page1.children]
print(ids)
# ['7:2', '7:6', '21:4']images = figmaPy.get_file_images(file_key=file_key, ids=ids)
pprint.pprint(images.images)
# {'21:4': 'https://figma-alpha-api.s3.us-west-2.amazonaws.com/images/9bc9fdbd-REDACTED-2d1f31e9b57e',
# '7:2': 'https://figma-alpha-api.s3.us-west-2.amazonaws.com/images/de2afe63d-REDACTED-8abc-9ca5b5f88ac8',
# '7:6': 'https://figma-alpha-api.s3.us-west-2.amazonaws.com/images/f56d5d8dd-REDACTED-af17-461010e0af14'}
```## Install
##### From Source - most up to date codeClone or download the repository, navigate to the root folder and run:
```bash
python setup.py install
```#### From PyPI
```bash
pip install FigmaPy
```
#### Using Distributed Wheel from GitHub:
```bash
pip install FigmaPy-2018.1.0-py3-none-any.whl
```## Documentation
API Documentation : https://www.figma.com/developers/docs