semvec/pypi-packages huggingface dataset:
networkx-match 0.1.1
My short description for my project.
License: MIT
Requires Python: >=3.6.0


📦 setup.py (for humans)
=======================

This repo exists to provide [an example setup.py] file, that can be used
to bootstrap your next Python project. It includes some advanced
patterns and best practices for `setup.py`, as well as some
commented–out nice–to–haves.

For example, this `setup.py` provides a `$ python setup.py upload`
command, which creates a *universal wheel* (and *sdist*) and uploads
your package to [PyPi] using [Twine], without the need for an annoying
`setup.cfg` file. It also creates/uploads a new git tag, automatically.

In short, `setup.py` files can be daunting to approach, when first
starting out — even Guido has been heard saying, "everyone cargo cults
thems". It's true — so, I want this repo to be the best place to
copy–paste from :)

[Check out the example!][an example setup.py]

Installation
-----

```bash
cd your_project

# Download the setup.py file:
#  download with wget
wget https://raw.githubusercontent.com/navdeep-G/setup.py/master/setup.py -O setup.py

#  download with curl
curl -O https://raw.githubusercontent.com/navdeep-G/setup.py/master/setup.py
```

To Do
-----

-   Tests via `$ setup.py test` (if it's concise).

Pull requests are encouraged!

More Resources
--------------

-   [What is setup.py?] on Stack Overflow
-   [Official Python Packaging User Guide](https://packaging.python.org)
-   [The Hitchhiker's Guide to Packaging]
-   [Cookiecutter template for a Python package]

License
-------

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any means.

  [an example setup.py]: https://github.com/navdeep-G/setup.py/blob/master/setup.py
  [PyPi]: https://docs.python.org/3/distutils/packageindex.html
  [Twine]: https://pypi.python.org/pypi/twine
  [image]: https://farm1.staticflickr.com/628/33173824932_58add34581_k_d.jpg
  [What is setup.py?]: https://stackoverflow.com/questions/1471994/what-is-setup-py
  [The Hitchhiker's Guide to Packaging]: https://the-hitchhikers-guide-to-packaging.readthedocs.io/en/latest/creation.html
  [Cookiecutter template for a Python package]: https://github.com/audreyr/cookiecutter-pypackage
promplate-inspect 0.0.2.2
[WIP] Inspect a promplate.Template to get its signatures
License: MIT
Requires Python: >=3.8

# promplate-inspect

Inspect input variables used in a `promplate` template.

Useful when instructing an LLM to produce structural data with certain fields,
or for you to quickly understand the data structure a template expects.

```sh
pip install promplate-inspect
```

## Usage

```py
from promplate import Template
from promplate_inspect import find_input_variables_in_template

t = Template("""

    {#
        import a as b
        from c import d
    #}

    {{ e }}

    {{ f.strip() }}

    {{ list }}

    {#
        g += 1
        h = { **h }
    #}

    {% for i in func() %}

        {{ [ j for j in range(i) ] }}

    {% endfor %}

""")

find_input_variables_in_template(t)  # {'e', 'f', 'g', 'h'}
```

Note that it excludes builtin names by default.
If you allow LLM to output variables like `dict` or `list`,
you can specify the second parameter `exclude_builtins`:

```py
find_input_variables_in_template(t, exclude_builtins=False)  # {'e', 'f', 'g', 'h', 'list'}
```

As you see, variables that defined explicitly in the templates are not filtered out as expected.
And functions above like `func` and `range` are always excluded because LLM can never out callable instances typically.

## Limitations

1. This parser is still **work in progress**. If you includes any of these code in your `{{ }}`/`{# #}` tags, the result may be wrong:
   - Parameters of function. Inspecting `{{ (lambda x: x + 1)(y) }}` should output `{'y'}` but outputs `{'x', 'y'}` for now.
   - Similarly, variables defined in `with` statements and `except` statements are not excluded for now.
2. This implementation use `ast` to parse the template. It never run the code, so these monkey patches won't be tracked:
   - Getting variables from `globals()`/`locals()`/`__main__` won't be finded. Such as `name` won't be found in `{{ locals()["name"] }}`.
   - Assigning values to `globals()`/`locals()`/`__main__` won't be excluded. Even if you wrote `{# globals().setdefault("name", "value") #}`, `name` will still be found in `{{ name }}`.
3. For now it only find variables in the given template itself. It don't find variables needed in the components used by it.