semvec/pypi-packages huggingface dataset:
drf-weasyprint 1.0.2
A Django REST Framework package for generating PDF files with WeasyPrint.
Requires Python: >=3.9

# DRF PDF

A Django REST Framework package for generating and serving PDF files in your web applications using weasyprint.

## Features

- Generate PDF files dynamically.
- Serve PDFs as API responses.
- Customizable templates for PDF generation.

## Installation

```bash
pip install drf-weasyprint
```

## Prerequisites

Before using this package, ensure you have WeasyPrint installed. You can install it using pip:

```bash
pip install weasyprint
```

For detailed installation instructions and additional dependencies, refer to the [WeasyPrint installation guide](https://doc.courtbouillon.org/weasyprint/stable/index.html).

## Usage

1. Configure weasyprint font:

    ```python
    # In settings.py file

    DRF_WEASYPRINT = {
        "DEFAULT_WEASYPRINT_FONT_CONFIG": "path.to.your.CustomFontConfiguration", # DEFAULT "weasyprint.text.fonts.FontConfiguration"
        "WEASYPRINT_LOG_PATH": "path/to/your/logfile",# DEFAULT None
        "DATA_CONTEXT_NAME": "data", # DEFAULT "data"
    }
    ```

2. Create a view to generate and serve PDFs:

    ```python
    from rest_framework.generics import GenericAPIView
    from drf_weasyprint.mixins import PDFMixin
    from drf_weasyprint.renderers import WeasyPrintPDFRenderer
    

    class MyPDFView(PDFFileMixin, GenericAPIView):
        renderer_classes = [WeasyPrintPDFRenderer]
        template_name = 'my_template.html'
        filename = 'output.pdf'
    ```

3. Add the view to your `urls.py`:

    ```python
    from django.urls import path
    from .views import MyPDFView

    urlpatterns = [
         path('pdf/', MyPDFView.as_view(), name='pdf-view'),
    ]
    ```

4. Create a template (`my_template.html`) for the PDF content.

    For more information on WeasyPrint and its capabilities, visit the [WeasyPrint documentation](https://doc.courtbouillon.org/weasyprint/stable/first_steps.html).

## Contributing

Contributions are welcome! Please submit a pull request or open an issue for any bugs or feature requests.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
hydra-cli 0.0.4
Hydra CLI
Requires Python: >=3.8

# Installation

1. You must have Docker and Python 3 installed.
2. `pip install hydra-cli` (or as desired for your preferred Python environment)

# Getting Started

Just run `hydra` and we'll take care of the rest!

```
$ hydra
```

This will:

1. run `hydra setup` if needed
2. run `hydra connect --start`
   1. start the server
   2. open a psql shell
   3. stop the server and cleanup when you exit the shell

To exit the psql shell, use `exit`, `\q` or `^D`.

Now you're ready to [follow our quickstart guide](https://docs.hydra.so/intro/quickstart) to learn more about serverless
analytics with Hydra.

Any data stored in `duckdb` tables are stored in Hydra's cloud service. Data saved in Postgres (heap) tables will be
stored in a local Docker volume and is not persisted to the cloud.

# Commands

You can run `hydra help` for a list of commands, and `hydra COMMAND --help` to get help about any command.

```
$ hydra
 - runs setup if necessary, starts service, connects, then stops service
$ hydra setup
 - asks for token; optional port, username, password
$ hydra start
 - starts service
$ hydra stop
 - stops service
$ hydra restart
 - stops then starts the service
$ hydra connect
 - connects to service via psql
$ hydra connect --start
 - automatically starts and stops the service around a psql session
$ hydra config
 - prints stored config info
$ hydra teardown
 - prompts to delete configuration files
 - prompts to delete docker volume
$ hydra help
$ hydra --help
 - prints reference top-level information for the CLI
$ hydra COMMAND --help
 - prints helpful information about the command
```

# Configuration

Configuration is persistent. Once you specify your settings, it will remember what port you used. If would like to change
the settings, you can run `hydra setup` again. You can also change the port number at any time with `hydra start`.

## Configuration files

By default, configuration is saved to `hydra-cli` in your platform's user data directory:

* Mac OS X: `~/Library/Application Support/hydra-cli`
* Linux: `~/.local/share/hydra-cli`

You can specify a different configuration directory with `-C`/`--config-dir`, but you will need to pass this in with
every execution.

# Uninstalling

1. `hydra stop` removes the running container, if one remains.
2. `hydra teardown` will confirm removal of the configuration files and the Docker volume, respectively.
3. `pip uninstall hydra-cli` will remove the CLI itself.
viewstate 0.7.0
ASP.NET View State Decoder
Requires Python: >=3.8

ASP.NET View State Decoder
==========================

A small Python library for decoding ASP.NET viewstate.

Viewstate is a method used in the ASP.NET framework to persist changes to a web form across postbacks. It is usually saved on a hidden form field:

.. code-block:: html

   <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEP...">

Decoding the view state can be useful in penetration testing on ASP.NET applications, as well as revealing more information that can be used to efficiently scrape web pages.

.. image:: https://github.com/yuvadm/viewstate/workflows/Build/badge.svg
    :target: https://github.com/yuvadm/viewstate/actions

.. image:: https://img.shields.io/pypi/v/viewstate
    :target: https://pypi.org/project/viewstate/

Install
-------

.. code-block:: shell

   $ pip install viewstate

Usage
-----

The Viewstate decoder accepts Base64 encoded .NET viewstate data and returns the decoded output in the form of plain Python objects.

There are two main ways to use this package. First, it can be used as an imported library with the following typical use case:

.. code-block:: python

  >>> from viewstate import ViewState
  >>> base64_encoded_viewstate = '/wEPBQVhYmNkZQ9nAgE='
  >>> vs = ViewState(base64_encoded_viewstate)
  >>> vs.decode()
  ('abcde', (True, 1))

It is also possible to feed the raw bytes directly:

.. code-block:: python

  >>> vs = ViewState(raw=b'\xff\x01....')

Alternatively, the library can be used via command line by directly executing the module:

.. code-block:: shell

  $ cat data.base64 | python -m viewstate

Which will pretty-print the decoded data structure.

The command line usage can also accept raw bytes with the ``-r`` flag:

.. code-block:: shell

  $ cat data.base64 | base64 -d | python -m viewstate -r

Viewstate HMAC signatures are also supported. In case there are any remaining bytes after parsing, they are assumed to be HMAC signatures, with the types estimated according to signature length.

.. code-block:: python

   >>> vs = ViewState(signed_view_state)
   >>> vs.decode()
   >>> vs.mac
   'hmac_sha256'
   >>> vs.signature
   b'....'

Development
-----------

Development packages can be installed with ``uv``. Unit tests, lints and code formatting tasks can be run with:

.. code-block:: shell

  $ uv sync --group dev
  $ uv run pytest
  $ uv run ruff

For PyPI releases, run build and publish:

.. code-block:: shell

  $ uv build
  $ uv publish

Note that for uploading a new package version, a valid PyPI auth token should be configured.

References
----------

Since there is no publically available specification of how .NET viewstate is encoded, reverse engineering was based on prior work:

- https://github.com/mutantzombie/JavaScript-ViewState-Parser
- http://viewstatedecoder.azurewebsites.net/
- https://referencesource.microsoft.com/#System.Web/UI/ObjectStateFormatter.cs,45
- https://msdn.microsoft.com/en-us/library/ms972976.aspx

Any official documents would be gladly accepted to help improve the parsing logic.

License
-------
MIT