This guide explains the different licensing options available for GroupDocs.Total for Python via .NET and how to properly set up licensing in your applications.
Overview
GroupDocs offers multiple licensing options to suit your needs:
Free Trial (for evaluation)
30-day Temporary License
Purchased License
Metered License (pay-as-you-go)
Note
For detailed information about our licensing policies and frequently asked questions, please visit the Purchase Policies and FAQ section.
Evaluation Options
Free Trial
The evaluation version is identical to the purchased version and becomes fully licensed once a valid license is applied. However, it includes the following limitations:
Evaluation watermark on output documents
Page processing limits (vary by product)
Other product-specific limitations
Temporary License
For testing without trial limitations, you can request a 30-day Temporary License:
Follow the on-screen instructions to request your temporary license
Apply the license using one of the methods described below
License Application
Important Notes
Set the license only once per application
Set the license before using any GroupDocs.Total code
Multiple calls to set_license are safe but unnecessary
Avoid multiple calls to set_metered_key, as this may interfere with accurate consumption tracking.
License Application Methods
You can apply the license using a file path or a stream.
Note
The following code examples show how to set license for GroupDocs.Conversion API but the process it the same for all of the APIs included into GroupDocs.Total.
1. From a File
The following code demonstrates setting a license from a file:
importosfromgroupdocs.conversionimportLicensedefset_license_from_file():# Get absolute path to license filelicense_path=os.path.abspath("./GroupDocs.Total.lic")# Instantiate License and set the licenselicense=License()license.set_license(license_path)if__name__=="__main__":set_license_from_file()
2. From a Stream
This example shows how to set a license from a stream:
importosfromgroupdocs.conversionimportLicensedefset_license_from_stream():# Get absolute path to license filelicense_path=os.path.abspath("./GroupDocs.Total.lic")# Create a readable steamwithopen(license_path,"rb")aslicense_stream:# Instantiate and set the licenselicense=License()license.set_license(license_stream)if__name__=="__main__":set_license_from_stream()
3. Metered License
A Metered License is also available as an alternative to a traditional license file. It is a usage-based licensing model that may be more suitable for customers who prefer to be billed based on actual API feature usage. For more information, refer to the Metered Licensing FAQ.
The following sample demonstrates how to use metered licensing:
fromgroupdocs.conversionimportMetereddefset_metered_license():# Set your public and private keyspublic_key="******"private_key="******"# Instantiate Metered and set keysmetered=Metered()metered.set_metered_key(public_key,private_key)# Get the number of MBs processedmb_processed=metered.get_consumption_quantity()print("MB processed: ",mb_processed)# Get the number of credits usedcredits_used=metered.get_consumption_credit()print("Credits used: ",credits_used)if__name__=="__main__":set_metered_license()
Troubleshooting
License File Naming
You can rename the license file as needed
Ensure the filename in your code matches the actual file name
Common Issues
Can’t find a license file
If you’re setting a license file using a relative path and encountering issues, try using the absolute file path instead.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.