Package: fast-webflow
Welcome to fast-webflowa WebFlow CMS API Client in PythonThis Python library provides anintuitiveandfastinterface over WebFlow's API. It simplifies the process of integrating your Python applications with the WebFlow content management system (CMS), allowing you to create, read, update, and delete items within your WebFlow collections.Check out an example website built with the help offast-webflow:liguriasegreta.comDISCLAIMER: This is anunofficialabstraction over WebFlow's API and I am not associated with the WebFlow team.RoadmapAdde-commercefunctionalityAddmembershipfunctionalityAdd testsFinish documentationPublish to PyPiFeaturesAuthenticatewith the WebFlow API using your API keyFetch,Create,Update, andDeleteItems and files from WebFlow CollectionsHandlepaginationfor large CollectionsHidden parallelization forfaster operations(with implicit error handling)InstallationYou can install the package using pip:pipinstallfast-webflowGetting StartedObtain an API key from WebFlow by following theirAPI Access Token.Import thecmsmodule from thefast-webflowpackage automatically to interact with the WebFlow CMS API; then authenticate:importwebflow.cmsascmsapi_key='YOUR_API_KEY'cms.authenticate(api_key)Start interacting with the WebFlow API using the provided methods. For example, to fetch all items from a collection:fromwebflow.cmsimportCollectioncollection_id='COLLECTION_ID'collection=Collection(collection_id)items=collection.get_all_items()foriteminitems:print(item["slug"])ExamplesIf you are quickly searching for a particular code snippet, I hope you can find it here. These all
assume that youare already authenticated(if not, seethe quickstart).Create CMS ElementsElements from the CMS are handled via classes, with relevant methods for each. Classes also behave like dictionaries, holding by default some basic information (fetched from the CMS at creation time).fromwebflow.cmsimportSite,Collection,Item# connect to the Sites part of the APIsite_id='YOUR_SITE_ID'site=Site(site_id)# connect to the Collections part of the APIcollection_id='YOUR_COLLECTION_ID'collection=Collection(collection_id)# connect to the Items part of the APIitem_id='YOUR_ITEM_ID'item=Item(item_id)Fetch Datafromwebflow.cmsimportSite,Collection,Item# get list of available sitessites=cms.list_sites()site_id=sites[0]['_id']# connect to that site's CMS and get some datasite=Site(site_id)assertsite_id==site.id==site['_id']collections=site.get_collections()domains=site.get_domains()site_details=site.get_data()site_name=site['name']# connect to a collection in the CMS and get some datacollection_id='YOUR_CONNECTION_ID'collection=Collection(collection_id)items=collection.get_all_items()# connect to an item in the CMS and get some dataitem_id='YOUR_ITEM_ID'item=Item(item_id)item_data=item.get_data()Publish Websitefromwebflow.cmsimportSite# connect to that site's CMS and publish itsite_id='YOUR_SITE_ID'site=Site(site_id)site.publish()# you may specify custom domains toosite.publish(['www.first.domain.com','www.second.domain.com'])Upload Datafromwebflow.cmsimportSite,Collection,Itemnew_items=[{'name':'first item,'slug':'item1},{'name':'second item,'slug':'item2},]added_items=collection.post_items(new_items)ContributingContributions to the fast-WebFlow Python Client library are welcome! If you encounter any bugs, have suggestions, or would like to contribute new features, please feel free to open an issue or submit a pull request on GitHub. You can also contact me directly!Open a new issuePull RequestsEmail meLicenseThis project is licensed under the GNU GPLv3 License. See theLICENSEfile for more information.