https://github.com/guillotinaweb/guillotina_linkintegrity
https://github.com/guillotinaweb/guillotina_linkintegrity
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/guillotinaweb/guillotina_linkintegrity
- Owner: guillotinaweb
- Created: 2018-09-21T14:05:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-09T14:52:57.000Z (almost 4 years ago)
- Last Synced: 2025-07-28T07:36:12.895Z (3 months ago)
- Language: Python
- Size: 73.2 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Guillotina link integrity
[](https://travis-ci.org/guillotinaweb/guillotina_linkintegrity)
[](https://codecov.io/gh/guillotinaweb/guillotina_linkintegrity/branch/master)
[](https://pypi.python.org/pypi/guillotina_linkintegrity/)
[](https://pypi.python.org/pypi/guillotina_linkintegrity)
[](https://pypi.python.org/pypi/guillotina_linkintegrity/)The package aims to provide link integrity support for Guillotina.
Features:
- Ability to check for linked content
- Automatically redirect requests when content is renamed or moved
- Manage aliases to content
- Translate resolveuid urls in text## Dependencies
- Python >= 3.7
- Guillotina > 5
- PG/Cockroachdb with redis## Installation
This example will use virtualenv:
```
python -m venv .
./bin/pip install .[test]
```## Running
Running Postgresql Server:
```
docker run --rm -e POSTGRES_DB=guillotina -e POSTGRES_USER=guillotina -p 127.0.0.1:5432:5432 --name postgres postgres:9.6
```Most simple way to get running:
```
./bin/guillotina
```# API
The package provides some high level APIs for interacting with content.
Working with linked content:
```python
import guillotina_linkintegrity as liawait li.get_links(ob)
await li.get_links_to(ob)
await li.add_links(ob, [ob2, ob3])
await li.remove_links(ob, [ob2, ob3])
await li.update_links_from_html(ob, content)
```How about aliases:
```python
import guillotina_linkintegrity as liawait li.get_aliases(ob)
await li.add_aliases(ob, ['/foo/bar'])
await li.remove_aliases(ob, ['/foo/bar'])# what about aliases from parents that might affect it?
await li.get_inherited_aliases(ob)
```Translate uid linked content:
```python
import guillotina_linkintegrity as liresult = await li.translate_links(content)
```