This public workspace has all the APIs you need to interact with Anvil and automate all of your paperwork needs. If at any point you need more information, check out our docs at https://www.useanvil.com/docs/ or email support at support@useanvil.com

About Anvil API

The Anvil API is a comprehensive set of tools and functions that allow developers to build web applications entirely in Python. It provides a unique approach to web development by eliminating the need for HTML, JavaScript, or CSS knowledge. The API encompasses various aspects of web app creation, including user interface design, client-side and server-side programming, data storage, and deployment. Anvil's API is designed to be intuitive and accessible, featuring built-in autocomplete functionality in the Anvil Editor. This feature enhances discoverability, allowing developers to explore API options directly while coding. The API covers a wide range of functionalities, from basic UI components to advanced features like user authentication, email integration, and external service connections (e.g., Google, Microsoft, Facebook, Stripe). The API is structured to support Anvil's app architecture, which typically consists of a user interface created with a drag-and-drop designer, client-side Python code running in the browser, server-side Python code executing on Anvil's servers, and a built-in database system called Data Tables. Additionally, the API facilitates features like one-click deployment, version control, and the ability to expose and consume HTTP APIs, making it a versatile tool for both beginners and experienced developers.

Getting Started

To get started with Anvil:
  1. Sign up for an Anvil account at anvil works.
  2. Once logged in, create a new app by clicking "Create New App" on the dashboard.
  3. Choose a template or start with a blank app.
  4. Familiarize yourself with the Anvil Editor:
    • The left panel contains the App Browser and Component Palette.
    • The center area is your main workspace for designing forms and writing code.
    • The right panel shows properties of selected components.
  5. Design your user interface:
    • Drag and drop components from the Component Palette onto your form.
    • Adjust component properties in the right panel.
  6. Write client-side code:
    • Switch to "Code View" in the Form Editor.
    • Use the autocompleter to explore available methods and properties.
  7. Add server-side functionality:
    • Create a new "Server Module" in the App Browser.
    • Write Python functions decorated with @anvil.server.callable.
  8. Use Data Tables for data storage:
    • Create tables in the "Data Tables" section of the App Browser.
    • Use anvil tables API to interact with your data.
  9. Test your app by clicking the "Run" button at the top of the editor.
  10. Deploy your app by clicking "Publish" and following the prompts.
For additional help:
  • Use the Help Tab in the Anvil Editor (click the "?" icon).
  • Click on help symbols (?) next to components for context-specific documentation.
  • Explore code snippets in the "Code snippets" panel in Code View.
  • Follow tutorials in Anvil's learning centre for guided app-building experiences.

List of API Endpoints

  • anvil.server: For server-side function calls and uplink.
  • anvil.tables: Interact with Data Tables for data storage and retrieval.
  • anvil.users: Manage user authentication and roles.
  • anvil.email: Send and receive emails within your app.
  • anvil.http: Make HTTP requests and create API endpoints.
  • anvil.google.auth, anvil.microsoft.auth, anvil.facebook.auth: Integrate with third-party authentication services.
  • anvil.stripe: Process payments using Stripe integration.
  • anvil.media: Handle file uploads and media content.
  • anvil.js: Interact with JavaScript from Python code.
  • anvil.ui: Access and manipulate UI components programmatically.

Additional Resources:

  • Anvil Documentation: https://anvil.works/docs/
  • Anvil Community Forum: https://anvil.works/forum/
  • Anvil Tutorials: Available in the learning centre
  • API Reference: Comprehensive listing of all Anvil API components
  • How-to Guides: Task-specific guides for common use cases
  • Python Resources: Codecademy, learnpython.org, Python Library reference