Skip to main content

Python Package to make use of PavilionCMS

Project description

pavilioncms-python

This is the Python Library for PavilionCMS

Documentation

A comprehensive documentation of our API is available here

Installation

You can install the library from Pypi using pip which is Python's Package manager

$ pip install pavilioncms-python

Usage

Using the PavilionCMS python library is relatively easy after installation.

In your python script, simple import the library and instantiate it with your read token.

You can find the Read Token on the Blog detail page. Each Readtoken is unique and is tied only to a singlular blog

from pavilion_cms import PavilionCMS

client = PavilionCMS(read_token="your-read-token")

Functions

tags => Get all your tags

category => Get all your categories

posts => Get all your published blog posts

The client's tags function has the all, get, next and previous methods for making requests.

The all and get functions also accept an optional params argument to add additional data to the response.

The next and previous functions accept only a url which is gotten from the response of the all method.

Reponses that request for a list are paginated.

Example Usage

response = client.tags.all()

tags = response["results"] 
# data results

count = response["count"]  
# Get all tags count (for pagination)

next_url = response["next"] 
# Get the url for the next page. Defaults to None if there's no data. You can pass this url into the `next` function

previous_url = response["previous"] 
# Get the url for the previous page. Defaults to None if there's no data. You can pass this url into the previous function

print(tags[0])
 #{
 #   'id': '0b4cff81-c655-452a-881f-3a8eeab7ed09', 
 #   'name': 'top table', 
 #   'detail_url': '/api/v1/tag/0b4cff81-c655-452a-881f-3a8eeab7ed09/view/'
 # }

 # To get the categories

 categories = client.category.all()

 # To get the blog posts

 posts = client.posts.all()

..__history:

Release History

0.1.0b0 (2022-12-26)

  • Initial release on PyPI.

0.1.0rc (2023-02-19)

  • Initial release candidate.

0.1.0rc1 (2023-02-19)

  • Initial release candidate.

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

pavilioncms-python-1.0.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

pavilioncms_python-1.0.1-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pavilioncms-python-1.0.1.tar.gz.

File metadata

  • Download URL: pavilioncms-python-1.0.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pavilioncms-python-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3ea725b1c41b5a159c11ce4fcd6ed48b928deea23a0356bdc80c131805805d52
MD5 5940cdc732a6f31a77f4d36ccd02b8bf
BLAKE2b-256 073aa882f3411254ff92af5893be6ce83cc8cd2e8ee3df7a4afe17ffcef875bf

See more details on using hashes here.

File details

Details for the file pavilioncms_python-1.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pavilioncms_python-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 53b08c877274f2ae3017dee8b1933a8d40407e73c00fe29ae8aab5ccb5974a1b
MD5 4038b9f9fa4cf7e6484533121ae81d96
BLAKE2b-256 196a8a29130b96d4352b66216e193612c6194411f41ebeb332e16e37a15dfb19

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