semvec/pypi-packages huggingface dataset:
sphinx-jinja 2.0.2
includes jinja templates in a documentation
License: MIT
Requires Python: >=3.6,<4
Keywords: sphinx,jinja


.. image:: https://github.com/tardyp/sphinx-jinja/actions/workflows/ci.yml/badge.svg

sphinx-jinja
============

A sphinx extension to include jinja based templates based documentation into a sphinx doc

Usage
=====

In your rst doc, you can use the following snippet to use a jinja template to generate your doc

.. code:: rst

    .. jinja:: first_ctx

        {% for k, v in topics.items() %}

        {{k}}
        ~~~~~
        {{v}}
        {% endfor %}

In your sphinx ``conf.py`` file, you can create or load the contexts needed for your jinja templates

.. code:: python

    extensions = ['sphinx_jinja']

    jinja_contexts = {
        'first_ctx': {'topics': {'a': 'b', 'c': 'd'}}
    }

You can also customize the jinja ``Environment`` by passing custom kwargs, adding filters, tests, and globals, and setting policies:

.. code:: python

    jinja_env_kwargs = {
        'lstrip_blocks': True,
    }

    jinja_filters = {
        'bold': lambda value: f'**{value}**',
    }

    jinja_tests = {
        'instanceof': lambda value, type: isinstance(value, type),
    }

    jinja_globals = {
        'list': list,
    }

    jinja_policies = {
        'compiler.ascii_str': False,
    }

Which can then be used in the templates:

.. code:: rst

    Lists
    -----

    {% for o in objects -%}
        {%- if o is instanceof list -%}
            {%- for x in o -%}
                - {{ x|bold }}
            {% endfor -%}
        {%- endif -%}
    {%- endfor %}


Available options
=================

- ``file``: allow to specify a path to Jinja instead of writing it into the content of the
  directive. Path is relative to the current directory of sphinx-build tool, typically the directory
  where the ``conf.py`` file is located.

- ``header_char``: character to use for the the headers. You can use it in your template to set your
  own title character:

  For example:

  .. code:: rst

      Title
      {{ options.header_char * 5 }}

- ``header_update_levels``: If set, a header in the template will appear as the same level as a
  header of the same style in the source document, equivalent to when you use the ``include``
  directive. If not set, headers from the template will be in levels below whatever level is active
  in the source document.

- ``debug``: print debugging information during sphinx-build. This allows you to see the generated
  rst before sphinx builds it into another format.

Example of declaration in your RST file:

.. code:: rst

      .. jinja:: approval_checks_api
         :file: relative/path/to/template.jinja
         :header_char: -

Each element of the ``jinja_contexts`` dictionary is a context dict for use in your jinja templates.


Running tests
=============

* pip install tox
* tox
mystbin.py 4.0.2
A small simple wrapper around the mystb.in API.
License: MIT
Requires Python: >=3.9,<4.0
Keywords: mystbin,paste

<div align="center">
    <h1>Mystbin.py!</h1>
    <a href='https://mystbinpy.readthedocs.io/en/latest/?badge=latest'>
        <img src='https://readthedocs.org/projects/mystbinpy/badge/?version=latest' alt='Documentation Status' />
    </a>
    <a href='https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Linting'>
        <img src='https://github.com/AbstractUmbra/mystbin.py/workflows/Code%20Linting/badge.svg?branch=main' alt='Linting status' />
    </a>
    <a href='https://github.com/AbstractUmbra/mystbin.py/workflows/Build'>
        <img src='https://github.com/AbstractUmbra/mystbin.py/workflows/Build/badge.svg' alt='Build status' />
    </a>
</div>
<br>

