Skip to main content

Directly upload Figma designs to Q

Project description

How to install

pip install fig2q

Then add a add FIGMA_TOKEN .bashrc or .zshrc. For example:

echo 'export FIGMA_TOKEN=YOURTOKEN' >> ~/.zshrc

You can generate a token on your Figma Account page under the Tab "Security".

How to use

In you project folder, create a file called q.yaml. The file should contain a link to the q-infographic you want to update, and the links to the figma frames that should be used.

- type: infographic
  q: https://qv2.st.nzz.ch/editor/infographic/560x7350xf5bxb3a50cb836998edabcd
  staging: https://qv2.st-staging.nzz.ch/editor/infographic/560x7350xf5bxb3a50cb836998edabcd
  mw: https://www.figma.com/design/26LECd2dAce34lxzgCtala/Mein-Projekt?node-id=1-1787&node-type=FRAME
  cw: https://www.figma.com/design/26LECd2dAce34lxzgCtala/Mein-Projekt?node-id=1-1982&node-type=FRAME
  kw: https://www.figma.com/design/26LECd2dAce34lxzgCtala/Mein-Projekt?node-id=1-1983&node-type=FRAME
  fw: https://www.figma.com/design/26LECd2dAce34lxzgCtala/Mein-Projekt?node-id=1-1984&node-type=FRAME

Then run the script with the following command in the folder with the q.yaml file:

fig2q

Or pass the path of the file as an argument:

fig2q path/to/q.yaml

Only mw and cw are required. The other links are optional. Also, the staging link is optional. If it is not provided, the script will not update the staging version of the q-infographic.

You can also use the script to update a scroll_graphic. In this case, the q.yaml file should look like this:

- type: scroll_graphic
  q: https://qv2.st.nzz.ch/editor/scroll_graphic/599cb06749192d5221a2f8e4dcabcdef
  staging: https://qv2.st-staging.nzz.ch/editor/infographic/560x7350xf5bxb3a50cb836998edabcd
  steps:
      - mw: https://www.figma.com/design/26LECd2dAce34lxzgCtala/Untitled?node-id=1-2&node-type=frame&t=dVqDEKkaO47UMmde-11
        cw: https://www.figma.com/design/26LECd2dAce34lxzgCtala/Untitled?node-id=1-17&node-type=frame&t=dVqDEKkaO47UMmde-11
        text: Text of the first textbox
      - mw: https://www.figma.com/design/26LECd2dAce34lxzgCtala/Untitled?node-id=1-18&node-type=frame&t=dVqDEKkaO47UMmde-11
        cw: https://www.figma.com/design/26LECd2dAce34lxzgCtala/Untitled?node-id=1-19&node-type=frame&t=dVqDEKkaO47UMmde-11
        text: Text of the second textbox

Use it without Figma

If you are not using Figma or don't want to link Frames directly, you can also add image paths.

- type: infographic
  q: https://qv2.st.nzz.ch/editor/infographic/560x7350xf5bxb3a50cb836998edabcd
  mw: pngs/mw.png
  cw: pngs/cw.png

Development

You can run the script from a folder like this:

python -m fig2q q.yaml

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

fig2q-0.1.3.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

fig2q-0.1.3-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file fig2q-0.1.3.tar.gz.

File metadata

  • Download URL: fig2q-0.1.3.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.1

File hashes

Hashes for fig2q-0.1.3.tar.gz
Algorithm Hash digest
SHA256 31562780ed0769e53ffd8d8f77f51e7b57483dc0615e2dc8c36eea9dbc9d2300
MD5 f13e8569b2601596bcec75afd1d3dab8
BLAKE2b-256 e53728c50a4903dbb3c106d73391e4ec6777e6f76e19811d4527765e9bfe000b

See more details on using hashes here.

File details

Details for the file fig2q-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fig2q-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.1

File hashes

Hashes for fig2q-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 13fd1d632887742624aad0dbbec4ae3d842fe8c02dde6799ba7b09e9e4a076f9
MD5 e2ddaf4dae74c3c4c2db026f4634da60
BLAKE2b-256 ac61cd1e473b0be0a5970c0d6e974b192db8fabde31d62b781fc8dfd64211811

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