A simple Prismic client
Project description
pyprismic: a simple python Prismic client
This is a very simple Prismic python client.
It uses the REST API from prismic.
Right now it only supports public Prismic repositories.
Installing
pip install pyprismic
Using it
from pyprismic import Client, as_html
c = Client("your-repo")
res = c.query(predicate="""[[at(document.type, "faq")]]""")
document = res['results][0]
rich_text = document['data']['rich_text_field']
html = as_html(rich_text)
Querying Prismic
For querying prismic, you only need to follow the predicates system that they have in place.
Check the official documentation.
NOTE: it is important to use the triple quote so you can properly use the " for the strings.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyprismic-0.2.1.tar.gz.
File metadata
- Download URL: pyprismic-0.2.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.2 Linux/5.4.0-99-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a69a6fda49a9da97166dbe99a88896fd04ab8f3a651d05594e9c05fb76c0afb5
|
|
| MD5 |
837f67889f2db5a7470c9e47652dcf6d
|
|
| BLAKE2b-256 |
0857e9d9412ea3892e376fb51904a5ffe12c6ffbb3fa796adc36d19287c34d9f
|
File details
Details for the file pyprismic-0.2.1-py3-none-any.whl.
File metadata
- Download URL: pyprismic-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.2 Linux/5.4.0-99-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e0f7d02ee1ddc85d726048c77912185214a6ef4a53a895039008938b179434f
|
|
| MD5 |
5cce1c2f6680f52f1964986877609c5e
|
|
| BLAKE2b-256 |
461304db8198d1d7112aa71f63914ccc6bc16cf9ac05d84f35305c8d2eb1a0ce
|