A small simple wrapper around the [MystB.in](https://mystb.in/) API.
----------
### Features

- [x] - `POST`ing to the API, which will return the provided url.
- [x] - `GET`ting from the API, provided you know the URL or paste ID.
- [ ] - `DELETE`ing from the API, provided the paste is attached to your account.
- [ ] - `PATCH`ing to the API, provided the paste is attached to your account.
- [x] - Ability to pass in a sync or async session / parameter so it is flexible.
- [x] - Write a real underlying Client for this, it will be required for...
- [ ] - ... Authorization. Awaiting the API making this public as it is still WIP.

### Installation
This project will be on [PyPI](https://pypi.org/project/mystbin.py/) as a stable release, you can always find that there.

Installing via `pip`:
```shell
python -m pip install -U mystbin.py
# or for optional sync addon...
python -m pip install -U mystbin.py[requests]
```

Installing from source:
```shell
python -m pip install git+https://github.com/AbstractUmbra/mystbin-py.git #[requests] for sync addon
```

### Usage examples
Since the project is considered multi-sync, it will work in a sync/async environment, see the optional dependency of `requests` below.

```py
# async example - it will default to async
import mystbin

mystbin_client = mystbin.Client()

paste = await mystbin_client.post("Hello from MystBin!", syntax="python")
str(paste)
>>> 'https://mystb.in/<your generated ID>.python'

paste.url
>>> 'https://mystb.in/<your generated ID>.python'

get_paste = await mystbin_client.get("https://mystb.in/<your generated ID>")
str(get_paste)
>>> "Hello from MystBin!"

paste.created_at
>>> datetime.datetime(2020, 10, 6, 10, 53, 57, 556741)
```

```py
import mystbin

mystbin_client = mystbin.SyncClient()

paste = mystbin_client.post("Hello from sync Mystb.in!", syntax="text")
str(paste)
>>> 'https://mystb.in/<your generated ID>.text'
```

NOTE: There is a timeout of 15s for each operation.
PYPATHER 0.0.3
a Personal package for me.  automatically append paths to sys.path.  mange sys.path package.
License: MIT
Keywords: PYPATHER

# `PYPATHER`
a Personal package for me

automatically append paths to sys.path

mange sys.path package
## info
when installing and setuping. no need to import it


# installation

Run the following to install:
```cmd
pip install PYPATHER
```
### or
```cmd
python -m pip install PYPATHER
```
if that didn't work, try replacing `pip` with `pip3`.
need help? my discord: [lab](https://discord.gg/vzEZnC7CM8)

## start
when python starts it import some modules. so we're going to inject code
### you need to add this code to one of the modules
i am going to add it to the site.py module at line 90
```py
def initPaths():
    # this func is not part of site.py module this func been added by The User
    sys.modules["PYPATHER"] = __import__("PYPATHER")
    sys.modules["_traceback"] = __import__("traceback")
    PYPATHER = sys.modules["PYPATHER"]
    if PYPATHER.settings.auto():
        PYPATHER.__start__()
    if PYPATHER.settings.exex() and PYPATHER.settings.execit():
        try:
            PYPATHER.exec_globals = {'__builtins__': __builtins__}
            PYPATHER.exec_locals  = {'__builtins__': __builtins__}
            exec(PYPATHER.settings.load()["exec"],
                PYPATHER.exec_globals,PYPATHER.exec_locals)
        except Exception:
            sys.modules["_traceback"].print_exc()

initPaths()
```

## append path to sys.paths
```py
>>> import PYPATHER
>>> PYPATHER.append(["E:\\projects\\packages"]) # append paths to sys.path
```
> **Note**
> this must be use every time. if you want to auto append use DumpPaths and set the setting to auto
## dump a path to `_packages_.json`
```py
>>> import PYPATHER
>>> PYPATHER.DumpPaths(["E:\\projects\\packages"])
>>> PYPATHER.settings.init(auto=True) # now it will always add the paths to sys.path
```
### or 
```py
>>> import PYPATHER
>>> PYPATHER.DumpPaths(["E:\\projects\\packages"])
>>> PYPATHER.__start__() # this will replace sys.path with _packages_.json paths
```


## add exec code
```py
import PYPATHER
code = """
print("i see starting the file :)")
import json
import os
print("import everything :O")
"""
PYPATHER.settings.init(exec=code,execit=True,auto=True) # when python imports X. this code will be exec
```
## get exec code locals
```R
E:\projects>python -q
i see starting the file :)
import everything :O
>>> import PYPATHER
>>> import sys
>>> locals().update(sys.modules["PYPATHER"].exec_locals) # update locals with the exec code locals. 
>>> json # you may get an error if you didnt set the setting to exec=code or the exec code was empty
<module 'json' from 'E:\\python\\Python39\\lib\\json\\__init__.py'>
```
perlwrapper 0.0.1
A Python wrapper for Perl subroutines
License: MIT
Keywords: python,perl,wrapper

# perl-subroutine-wrapper

A Python wrapper for Perl subroutines.

This module makes it easy to call your Perl subroutines from Python. It is perfect for recycling old Perl code that you are not going to translate to Python.

It makes it possible to comunicate objects between the two languages through JSON object representations.

Valid Python objects passed as parameters are: dict, list, str, int, float, True, False, None.

Valid Perl objects returned are: SCALAR, ARRAY, HASH.

## Requirements

In order to use this python module you will need to install jinja2, which will help us with generate the Perl intermediary wrapper dinamically when calling subroutines:

```plaintext
pip install jinja2
```

You also need Perl installed in your computer. You can check if it is installed and the version with the command:

```plaintext
perl -v
```

## Example of usage

*`example.py`* and *`example.pm`* show us how to use the module.
In *`example.pm`* we have a Perl subroutine such as `join` that we want to use in our Python script.

```perl
sub join { 
     my ($list1, $list2)=@_; 
     my @list3; 
     push @list3, @$list1; 
     push @list3, @$list2; 
     print "Joined :)"; 
     return @list3;
}
```

To wrap this subroutine and use it in Python we have to import the module, create a new `Module` instance passing the path of the Perl module, and call the `call` function passing the name of the subroutine, the parameters and the expected Perl object returned like I did in *`example.py`*. `parameters` and `returned_type` can be None.

```python
from perl_subroutine_wrapper import Module


example = Module('example.pm')

join = example.call(
  subroutine='join', 
  parameters=[[2, 3], [1, 1]], 
  return_type='array'
)
print(join)
```

```plaintext
Output:

PerlCallResult(returned=[2, 3, 1, 1], stdout='Joined :)', error=None)
```