semvec/pypi-packages huggingface dataset:
pptxvars 1.0.2
Replace {{KEY}} tokens in PPTX while preserving styling & swap frame shapes for images in while preserving sizes
Requires Python: >=3.11

# pptxvars

- **Replace {{KEY}} tokens in PPTX while preserving styling**
- **Swap a Frame for an image in PPTX while preserving size**
- Execute both in sequence from CLI or through import

---

#### Install [pptxvars](https://pypi.org/project/pptxvars/)

```
pip install pptxvars
```

---

## Replace Variables

1. Create a custom powerpoint presentation
2. Define your variables in powerpoint textboxes by {{VARIABLE_NAME}}
3. Define in a YAML file what values must replace the {{KEYS}}. YAML format: `KEY: "value"`
4. Execute replacement (from CLI):

```powershell
pptxvars --template templates/example_prs.pptx `
         --vars templates/example.yml `
         --out 'output/{STEM}_{DATE}.pptx'
```

---

## Swap Frame for Image

1. Create a custom powerpoint presentation
2. Insert frames as placeholder for an image. In powerpoint you can find a frame shape under: `Insert>Shapes>Basic Shapes>Frame`
3. Define in a YAML file what Frames must be swaped. The Frames are swaped per slide in order (Top>Right). YAML format:

```yml
slides:
  - index: 1
    images:
      - example_img.png
```

4. Execute image swap (from CLI):

```powershell
pptxvars --template templates/example_prs.pptx `
         --imgs templates/image_swap.yml `
         --out "output/{STEM}_swapped.pptx"

```

## Both in sequence: replace variables and swap frames for images

From powershell CLI:

```powershell
pptxvars --template templates/input_prs.pptx `
          --vars templates/replace.yml `
          --imgs templates/img_swap.yml `
          --out "output/{STEM}_{DATE}.pptx"
```

From notebook by import:

```python
from pptxvars import render_presentation

output_prs = render_presentation(
    template="templates/input_prs.pptx",
    vars_yml="templates/replace.yml",
    imgs_yml="templates/img_swap.yml",
    out_pattern="output/{STEM}_{DATE}.pptx",
)
```
django-time-wizard 4.2.1
Date and time dependend content manipulation

==================
django-time-wizard
==================

Date and time dependent content manipulation.

Quick start
===========

1. Install using pip::

    pip install django-time-wizard

2. Make sure to follow the installation steps for `django-polymorphic`


3. Add to your `INSTALLED_APPS`::

    'polymorphic',
    'time_wizard',

4. Include the time_wizard admin URLs in your project urls.py::

    path('admin/', include('time_wizard.urls')),

5. Run `python manage.py migrate` to create the time_wizard models.

Note
====

Upgrading from version `0.2.0` to `1.0.0` will delete all the created  models
of `time_wizard`!

Usage
=====

You can use the `TimeWizard` in different ways:

* use a `ForeignKey`-relation

  * use one `TimeWizardModel`-definition for as much models as you want
  * affects your database as the relation needs a new model field
  * example::

      # models.py
      from time_wizard.mixins import TimeWizardMixin
      ...
      class MyModel(TimeWizardMixin, models.Model):
          ...

* use the `PeriodModelInline` in the `admin`

  * each model of yours can have different time-settings
  * does not affect your database as it works with a generic relationship
  * example::

      # models.py
      from time_wizard.mixins import TimeWizardInlineMixin
      ...
      class MyModel(TimeWizardInlineMixin, models.Model):
          ...

      # admin.py
      from time_wizard.admin import PeriodModelInline
      from polymorphic.admin import PolymorphicInlineSupportMixin
      ...
      class MyModelAdmin(PolymorphicInlineSupportMixin, admin.ModelAdmin):
          inlines = [PeriodModelInline]
          ...

* in both ways use `is_published` on your model to indicate if the content
  is shown or not.

* create a custom `PeriodModel` as a base for custom
  `AbsoluteRange`- and `HolidayRange`-models. There are abstract base classes
  defined in `models/abstract.py`. This means you could for example create
  classes without a generic relation, as `PeriodModel` itself has.

Settings
========

Django-time-wizard uses the defined `countries` and `provinces`/`states` from
`holidays`. Definitions need to be compatible with `holidays`. You can also
define this yourself for your needs::

    TIME_WIZARD_COUNTRIES = ['US', 'UK', 'DE', ...]
    TIME_WIZARD_COUNTRY_PROVINCES = {'US': ['AL', 'AK', ...], ...}

Requirements
============

- django
- django-polymorphic
- holidays

Tests
=====

Setup your test environment with `virtualenv` and install the requirements
with `pip install .`. Also install `tox` via pip and simply run `tox`.

Tests can also be run via `devtools/run-tests`. This requires an environment
where `docker` and `docker-compose` are installed.