Tools for working with Figma programmatically
Project description
Kadota
Tools for working with Figma programmatically.
Package page can be found here: https://pypi.org/project/kadota/.
Working with this repository
For creating and regenerating environment file:
conda env create --file env.yaml
conda env export --no-builds | grep -v "^prefix: " > env.yaml
For creating requirements file required for pip installability (may need to install pipreqs):
pipreqs . --force
For deleting old builds:
rm build dist -rf
For building before publishing to pypi:
python setup.py sdist bdist_wheel
For testing before publishing to pypi:
twine check dist/*
For publishing to pypi:
twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
Demo
import kadota.utils
import kadota.figmatools
if __name__ == "__main__":
"""
Function demonstrating usage of kadota.
"""
# Load keys from keys.json and create a FigmaFile object to access a specific file.
keys = kadota.utils.load_keys()
figma_file = kadota.figmatools.FigmaFile(
keys["figma-access-token"],
keys["figma-file-id"]
)
# Retrive all the elements.
print(f"Found {len(figma_file.get_elements())} elements in file.")
# Retrieve a page id.
page_name = "templates"
page_id = figma_file.get_page_ids_by_name(page_name)[0]
print(f"Found page '{page_name}' with id {page_id}.")
# Retrieve all the elements with a specific name.
element_name = "linkedin-square"
print(f"Found {len(figma_file.get_elements(element_name=element_name))} element(s) with name {element_name}.")
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kadota-1.1.0.tar.gz.
File metadata
- Download URL: kadota-1.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bdba1733281909929b45b9fdaf768d06b26fbb5f720aaf6059071f648ad230a
|
|
| MD5 |
0a1302f6b65c9943d648b7251e8f3a46
|
|
| BLAKE2b-256 |
c78aba6a949cbc73451f601b6e543e0cf626067e9f8c9768cfa6a725432fcf2d
|
File details
Details for the file kadota-1.1.0-py3-none-any.whl.
File metadata
- Download URL: kadota-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.3 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.64.1 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f12c35bb1545e6a2fe921005862084e7ff63953d10ef772c27d6ffb1f57a6755
|
|
| MD5 |
fb8cf4db74950bc3d44dffe4f2fffff1
|
|
| BLAKE2b-256 |
df7bd9d3fa99ce6df7601c6d4ef07d9cf0d4afebdef62644007e5d01ef887056
|