Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have permission to ask a question, You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the post.

Please choose the appropriate section so your post can be easily searched.

Please choose suitable Keywords Ex: post, video.

Browse

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Logo

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Navigation

  • Home
  • About Us
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • About Us
  • Contact Us
Home/ Questions/Q 7282

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise Latest Questions

Author
  • 60k
Author
Asked: November 28, 20242024-11-28T02:21:09+00:00 2024-11-28T02:21:09+00:00

Introducing the Anvil API Python Library

  • 60k

The Anvil API is now supported on Python via our official client library. The library is available now on GitHub:

GitHub logo anvilco / python-anvil

Python library and CLI for the Anvil API

and as a package through PyPI via pip install python-anvil or your preferred package manager (i.e. pipenv, poetry).

As a company, we are heavily invested in the Javascript ecosystem; however, we also realize that making our platform more developer-friendly and accessible to other developers means increasing our official API library footprint. That’s why we’ve added Python to our client library as another step towards building a more developer-friendly Anvil. We hope this release gives developers an opportunity to enjoy all that Anvil has to offer.

Features of this initial release:

  • Keeping in line with current Javascript library, it includes:
    • Filling PDFs
    • Generating PDFs
    • Creating Etch Signing Packets
  • A command-line interface (CLI)
    • Contains the above, giving you the ability to test out our features in the Python REPL.
    • The anvil command from this package also has a few additional useful commands that will help you as you build out your integration, such as getting a list of PDF templates (or casts) for use in the “fill-pdf” API endpoint, as well as getting field data from a specific PDF template. All of this can be done from the comfort of your text-based terminal.

Filling PDFs

Filling PDFs lets you fill PDF templates created on Anvil with a simple API call.

First, create a template on your Anvil dashboard:

Dashboard

Once uploaded, Anvil will attempt to find fields for you. You can also create your own fields and adjust any field types if you need something specific such as date formats.

When you finish editing fields, click over to the API Info tab. It shows everything you need to fill the template with the API, including an example payload to quickly get started.

Template Info

With the data on the API Info page, you can now create your API call. The resulting response will be the PDF file:

from python_anvil.api import Anvil  anvil = Anvil(api_key="MY API KEY") data = {     "title": "IRS W-4",     "font_size": 10,     "data": {         "someFieldName": "Example data",         "aNumberField": 1234     } } response = anvil.fill_pdf("template_id_here", data) 
Enter fullscreen mode Exit fullscreen mode

Generating PDFs

The Anvil API also allows you to generate new PDFs using provided JSON data. Useful for agreements, invoices, disclosures, or any other text-heavy documents.

from python_anvil.api import Anvil  anvil = Anvil(api_key="MY API KEY") data = {     "title": "Example Invoice",     "font_size": 12,     "data": [{         "content": "Supports **markdown**",     }, {         "table": {             "rows": [                 ["Description", "Quantity", "Price"],                 ["4x Large Widgets", "4", "$40.00"],                 ["10x Medium Sized Widgets in dark blue", "10", "$100.00"],                 ["6x Small Widgets in white", "6", "$60.00"],             ]         }     }] }  response = anvil.generate_pdf("template_id_here", data) 
Enter fullscreen mode Exit fullscreen mode

Creating Etch Signing Packets

The Anvil Etch E-sign API allows you to collect e-signatures from within your app. Send a signature packet including multiple PDFs, images, and other uploads to one or more signers. Templatize your common PDFs. Then, fill them with your user's information before sending out the signature packet.

This is one of the more complex methods in the API, so please take a look at the Python Anvil docs for a closer look on the process.

Command-line interface

The included CLI gives you quick access to the methods above, as well as some additional GraphQL queries that can help with getting certain data without having to open up your browser.

When running the anvil command by itself, you'll be shown a display of support commands. Each individual command also has additional help documentation on how to use the command.

# The CLI commands will use the environment variable "ANVIL_API_KEY" for all # Anvil API requests. $ ANVIL_API_KEY=MY_GENERATED_KEY anvil Usage: anvil [OPTIONS] COMMAND [ARGS]...  Options:   --debug / --no-debug   --help                Show this message and exit.  Commands:   cast                Fetch Cast data given a Cast eid.   create-etch         Create an etch packet with a JSON file.   current-user        Show details about your API user   download-documents  Download etch documents   fill-pdf            Fill PDF template with data   generate-etch-url   Generate an etch url for a signer   generate-pdf        Generate a PDF   weld                Fetch weld info or list of welds 
Enter fullscreen mode Exit fullscreen mode

Lastly, if you’re developing something cool with PDFs and/or paperwork automation, we’d love to hear more from you! Let us know at (email here) if you have any feedback. Also, if there are any suggestions on new features or issues you may encounter for this library, let us know on the Issue section of the GitHub repo page, and we’ll get back to you.

apigithuntpythonwebdev
  • 0 0 Answers
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

Stats

  • Questions 4k
  • Answers 0
  • Best Answers 0
  • Users 2k
  • Popular
  • Answers
  • Author

    Insights into Forms in Flask

    • 0 Answers
  • Author

    Kick Start Your Next Project With Holo Theme

    • 0 Answers
  • Author

    Refactoring for Efficiency: Tackling Performance Issues in Data-Heavy Pages

    • 0 Answers

Top Members

Samantha Carter

Samantha Carter

  • 0 Questions
  • 20 Points
Begginer
Ella Lewis

Ella Lewis

  • 0 Questions
  • 20 Points
Begginer
Isaac Anderson

Isaac Anderson

  • 0 Questions
  • 20 Points
Begginer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help

Footer

Querify Question Shop: Explore Expert Solutions and Unique Q&A Merchandise

Querify Question Shop: Explore, ask, and connect. Join our vibrant Q&A community today!

About Us

  • About Us
  • Contact Us
  • All Users

Legal Stuff

  • Terms of Use
  • Privacy Policy
  • Cookie Policy

Help

  • Knowledge Base
  • Support

Follow

© 2022 Querify Question. All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.